Registry / devops / sphinxcontrib-runcmd

sphinxcontrib-runcmd

JSON →
library0.2.0pypypi✓ verified 80d ago

A Sphinx extension that allows running shell commands and including their output in documentation. Version 0.2.0 (latest), stable release. No breaking changes reported.

pip install sphinxcontrib-runcmd
INSTALL
IMPORT
SIG · SPHINXCONTRIB-RUNC
S
sphinxcontrib-runcmd
devopspythonv0.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

runcmd
from sphinxcontrib import runcmd
from sphinxcontrib.runcmd import runcmd

Add the extension to your Sphinx project and use the runcmd directive.

import sphinxcontrib.runcmd # In conf.py: extensions = ['sphinxcontrib.runcmd'] # Then in your .rst files: # .. runcmd:: echo 'Hello World' # :shell: # :workdir: /tmp
Debug
Known issues
gotchaThe runcmd directive does not capture stderr by default; only stdout is included in the output.
fix
Use :stderr: flag to include stderr output.
affects: all
gotchaCommands are executed within the Sphinx build environment; path and environment variables may differ from your shell.
fix
Use absolute paths or set environment via :env: option.
affects: all
Upgrade
Version history
0.2.0latest on PyPI · released Nov 8, 2018
Audit
Dependencies
sphinxrequiredRequired for extension loading
Agent activity
2 hits · last 30 days
node
2
Resources
sphinxcontrib-runcmd — pip install sphinxcontrib-runcmd · libregistry