Meta information about this project's documentation.
Table of contents:
To build the docs, you can use the following task:
uv run task docsThe output will be in the /docs/build directory.
The docs folder has a few moving components, here's a brief description of each:
_static: This folder includes extra resources that are copied blindly by sphinx into the result making it perfect for resources such as custom CSS or JS._templates&pages: Both are considered HTML templates, and passed to Sphinx astemplates_path. The difference between them is that_templatesis only used to provide templates and overrides that are used by other pages, whilepagesare full-blown independent pages that will be included in the result. Files inpagesare passed to Sphinx ashtml_additional_pages, and will maintain the same structure as the folder. That is to say, a file such aspages/a/b.htmlwill createhttps://bot-core/a/b.html.changelog.rst: This contains a list of all the project's changes. Please refer to Changelog below for more info.index.rst: The main content for the project's homepage.conf.py: Configuration for Sphinx. This includes things such as the project name, version, plugins and their configuration.utils.py: Helpful function used byconf.pyto properly create the docs.netlify_build.py: Script which downloads the build output in netlify. Refer to Static Netlify Build
The project supports building all different versions at once using sphinx-multiversion
after version v7.1.0. You can run the following command to achieve that:
uv run sphinx_multiversion -v docs docs/build -n -j auto -nThis will build all tags, as well as the main branch. To build branches besides the main one
(such as the one you are currently working on), set the BUILD_DOCS_FOR_HEAD environment variable
to True.
When using multi-version, keep the following in mind:
- This command will not fail on warnings, unlike the docs task. Make sure that passes first before using this one.
- Make sure to clear the build directory before running this script to avoid conflicts.
To have your code properly added to the generated docs, you need to do a couple of things:
- Write your code with annotations.
- Write your docstring, using the Google docstring format
Refer to the sphinx documentation for more information.
Each change requires an entry in the Changelog.
Refer to the Releases documentation for more information on the exact format and content of entries You can use this site to get the PR number that'll be assigned for your entry.
We deploy our docs to netlify to power static previews on PRs. Check out python-discord/site for more info on the system.