Skip to content

Commit 1fe8bc3

Browse files
Development: Add template for documentation (#6)
1 parent 7c9756d commit 1fe8bc3

File tree

14 files changed

+410
-0
lines changed

14 files changed

+410
-0
lines changed

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
_build/
2+
.venv/
3+
.idea/
4+
__pycache__/
5+
.env
6+
venv

docs/.readthedocs.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
version: 2
3+
4+
build:
5+
os: ubuntu-22.04
6+
tools:
7+
python: "3.12"
8+
sphinx:
9+
fail_on_warning: true
10+
python:
11+
install:
12+
- requirements: docs/requirements.txt

docs/Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM sphinxdoc/sphinx
2+
3+
WORKDIR /docs
4+
# create non-root user to be able to edit the generated files without root access later
5+
RUN groupadd -g 1000 sphinx-user \
6+
&& useradd -ms /bin/bash -u 1000 -g 1000 sphinx-user \
7+
&& chown 1000:1000 /docs
8+
ADD requirements.txt /docs
9+
RUN pip3 install -r requirements.txt
10+
11+
USER sphinx-user
12+
EXPOSE 8000
13+
# use the autobuild as default command
14+
ENV SPHINXOPTS="--port 8000 --host 0.0.0.0"
15+
CMD exec make livehtml

docs/Makefile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
# -W: treat warnings as errors
7+
SPHINXOPTS ?= -W
8+
SPHINXBUILD ?= sphinx-build
9+
SOURCEDIR = .
10+
BUILDDIR = _build
11+
12+
# Put it first so that "make" without argument is like "make help".
13+
help:
14+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
15+
16+
livehtml:
17+
sphinx-autobuild "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
18+
19+
.PHONY: help Makefile
20+
21+
# Catch-all target: route all unknown targets to Sphinx using the new
22+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
23+
%: Makefile
24+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/README.md

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
# Atlas Documentation
2+
3+
We use [Sphinx] for creating the Atlas documentation using [reStructuredText] (RST).
4+
To get started with RST, check out the [Quickstart] or this [cheatsheet].
5+
6+
Please document the features that you have developed as **extensive as possible** from the user perspective, because the documentation also serves as a **user manual**. This is really important so that users can better understand how to use Atlas.
7+
8+
Creating a user manual for a service such as Atlas can be a bit of a juggling act, especially when it's for students. Here are some best practices that should help:
9+
10+
## Best Practices
11+
1. Atlas documentation must use **realistic examples** and personas and must avoid the use of test data.
12+
13+
2. **Keep it simple and user-friendly**: Remember, you're writing for end-users, not just fellow tech enthusiasts. Use plain language, avoid jargon, and explain technical terms when they can't be avoided.
14+
15+
3. **Use visual aids**: Screenshots, diagrams, and even short video tutorials can be a lot more effective than pages of text. They make it easier for students to understand and follow instructions
16+
17+
4. **Structure it intuitively**: Organize the content in a logical flow. Start with basic functions before moving to more advanced features. Think about how a student would use the system and structure your documentation accordingly.
18+
19+
5. **Include a searchable FAQ section**: Let's face it, not everyone is going to read the documentation cover-to-cover. A FAQ section for common issues or questions can be a lifesaver
20+
21+
6. **Apply accessible and inclusive design**: Make sure your documentation is accessible to all students, including those with disabilities. Use clear fonts, alt text for images, and consider a screen-reader-friendly version.
22+
23+
7. **Update regularly**: Atlas evolves, and so should the documentation. Keep it up-to-date with any changes in the system.
24+
25+
8. **Create a feedback loop**: Encourage users to give feedback on the documentation. They might point out confusing sections or missing information that you hadn't considered.
26+
27+
9. **Use familiar information**: This is crucial in the documentation because it simplifies the learning process for new users. Real-world scenarios demonstrate to users how to apply specific features within their own context, whereas test data can mislead and fails to reflect real use cases. Realistic examples and personas provide clarity and relevance, ensuring users can effectively understand and utilize Atlas.
28+
29+
10. **Use well defined personas**: Personas are vital for the development process, they do not only help readers to understand the documentation, but also allow developers to better understand Atlas and its users. Many organizations use personas, the two blog posts below contain additional introduction and motivation for the topic:
30+
- [Using Personas During Design and Documentation](https://www.uxmatters.com/mt/archives/2010/10/using-personas-during-design-and-documentation.php)
31+
- [Customer Personas: How to Write Them and Why You Need Them in Agile Software Development](https://community.atlassian.com/t5/App-Central/Customer-Personas-How-to-Write-Them-and-Why-You-Need-Them-in/ba-p/759228)
32+
33+
11. **Use realistic data**: Screenshots and screencasts included in Atlas documentation **must** present **realistic data**. That includes but is not limited to:
34+
- realistic user, course and competency names
35+
- realistic text passages, like competency titles and descriptions
36+
37+
12. **Avoid test data**: Screenshots and screencasts included in Atlas documentation **must not** present any test data or server information. That includes but is not limited to:
38+
- `Test Server` and `Development` labels
39+
- test user, course and resource names
40+
- _Lorem ipsum_ and mock text passages, like submissions contents and problem statements
41+
- test server and `localhost` domains
42+
43+
13. **Keep screencasts short**: Cut them to at most two minutes to keep the documentation simple and easy to navigate. If you have larger ones, please split them into small screencasts based on the user workflow or features that you describe. Embed videos using TUM.Live and do **not** host them on Youtube (to avoid advertisement and data privacy issues).
44+
45+
46+
47+
48+
49+
## Documentation Hosting
50+
51+
[Read the Docs] (RtD) hosts the [Atlas documentation] for the `develop` (latest) branch, as well as for
52+
git tags and branches of pull requests.
53+
You can switch the shown version at the bottom of the sidebar.
54+
The latest tag is always the _stable_ version.
55+
For pull requests, the documentation is available at `https://atlas-platform--{PR_NUMBER}.org.readthedocs.build/en/{PR_NUMBER}/`.
56+
RtD will build and deploy changes automatically.
57+
58+
## Installing Sphinx Locally
59+
60+
Optionally, create and activate a virtual environment:
61+
```
62+
python3 -m venv venv
63+
```
64+
On Linux or macOS:
65+
```
66+
source venv/bin/activate
67+
```
68+
On Windows (CMD):
69+
```
70+
venv\Scripts\activate.bat
71+
```
72+
On Windows (PowerShell):
73+
```
74+
venv\Scripts\Activate.ps1
75+
```
76+
77+
78+
[Sphinx] can run locally to generate the documentation in HTML and other formats.
79+
You can install Sphinx using `pip` or choose a system-wide installation instead.
80+
When using pip, consider using [Python virtual environments].
81+
```bash
82+
pip install -r requirements.txt
83+
```
84+
or
85+
```bash
86+
pip3 install -r requirements.txt
87+
```
88+
The [Installing Sphinx] documentation explains more install options.
89+
For macOS, it is recommended to install it using homebrew:
90+
```bash
91+
brew install sphinx-doc
92+
brew link sphinx-doc --force
93+
pip3 install -r requirements.txt
94+
```
95+
96+
## Running Sphinx Locally
97+
98+
To generate the documentation as a single HTML file, use the provided `Makefile`/`make.bat` files in the folder `docs`:
99+
```bash
100+
# maxOS / Linux
101+
make singlehtml
102+
103+
# Windows
104+
make.bat singlehtml
105+
```
106+
107+
108+
Using [sphinx-autobuild], the browser will live-reload on changes, ideal for viewing changes while writing documentation:
109+
```bash
110+
# maxOS / Linux
111+
make livehtml
112+
113+
# Windows
114+
make.bat livehtml
115+
```
116+
117+
## Running Sphinx Locally with Docker
118+
119+
To generate the documentation as an HTML file, use the provided docker command from the project root:
120+
```bash
121+
docker run --rm -v ${PWD}/docs:/docs $(docker build -q -t sphinx -f docs/Dockerfile ./docs) make singlehtml
122+
```
123+
124+
To auto-generate the documentation as HTML file and live-reload on changes,
125+
use the provided docker command from the project root:
126+
```bash
127+
docker run --rm -it -v ${PWD}/docs:/docs -p 8000:8000 $(docker build -q -t sphinx -f docs/Dockerfile ./docs)
128+
```
129+
130+
## Tool support
131+
A list of useful tools to write documentation:
132+
- [reStructuredText for Visual Studio Code](https://www.restructuredtext.net)
133+
- [LanguageTool for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=adamvoss.vscode-languagetool): Provides offline grammar checking
134+
- [ReStructuredText for IntelliJ](https://plugins.jetbrains.com/plugin/7124-restructuredtext)
135+
136+
137+
138+
<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
139+
[Atlas documentation]: https://atlas-platform.readthedocs.io
140+
141+
[reStructuredText]: https://docutils.sourceforge.io/rst.html
142+
[Quickstart]: https://docutils.sourceforge.io/docs/user/rst/quickstart.html
143+
[cheatsheet]: http://github.com/ralsina/rst-cheatsheet/raw/master/rst-cheatsheet.pdf
144+
145+
[Sphinx]: https://www.sphinx-doc.org/en/master/
146+
[Installing Sphinx]: https://www.sphinx-doc.org/en/master/usage/installation.html
147+
[Python virtual environments]: https://docs.python.org/3/library/venv.html
148+
[sphinx-autobuild]: https://pypi.org/project/sphinx-autobuild/
149+
[Read the Docs]: https://readthedocs.org
150+
151+
152+
### Dependency management
153+
154+
Find outdated dependencies using the following command:
155+
```
156+
pip list --outdated
157+
```
158+
159+
Find unused dependencies using the following command:
160+
```
161+
pip install deptry
162+
deptry .
163+
```

docs/_static/css/style.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/* This import resolves when built */
2+
@import url("theme.css");
3+
4+
.wy-body-for-nav .wy-nav-content {
5+
max-width: none;
6+
}

docs/admin/admin.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.. _admin:
2+
3+
Admin Guide
4+
================
5+
6+
General admin guide todo

docs/conf.py

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
# import os
14+
# import sys
15+
# sys.path.insert(0, os.path.abspath('.'))
16+
17+
18+
# -- Project information -----------------------------------------------------
19+
20+
project = 'Atlas'
21+
copyright = '2024, Technical University of Munich, Applied Education Technologies'
22+
author = 'Technical University of Munich, Applied Education Technologies'
23+
24+
25+
# -- General configuration ---------------------------------------------------
26+
27+
# The document name of the “main” document, that is, the document
28+
# that contains the root toctree directive.
29+
master_doc = "index"
30+
31+
# Add any Sphinx extension module names here, as strings. They can be
32+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
33+
# ones.
34+
extensions = [
35+
"sphinx_rtd_theme",
36+
"sphinxcontrib.bibtex"
37+
]
38+
39+
# List of patterns, relative to source directory, that match files and
40+
# directories to ignore when looking for source files.
41+
# This pattern also affects html_static_path and html_extra_path.
42+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'venv']
43+
44+
linkcheck_ignore = [
45+
r'http(s)?://.*localhost(:\d+)?/?',
46+
]
47+
# do not check anchors on websites that need JavaScript to load the content
48+
# the anchor points to
49+
linkcheck_anchors_ignore_for_url = [
50+
r"https://angular.io/guide/.*",
51+
r"https://github.com/.*",
52+
r"https://k3d.io/.*"
53+
]
54+
55+
# -- Publications ------------------------------------------------------------
56+
bibtex_bibfiles = ['research/publications.bib']
57+
bibtex_default_style = 'unsrtalpha'
58+
bibtex_reference_style = 'label'
59+
60+
# -- Options for HTML output -------------------------------------------------
61+
62+
# The theme to use for HTML and HTML Help pages. See the documentation for
63+
# a list of builtin themes.
64+
#
65+
html_theme = 'sphinx_rtd_theme'
66+
html_context = {
67+
"display_github": True,
68+
"github_user": "ls1intum",
69+
"github_repo": "Atlas",
70+
"github_version": "develop",
71+
"conf_py_path": "/docs/",
72+
}
73+
html_style = 'css/style.css'
74+
75+
# Add any paths that contain custom static files (such as style sheets) here,
76+
# relative to this directory. They are copied after the builtin static files,
77+
# so a file named "default.css" will overwrite the builtin "default.css".
78+
html_static_path = ['_static']

docs/dev/dev.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.. _dev:
2+
3+
Developer Guide
4+
================
5+
6+
General dev guide todo

0 commit comments

Comments
 (0)