Execute code blocks in Sphinx and display the output
Project description
sphinx-exec-code
A Sphinx extension to run python code in the documentation
About
Sphinx-exec-code allows execution of any python code during the documentation build. It's also possible to display the output of the code execution.
With this extension it's easy to ensure that the provided code samples are always working. Additionally, it's possible to show the output of the documented code.
Each code snippet runs in a fresh interpreter so changes to not leak between executions.
Documentation
The full documentation can be found at here
Quick Example
.. exec-code::
print('This code will be executed')
generates
print('This code will be executed')
This code will be executed
Changelog
0.5 (10.03.2022)
- Marked as safe for parallel reading
0.4 (09.03.2022)
- Added option to run code from example files
0.3 (24.09.2021)
- Added some more documentation and fixed some false path warnings
0.2 (21.09.2021)
- Initial Release
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
sphinx-exec-code-0.5.tar.gz
(11.3 kB
view hashes)
Built Distribution
Close
Hashes for sphinx_exec_code-0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4290a96a1c67f240f73f00bbf284e1e21fe2c3ba3059b1f4e745cebcfa21dca5 |
|
MD5 | 053721957ca09b9011a9058dcedf9dd7 |
|
BLAKE2b-256 | 30a66883c6e64652124fbfd4f9241d97bb53752296dd14a53ef1742a5c016166 |