Skip to main content

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

sphinx_terminal-0.1.0.tar.gz (93.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sphinx_terminal-0.1.0-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

Details for the file sphinx_terminal-0.1.0.tar.gz.

File metadata

  • Download URL: sphinx_terminal-0.1.0.tar.gz
  • Upload date:
  • Size: 93.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sphinx_terminal-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d3ace6734b5b4f9c2fa7c706fd740cd99d02cbc40cc36ccaf37d6b52c6f66ebd
MD5 f9b0acc05389f0c52d62cf190c3538c6
BLAKE2b-256 5bcfb81f7a628e6c0364e883cf85414ca5f722dc449c6aeeaed5fa8a6a22d929

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinx_terminal-0.1.0.tar.gz:

Publisher: release-publish.yaml on canonical/sphinx-terminal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sphinx_terminal-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sphinx_terminal-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f35c9540833a3c5535025b46bf9e5b8ddc4bf5d480ba25487ad59f5fcef13629
MD5 2631639bff006399bba34bc28ff679f5
BLAKE2b-256 72f3ef0eed897fec8478f2b6e2699c7a4c7ffc260cdbe9928481b013525f5a77

See more details on using hashes here.

Provenance

The following attestation bundles were made for sphinx_terminal-0.1.0-py3-none-any.whl:

Publisher: release-publish.yaml on canonical/sphinx-terminal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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