Thank you for considering contributing to our documentation! A good documentation is vital for any project and empowers those that use it.
Our documentation is written in MyST (Markedly Structured Text) and built using Sphinx.
Here are some important information about how to contribute to our documentation:
- Build Documentation
- Write Documentation
- Write Environments Documentation
- Write Tutorials
- Sphinx Theme options
- Frontmatter options
- Create Documentation Website
Here are some guidelines to follow when writing documentation:
- Use clear and concise language. Avoid jargon and technical terms when possible.
- Use Google-style Python docstrings.
- Use the reStructuredText markup language inside docstrings.
- Use
autodoc
to automatically generate documentation from your code. - Use the MyST markdown (using the .md file extension) for documentation files inside the
docs/
directory. - Use scripts to generate environments documentation.
- Use
sphinx-gallery
to include tutorials in your documentation.
Environment documentation varies from project to project and sometimes from environment type.
Some environments, for example, Atari, require you to directly edit the Markdown file, however those are rare situations that should be avoided.
For most cases environments should be documented using a docstring inside the entry point class, example. To automatically generate the documentation pages, i.e. .md
files, you should use a python script, for example, docs/scripts/gen_mds.py.
We use Sphinx-Gallery to build the tutorials inside the docs/tutorials directory.
To convert Jupyter Notebooks to Python tutorials you can use this script.
To convert cells outputting static images, like <img src="../_static/img/tutorials/my_image.png" alt="My image description">
, they need to be in single Mardown cell and have an alt
text.
If you want Sphinx-Gallery to execute the tutorial (which adds outputs and plots) then the file name should start with run_. Note that this adds to the build time so make sure the script doesn't take more than a few seconds to execute.
Go to Sphinx-Gallery documentation for more information.
- Create a directory named
docs
in the root directory of the project's repository - Copy the contents inside the start_kit directory (you can use donwload-directory.github.io)
- Paste them inside the new
docs
directory - Replace
<PROJECT>
and<PROJECT_LOW>
with the name of the project, e.g. Gymnasiun would replace<PROJECT>
withGymnasium
and<PROJECT_LOW>
withgymnasium
. You will find these placeholders inside files and in file names without the angle brackets. - Replace the images and svg files inside
_static/img
with the ones corresponding to the project. - Add content to the documentation.
- Add GitHub Actions workflows to build the website. Go here for more information.