To get started with contributing to this project, you'll need to set up your development environment.
poetry is used for dependency management. Install it with pip install poetry and then run poetry install to install all dependencies.
We use Sphinx for documentation. You can set it up and build the docs as follows:
- Install Sphinx:
pip install sphinx
- Run the quickstart:
sphinx-quickstart
Follow the prompts to set up your docs.
We use autodoc for automatically generating documentation from the Python source code. Here's how to use it:
- Install the Sphinx autodoc extension:
pip install sphinx.ext.autodoc
- In your conf.py file (created by sphinx-quickstart), add 'sphinx.ext.autodoc' to the extensions list.
- Use the .. automodule:: directive in your .rst files to document Python modules. For example:
.. automodule:: mymodule
:members:
This will automatically document the mymodule module.
Please ensure that your Python code is well-documented with docstrings, as autodoc uses these to generate the documentation.
If you have a large project with many modules, you can use the sphinx-apidoc command to automatically generate .rst files for each module. This will save you from having to manually create a .rst file for each module.
- Install the Sphinx apidoc extension:
pip install sphinx-apidoc
- Run the sphinx-apidoc command:
sphinx-apidoc -o docs/ mymodule
This will generate .rst files for each module in the mymodule package, and place them in the docs/ directory. You can then edit these files to add more documentation.