Visit https://os4d.opendataservices.coop to read the handbook.
This section describes how to:
- Use dev containers or GitHub Codespaces for development
- Set up a local development environment
- Build the documentation on your local machine.
- Deploy changes
- Update requirements
If your editor supports dev containers, you can open the project in a dev container. For example, if you're using VS Code, follow the installation instructions and the quick start guide to open a folder in a container.
You can also open the project in GitHub Codespaces.
Once connected to the container, open a new terminal and run the commands in Build the documentation.
When you have finished, make sure to delete your codespace on https://github.com/codespaces.
git clone git@github.com:OpenDataServices/os4d.git
cd os4d
Subsequent instructions assume that your current working directory is os4d
, unless otherwise stated.
The build requires Python 3.13. We recommend using pyenv to install and switch between multiple versions of Python.
-
Install Python 3.13:
pyenv install 3.13
-
Switch to Python 3.13:
pyenv shell 3.13
-
Create a virtual environment using
python3-venv
:a. Linux/MacOS:
python3 -m venv .ve
a. Windows:
py -m venv .ve
-
Activate the virtual environment. You must run this command for each new terminal session:
a. Linux/MacOS:
source .ve/bin/activate
b. Windows:
.\.ve\Scripts\activate
pip install -r requirements_dev.txt
Sphinx, which builds the documentation, doesn’t watch directories for changes. To regenerate the documentation, start an HTML server, and refresh the browser whenever changes are made, run:
sphinx-autobuild docs docs/_build/dirhtml
Alternatively, build the documentation and view it using a local web server:
sphinx-build docs docs/_build/dirhtml
python -m http.server --directory docs/_build/dirhtml
To deploy a development branch to the live documentation site, create a pull request to merge the development branch into the live
branch. Once the pull request is merged, the changes are automatically deployed to the live site at https://os4d.opendataservices.coop/.
- Edit
requirements.in
. - Update
requirements.txt
:pip-compile
- Update
requirements_dev.txt
:pip-compile requirements_dev.in
- Install requirements:
pip-sync requirements_dev.txt
- Commit your changes.
- Edit
requirements_dev.in
. - Update
requirements_dev.txt
:pip-compile requirements_dev.in
- Install requirements:
pip-sync requirements_dev.txt
- Commit your changes.
This section contains reference documentation that describes the project's configuration.
The project repository is hosted on GitHub.
The live
branch is used to build the live version of the standard documentation, deployed at https://os4d.opendataservices.coop/.
Feature branches branch off the live
branch, with work merged into the live
for deployment.
Branch protection rules are configured for the live
branch. The rules prevent commits being made directly by requiring pull requests before commits can be merged. They also require approvals and status checks to pass before merging.
.github/
: GitHub Actions workflowsdocs/
:*.md
,*/*.md
: English documentation textconf.py
: Sphinx configuration_static/
: CSS and JavaScript for the documentation_templates/
: Jinja templates for the documentation.tx/
: Transifex configuration (not yet implemented)locale/
: Translations of the English documentation (not yet implemented)
The following files are created by running a build and are not version controlled:
.ve/
: Python virtual environment (if using python3-venv)docs/_build
: Built HTML documentation
Sphinx is the documentation generator used to build the HTML documentation from Markdown source files. It uses the MyST - Markedly Structured Text - Parser to parse the Markdown source files.
The Sphinx configuration for this project is based on the Open Data Services Sphinx Base and is defined in docs/conf.py
.
Read the Docs builds and hosts the standard documentation site.
Read the Docs automatically creates and builds pull request previews so that pull request reviewers can preview changes to catch formatting and display issues.
You can find credentials for Read the Docs in the Open Data Services password database.