Skip to main content

sphinxcontrib-programoutput

https://secure.travis-ci.org/NextThought/sphinxcontrib-programoutput.png https://coveralls.io/repos/github/NextThought/sphinxcontrib-programoutput/badge.svg

https://sphinxcontrib-programoutput.readthedocs.org

A Sphinx extension to literally insert the output of arbitrary commands into documents, helping you to keep your command examples up to date.

Installation

Install this extension from PyPI:

pip install sphinxcontrib-programoutput

The extension requires Sphinx 1.7.0 and Python 2.7 or Python 3 (Python 3.5+ is tested) at least.

Usage

Just add this extension to extensions:

extensions = ['sphinxcontrib.programoutput']

Now you’ve two new directives program-output and command-output to insert the output of programs. The former just inserts the output:

.. program-output:: python -V

Output:

Python 2.7.1

The latter directive mimics a shell session, and is intended to show examples:

.. command-output:: python -V

Output:

$ python -V
Python 2.7.1

Please refer to the documentation for comprehensive information about usage and configuration of this extension.

Development and Support

Please refer to the documentation for information on support and the development process.

Changes

0.14 (2019-04-08)

  • Add python_requires metadata to better allow tools like pip to install a correct version.

  • Add support for Sphinx 2.0 on Python 3.

  • Avoid unicode errors when the program command or output produced non-ASCII output and the configured prompt was a byte string. This was most likely under Python 2, where the default configured prompt is a byte string. Reported by, and patch inspired by, issue 33 by latricewilgus.

0.13 (2018-12-22)

  • Drop support for Sphinx < 1.7.

  • Fix tests on Sphinx >= 1.8.0.

  • Restore error message into the document by default from failed program runs on Sphinx >= 1.8.0b1.

  • Fix deprecation warnings on Sphinx >= 1.8. Reported in issue 29 by miili.

0.11 (2017-05-18)

  • Explicitly set parallel_read_safe to true in the extension metadata. See issue 25. With thanks to Adam J. Stewart and Stephen McDowell.

0.10 (2017-03-17)

  • Decode output from the program tolerantly, using the ‘replace’ handler. Based on a pull request by Stefan C. Müller.

0.9 (2017-03-15)

  • Forked and revived the project in Gitub.

  • Run the tests on Travis CI. Formatting and style is enforced by pylint.

  • The oldest supported and tested Sphinx version is now 1.3.5. See issue 17.

  • Remove support for Python 2.6, Python 3.2 and 3.3.

  • 100% test coverage.

  • Remove support for programoutput_use_ansi. The sphinxcontrib.ansi extension is no longer available on PyPI.

0.8 (Oct 12, 2012)

  • Migrated to GitHub

0.7 (Apr 17, 2012)

  • Added cwd option to ..program-output

  • Working directory of executed programs defaults to documentation root now

0.6 (Jan 07, 2012)

  • Python 3 support

  • Require Sphinx 1.1 now

0.5 (Sep 19, 2011)

  • programoutput_prompt_template is interpreted as format string now!

  • Require Python 2.6 now

  • Added returncode option to program-output (thanks to Jan-Marek Glogowski)

  • Support returncode formatting key in programoutput_prompt_template

  • Warn on unexpected return codes instead of raising subprocess.CalledProcessError

  • Turn fatal errors during command into document error messages instead of crashing the build

0.4.1 (Mar 11, 2011)

  • Some source code cleanups

  • Fixed installation instructions in documentation

0.4 (May 21, 2010)

  • Initial release

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sphinxcontrib-programoutput-0.14.tar.gz (21.4 kB view details)

Uploaded Source

Built Distribution

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

sphinxcontrib_programoutput-0.14-py2.py3-none-any.whl (20.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file sphinxcontrib-programoutput-0.14.tar.gz.

File metadata

  • Download URL: sphinxcontrib-programoutput-0.14.tar.gz
  • Upload date:
  • Size: 21.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.16

File hashes

Hashes for sphinxcontrib-programoutput-0.14.tar.gz
Algorithm Hash digest
SHA256 75b182e9e8cf7efe828cac2c351bb737b00a76bc3aa60fd1a9b2b7096e99c383
MD5 9eeb8b4927b12b81a8a30f80950c67f3
BLAKE2b-256 8b853dc8530f0e95a2961935cccd957da25c572894ecd746f30006d6bc6b1e9d

See more details on using hashes here.

File details

Details for the file sphinxcontrib_programoutput-0.14-py2.py3-none-any.whl.

File metadata

  • Download URL: sphinxcontrib_programoutput-0.14-py2.py3-none-any.whl
  • Upload date:
  • Size: 20.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.16

File hashes

Hashes for sphinxcontrib_programoutput-0.14-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 55678c7f81e96df48e9f0d97a48ebf84ad9f659bc86ed27e7b0d656c050569b7
MD5 a0cc884cb41602b634c5146f6329cf1e
BLAKE2b-256 36493d786e7cd0dc1994e25e3fab415be3984a6b07c883db5a91913005f38751

See more details on using hashes here.

Supported by

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