A hack to run custom steps when building documentation on Read the Docs.
Project description
readthedocs-custom-steps
A hack to run custom steps when building documentation on Read the Docs.
Important: This module should not be installed outside of a Read the Docs build environment. It will rename your Python executable and install a substitute. It does not currently provide an automated way to revert this change.
How to use this?
Rtd-cs overrides your python
installation with a Bash script that dispatches the
execution of custom steps upon invokation of python -m mkdocs
or python -m sphinx
.
The commands to run are defined in a file called .readthedocs-custom-steps.yml
.
Example:
# .readthedocs-custom-steps.yml
steps:
- bash .scripts/generate-changelog.sh >docs/changelog.md
- python -m "$@"
Here, $@
contains the arguments after python -m
in the Read the Docs build step, for example:
mkdocs build --clean --site-dir _site/html --config-file mkdocs.yml
sphinx -T -b html -d _build/doctrees -D language=en . _build/html
An infinite recursion of this script invoking itself in the example above is prevented automatically
with the RTD_CUSTOM_ENTRY
environment variable.
Copyright © 2021 Niklas Rosenstein
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for readthedocs-custom-steps-0.4.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca340f7393b898106777fbda745cee8e1423fac5f841a52fa1f1ddfb70db891d |
|
MD5 | 26d400fe0462ae5ab549e9b67828419f |
|
BLAKE2b-256 | d1c306efeccd40d9d47b732490d9ef8f692c8dff95b4b640d4b0e8d575c0ed41 |