Skip to main content

Execute code blocks in Sphinx and display the output

Project description

sphinx-exec-code

Tests Status Documentation Status PyPI - Python Version PyPI Downloads

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 inspect and print output of the documented code.

Documentation

The full documentation can be found at here

Quick Example

.. exec-code::
   :hide_output:

   print('This code will be executed')

Changelog

0.2 (21.09.2021)

  • Initial Release

Project details


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.2.tar.gz (10.6 kB view hashes)

Uploaded Source

Built Distribution

sphinx_exec_code-0.2-py3-none-any.whl (11.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page