This Sphinx extension provides an interface to examples with executable code and visuals.
This extension includes code adapted from sphinx-exercise.
To install the Sphinx-Code-Examples extension, follow these steps:
Step 1: Install the Package
Install the Sphinx-Code-Examples
package using pip
:
pip install sphinx-code-examples
Step 2: Add to requirements.txt
Make sure that the package is included in your project's requirements.txt
to track the dependency:
sphinx-code-examples
Step 3: Enable in _config.yml
In your _config.yml
file, add the extension to the list of Sphinx extra extensions:
sphinx:
extra_extensions:
- sphinx_code_examples
Further documentation for this extension is available in the TeachBooks manual.