Dynamically generated content for sphinx documentations
Project description
Sphinxrun
SphinxRun registers a new .. run:: directive to execute code dynamically while building a sphinx documentation.
It can be used to generate documentation artifacts such as figures or to insert dynamic content.
Example:
import textwrap
class Wrapper:
"""Wrapper class.
.. run::
from example import Wrapper
d = Wrapper()
with open("docs/source/lorem.txt") as f:
text = f.read()
"""
def wrap70(self, text):
"""Wrap text to 70 columns.
.. run::
output = d.wrap70(text)
sphinxrun.show(output)
"""
return textwrap.fill(text)
renders as:
Note: The environement persists across calls within the scope of a document.
Installation
Install the package:
pip install sphinxrun
# or
uv add --dev sphinxrun
Then add the extension to the sphinx configuration:
extensions = [
...
"sphinxrun"
]
Documentation
The documentation is hosted at: https://sphinxrun.readthedocs.io/en/latest/
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sphinx_run-0.2.2.tar.gz.
File metadata
- Download URL: sphinx_run-0.2.2.tar.gz
- Upload date:
- Size: 94.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc23b2d909197d60c27ee54ee471409425ff57c6b3a5832b9e0663ce72fbc3c1
|
|
| MD5 |
d377e6e62e793b5a6b8ac1c2dec4bae7
|
|
| BLAKE2b-256 |
d90c265cd48c2b7813380d97d1a82236ec0a074f961c1924e7a1992a9630e44d
|
Provenance
The following attestation bundles were made for sphinx_run-0.2.2.tar.gz:
Publisher:
release.yml on nlgranger/sphinxrun
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sphinx_run-0.2.2.tar.gz -
Subject digest:
cc23b2d909197d60c27ee54ee471409425ff57c6b3a5832b9e0663ce72fbc3c1 - Sigstore transparency entry: 774185949
- Sigstore integration time:
-
Permalink:
nlgranger/sphinxrun@3de194cf40ad2f7dd4617b2ba166f4f4835dae4b -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/nlgranger
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3de194cf40ad2f7dd4617b2ba166f4f4835dae4b -
Trigger Event:
push
-
Statement type:
File details
Details for the file sphinx_run-0.2.2-py3-none-any.whl.
File metadata
- Download URL: sphinx_run-0.2.2-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c8cdec1862b0b34320929dc417b78b18ba7722f165ea89e4fa37c0950e097f1
|
|
| MD5 |
39c2b5509dd6a18e5983df48169fb059
|
|
| BLAKE2b-256 |
27c6102ec3342f027dd3b8a639108f3a6414031e00622a43b3744473d5b79d07
|
Provenance
The following attestation bundles were made for sphinx_run-0.2.2-py3-none-any.whl:
Publisher:
release.yml on nlgranger/sphinxrun
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sphinx_run-0.2.2-py3-none-any.whl -
Subject digest:
3c8cdec1862b0b34320929dc417b78b18ba7722f165ea89e4fa37c0950e097f1 - Sigstore transparency entry: 774185950
- Sigstore integration time:
-
Permalink:
nlgranger/sphinxrun@3de194cf40ad2f7dd4617b2ba166f4f4835dae4b -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/nlgranger
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3de194cf40ad2f7dd4617b2ba166f4f4835dae4b -
Trigger Event:
push
-
Statement type: