Documentation development
This page explains how to build, preview, and extend the JANUS documentation locally.
Overview
The JANUS documentation is written in Markdown and generated using Zensical.
Zensical is fully compatible with the project's mkdocs.yml configuration, which is used for the documentation build process and site structure.
The documentation source files live in the docs/ directory of the repository.
Local development
To build and preview the documentation locally, install the documentation dependencies and start the development server:
pip install zensical markdown-include pymdown-extensions mkdocstrings mkdocstrings-python
zensical serve
This command will generate the documentation and start a local server for previewing changes as you edit.
Once the server is running, open the URL shown in your terminal in a browser. In most cases, it will look similar to:
http://127.0.0.1:8000
Using a different port
If port 8000 is already busy, you can build the documentation on a different port:
zensical serve -a localhost:8001
SSH connection
If you are connected to a remote server via SSH, for example on the Habrok, Snellius, or Kapteyn cluster, you may need to create an additional SSH tunnel. On your local machine, run:
ssh -L 4000:localhost:8000 account@server
Then open http://localhost:4000 in your browser.
Documentation structure
Documentation source files are located in the docs directory, and mostly follow the DiΓ‘taxis approach of documentation. This means they are categorised into:
- Tutorials: learning-oriented guides for new users, such as a first workflow tutorial.
- How-to guides: task-oriented instructions, such as installation, configuration, or test development.
- Explanations: conceptual material, such as model overviews or code architecture.
- Reference: lookup material, such as reference data, API-like documentation, or bibliographies.
Using this structure helps keep pages focused on a single purpose. When adding a new page, try to decide first which of these four categories it belongs to.
Adding a new page
When adding a new documentation page:
- Create the Markdown file in the appropriate location under
docs/. - Add the page to the navigation in
mkdocs.ymlunder thenavsection. - Start the local preview with
zensical serve. If the preview is already open, savingmkdocs.ymlshould refresh the page (check this in the terminal). - Check that the page renders correctly and appears in the expected place in the navigation.
- Verify that internal links, images, and code blocks display correctly.
For example, a page stored at docs/Tutorials/model_mars.md might be added to mkdocs.yml like this:
nav:
- Tutorials:
- Simulate Mars: Tutorials/model_mars.md
Documentation files are relative to docs/ directory
Zensical looks for documentation files relative to the docs/ directory. In mkdocs.yml, add files like this: Tutorials/model_mars.md and not like this: docs/Tutorials/model_mars.md.
Before opening a pull request
Before submitting documentation changes, it is a good idea to check that:
- the site builds locally without errors,
- the page appears in the correct navigation section,
- internal links resolve correctly,
- headings are ordered sensibly,
- code examples are formatted correctly,
- equations are displayed correctly,
- and any new assets are included and displayed properly.
If the change accompanies a code update, make sure the documentation reflects the current behaviour of the code.