2020-04-24 17:23:41 +03:00
How To - Project Documentation
======================================================================
Get Started
----------------------------------------------------------------------
2021-06-20 19:47:07 +03:00
Documentation can be written as rst files in `{{cookiecutter.project_slug}}/docs` .
2020-04-24 17:23:41 +03:00
{% if cookiecutter.use_docker == 'n' %}
2021-06-20 19:47:07 +03:00
To build and serve docs, use the command::
2023-07-24 12:42:51 +03:00
make livehtml
from inside the `{{cookiecutter.project_slug}}/docs` directory.
2020-04-24 17:23:41 +03:00
{% else %}
2021-06-20 19:47:07 +03:00
To build and serve docs, use the commands::
2023-07-24 12:42:51 +03:00
2024-05-13 20:18:56 +03:00
docker compose -f docker-compose.local.yml up docs
2021-06-20 19:47:07 +03:00
2020-04-24 17:23:41 +03:00
{% endif %}
Changes to files in `docs/_source` will be picked up and reloaded automatically.
`Sphinx <https://www.sphinx-doc.org/> `_ is the tool used to build documentation.
Docstrings to Documentation
----------------------------------------------------------------------
2024-04-22 12:10:25 +03:00
The sphinx extension `apidoc <https://www.sphinx-doc.org/en/master/man/sphinx-apidoc.html> `_ is used to automatically document code using signatures and docstrings.
2020-04-24 17:23:41 +03:00
2022-03-09 19:25:00 +03:00
Numpy or Google style docstrings will be picked up from project files and available for documentation. See the `Napoleon <https://sphinxcontrib-napoleon.readthedocs.io/en/latest/> `_ extension for details.
2020-04-24 17:23:41 +03:00
For an in-use example, see the `page source <_sources/users.rst.txt> `_ for :ref: `users` .
To compile all docstrings automatically into documentation source files, use the command:
::
2023-07-24 12:42:51 +03:00
2020-04-24 17:23:41 +03:00
make apidocs
{% if cookiecutter.use_docker == 'y' %}
This can be done in the docker container:
2023-07-24 12:42:51 +03:00
::
2020-04-24 17:23:41 +03:00
docker run --rm docs make apidocs
{% endif -%}