Welcome to the DTU Python support development site.
Our homepage is hosted here.
If you are a DTU student and want help with installing packages for a course at DTU, please visit pythonsupport.dtu.dk.
To build the documentation in a controlled environment we recommend you to use a virtual environment. Subsequently, the required packages should be installed, and lastly the documentation can be built.
The steps can be outlined like this:
-
Create a virtual environment (on a Linux box)
python3 -m venv ps-page-env source ps-page-env/bin/activate
-
Install the requirements:
python3 -m pip install -r requirements.txt sphinx-autobuild # currently there is a blocking dependency on some of the # packages listed in requirements.txt, however, since pip # will allow updating a package that breaks compatibility, we # can use this to our advantage. The documentation builds fine. # Only some non-used features will not work. So we should be fine. # :fingers_crossed: python3 -m pip install -U "sphinx>=7.2.5"
-
Development server (optional)
make livehtml
This will open a local webserver that auto-reloads whenever you make changes to the
rst
documentation or any files in thedocs/
directory. -
Build documentation
make
Now the documentation is build and can be found in
build/html
. -
Open the documentation:
firefox build/html/index.html
And you should be ready to see the just build documentation.
There are some gifs used to show how the terminal looks like.
In order to create these one requires these small packages (which are javascript):
npm
(Node.js package manager)terminalizer
(the script that generates GIFs fromyaml
files)
Once these are installed, simply do:
make gifs
and the gifs should be created. The script will only create them once, and keep them around. So this should only be required to be done once.
You can easily run the site locally (and deployed) using containers. You'll need:
podman
(ordocker
)
Run the following:
podman build . --tag pythonsupport-page:dev
podman run --rm -it --cap-drop ALL --publish 3000:3000 pythonsupport-page:dev
To control things like cache headers, compression, healthcheck endpoint, and basic authentication, see the static-web-server
environment variable reference: https://static-web-server.net/configuration/environment-variables/