Installation and Quick Example
Install the package from PyPI:
pip install erbsland-sphinx-ansi
Enable the extension in your conf.py:
extensions = [
# ...
"erbsland.sphinx.ansi",
]
Use the erbsland-ansi directive in your reStructuredText source:
.. erbsland-ansi::
:escape-char: #
#[32m[sphinx-autobuild] #[36mStarting initial build#[0m
#[32m[sphinx-autobuild] #[34m> python -m sphinx build doc _build#[0m
The :escape-char: option is optional. If you omit it, the directive expects real ANSI escape sequences in the content.