sphinx-runpython

Run python code in sphinx


Keywords
sphinx, sphinx-extension
License
MIT
Install
pip install sphinx-runpython==0.2.0

Documentation

https://github.com/sdpython/sphinx-runpython/raw/main/_doc/_static/logo.png

sphinx-runpython: run python code in sphinx

https://dev.azure.com/xavierdupre3/sphinx-runpython/_apis/build/status/sdpython.sphinx-runpython GitHub Issues MIT License size https://codecov.io/github/sdpython/sphinx-runpython/branch/main/graph/badge.svg?token=CTUV6EDBB6

sphinx-runpython implements sphinx extensions including one to execute code and add the output to the documentation. The library is released on pypi/sphinx-runpython and its documentation is published at sphinx-runpython.

epkg

It implements a list of recurring urls in documentation.

conf.py

epkg_dictionary = {'title': 'url' }

rst

:epkg:`title`  -> `title <url>`_

runpython

Executes code in the documentation and adds it to documentation.

.. runpython::
    :showcode:

    print("python code")
<<<

print("python code")

>>>

python code

List of directives