sphinx-inlinecode
is a Sphinx extension that embeds source code blocks directly into your documentation as a dropdown.
Example
Unlike sphinx.ext.viewcode
_, source code blocks will also be added for property
_ and cached_property
_ entries
To install sphinx-inlinecode
via pip:
pip install sphinx-inlinecode
Add the extension to your conf.py
extensions = [
"sphinx_inlinecode",
]
Full documentation can be found on ReadTheDocs_