Skip to main content

sphinx-autorun is an extension for Sphinx that can execute the code from a runblock directive and attach the output of the execution to the document.

For example:

.. runblock:: pycon

    >>> for i in range(5):
    ...    print i

Produces:

>>> for i in range(5):
...    print i
1
2
3
4
5

Another example:

.. runblock:: console

    $ date

Produces:

$ date
Thu  4 Mar 2010 22:56:49 EST

Currently autorun supports pycon and console languages. It’s also possible to configure autorun (from conf.py) to run other languages.

Installation

Installing via pip (recommended):

$ pip install sphinx-autorun

Install from source:

$ git clone https://github.com/WhyNotHugo/sphinx-autorun/
$ pip install .

To enable autorun add ‘sphinx_autorun’ to the extension list in conf.py:

extensions.append('sphinx_autorun')

The documentation is in the doc/ folder.

About this fork

sphinx-contrib/autorun was abandoned and broken for several months. Since it did not even work, this fork was created as a continuation of it with mostly critical fixes.

Metadata

Release files for sphinx-autorun 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sphinx-autorun 2.0.0
File Size Uploaded
sphinx_autorun-2.0.0.tar.gz 12.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sphinx-autorun 2.0.0
File Interpreter ABI Platform
sphinx_autorun-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.3 kB

Release files / sphinx_autorun-2.0.0.tar.gz

Download URL sphinx_autorun-2.0.0.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
250682bf16eef2bfad0cc9d9e142b464b9441433e8e4faebb9de8f952ebba791
BLAKE2b-256 checksum
How to use checksums
00ca0a4c9362ee0102431665066a858ad647b0c14b93eaa5c2ddb21fc8f0d246
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.8

Release files / sphinx_autorun-2.0.0-py3-none-any.whl

Download URL sphinx_autorun-2.0.0-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6789433e7ce03fbdc60e071c05d0a4d5a5448e755ba8876fdedf4a7e8363f70e
BLAKE2b-256 checksum
How to use checksums
aa2edf00ca6ef5bd9140d551e6ca17bd3b46950cefcaf38534fa3fe688ce5039
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.8

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page