A Sphinx extension for rendering terminal input and output.
Project description
sphinx-terminal
sphinx-terminal allows you to display terminal input and output in your Sphinx documentation.
Basic usage
To display terminal input and output in your rST document, use the terminal directive,
providing input and output as follows:
.. terminal::
:input: echo 'hello'
hello
:input: echo 'goodbye'
goodbye
The prompt defaults to user@host:~$. To customize this, use the :user:, :host:,
and :dir: options.
.. terminal::
:user: author
:host: canonical
:dir: ~/path
:input: echo 'hello'
hello
To enable a copy button for users, include the :copy: flag as a directive option.
.. terminal::
:copy:
:input: echo 'hello'
hello
Similarly, to make the output scrollable, include the :scroll: flag as a directive option.
.. terminal::
:scroll:
:input: echo 'hello'
hello
Project setup
sphinx-terminal is published on PyPI and can be installed with:
pip install sphinx-terminal
After adding sphinx-terminal to your Python project, update your Sphinx's conf.py file to include sphinx-terminal as one of its extensions:
extensions = [
"sphinx_terminal"
]
Community and support
You can report any issues or bugs on the project's GitHub repository.
If you're interested in contributing, start with the contribution guide.
sphinx-terminal is covered by the Ubuntu Code of Conduct.
License and copyright
sphinx-terminal is released under the GPL-3.0 license.
© 2025 Canonical Ltd.
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
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_terminal-0.1.1.tar.gz.
File metadata
- Download URL: sphinx_terminal-0.1.1.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 |
25f1bf84f73908cc73274c363077b54742abb87bae0633acbe267636f9d9944d
|
|
| MD5 |
ae1709ed75a536fdc9e646d50f8bc5e2
|
|
| BLAKE2b-256 |
d2143dedb40eabe81082ac4ae940530b8d05bbd191adde18bbe494d23e856461
|
Provenance
The following attestation bundles were made for sphinx_terminal-0.1.1.tar.gz:
Publisher:
release-publish.yaml on canonical/sphinx-terminal
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sphinx_terminal-0.1.1.tar.gz -
Subject digest:
25f1bf84f73908cc73274c363077b54742abb87bae0633acbe267636f9d9944d - Sigstore transparency entry: 606644436
- Sigstore integration time:
-
Permalink:
canonical/sphinx-terminal@a7caeaa653694b1bb7089f055250cba4774fe8b8 -
Branch / Tag:
refs/tags/0.1.1 - Owner: https://github.com/canonical
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
self-hosted -
Publication workflow:
release-publish.yaml@a7caeaa653694b1bb7089f055250cba4774fe8b8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file sphinx_terminal-0.1.1-py3-none-any.whl.
File metadata
- Download URL: sphinx_terminal-0.1.1-py3-none-any.whl
- Upload date:
- Size: 19.5 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 |
6cfd0d7bdc8cedae6a5b8cd65c984a2ab5f6b0c80f3268714948e11701a6fd17
|
|
| MD5 |
bcf8b64daa91e4ca0d98d111a33e180b
|
|
| BLAKE2b-256 |
b7aa19739053afdfbf335c4f5277623dda1adf5122a0f47c83033c032fcf1bb4
|
Provenance
The following attestation bundles were made for sphinx_terminal-0.1.1-py3-none-any.whl:
Publisher:
release-publish.yaml on canonical/sphinx-terminal
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sphinx_terminal-0.1.1-py3-none-any.whl -
Subject digest:
6cfd0d7bdc8cedae6a5b8cd65c984a2ab5f6b0c80f3268714948e11701a6fd17 - Sigstore transparency entry: 606644458
- Sigstore integration time:
-
Permalink:
canonical/sphinx-terminal@a7caeaa653694b1bb7089f055250cba4774fe8b8 -
Branch / Tag:
refs/tags/0.1.1 - Owner: https://github.com/canonical
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
self-hosted -
Publication workflow:
release-publish.yaml@a7caeaa653694b1bb7089f055250cba4774fe8b8 -
Trigger Event:
push
-
Statement type: