API Reference

Invoke each shell directive once to retrieve and store its data. Each command is run in its own shell from the project’s base directory. Use the appropriate (replacement) tag to display the stored data.

For example, this markup:

.. shell:: hg parent --template {rev}
           REVISION

.. shell:: date "+built on %a %d %b %Y at %X %Z"
           TIMESTAMP

Revision |REVISION|, |TIMESTAMP|

Will appear something like this:

Revision 5, built on Sun 14 Jun 2015 at 13:02:21 CDT
class docutils_shell.docutils_shell.ShellDirective(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine)

ShellDirective:

.. shell:: cmd
           tag

Runs cmd in its own shell from the base of the project (SETTINGS[‘project_base’]), and places the standard output into tag. Use |tag| to retrieve the output.