Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > b03d9581c0e1b8ab26065b8978f16161 > files > 68

python3-sphinxcontrib-programoutput-0.14-1.mga7.noarch.rpm


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>sphinxcontrib.programoutput – Insert command output &#8212; sphinxcontrib-programoutput 0.14 documentation</title>
    <link rel="stylesheet" href="_static/classic.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    
    <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <script type="text/javascript" src="_static/language_data.js"></script>
    
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="nav-item nav-item-0"><a href="#">sphinxcontrib-programoutput 0.14 documentation</a> &#187;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="module-sphinxcontrib.programoutput">
<span id="sphinxcontrib-programoutput-insert-command-output"></span><h1><a class="reference internal" href="#module-sphinxcontrib.programoutput" title="sphinxcontrib.programoutput: Include the output of programs into documents"><code class="xref py py-mod docutils literal notranslate"><span class="pre">sphinxcontrib.programoutput</span></code></a> – Insert command output<a class="headerlink" href="#module-sphinxcontrib.programoutput" title="Permalink to this headline">¶</a></h1>
<p><a class="reference external" href="http://www.sphinx-doc.org/en/stable/">Sphinx</a> extension to insert the output of arbitrary commands into documents.</p>
<p>The extension is available under the terms of the <a class="reference internal" href="#license"><span class="std std-ref">BSD license</span></a>.</p>
<div class="section" id="installation">
<h2>Installation<a class="headerlink" href="#installation" title="Permalink to this headline">¶</a></h2>
<p>Use <code class="docutils literal notranslate"><span class="pre">pip</span></code> to install this extension from <a class="reference external" href="https://pypi.python.org/pypi/sphinxcontrib-programoutput">PyPI</a>:</p>
<div class="highlight-rest notranslate"><div class="highlight"><pre><span></span>pip install sphinxcontrib-programoutput
</pre></div>
</div>
<p>The extension requires Sphinx 1.3 and Python 2.7 or Python 3 at least.</p>
<p>You can now add this extension to <code class="docutils literal notranslate"><span class="pre">extensions</span></code>:</p>
<div class="highlight-rest notranslate"><div class="highlight"><pre><span></span>extensions = [&#39;sphinxcontrib.programoutput&#39;]
</pre></div>
</div>
<p>Now you’ve two new directives <code class="docutils literal notranslate"><span class="pre">program-output</span></code> and <code class="docutils literal notranslate"><span class="pre">command-output</span></code> to
insert the output of programs.</p>
</div>
<div class="section" id="usage">
<h2>Usage<a class="headerlink" href="#usage" title="Permalink to this headline">¶</a></h2>
<p>To include the output of a command into your document, use the
<a class="reference internal" href="#directive-program-output" title="program-output directive"><code class="xref rst rst-dir docutils literal notranslate"><span class="pre">program-output</span></code></a> directive provided by this extension:</p>
<div class="highlight-rest notranslate"><div class="highlight"><pre><span></span><span class="p">..</span> <span class="ow">program-output</span><span class="p">::</span> python -V
</pre></div>
</div>
<p>The whole output of <code class="docutils literal notranslate"><span class="pre">python</span> <span class="pre">-V</span></code>, including any messages on standard error, is
inserted into the current document, formatted as literal text without any
syntax highlighting:</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>Python 2.7.16
</pre></div>
</div>
<p>You can omit the content of the standard error stream with the <code class="docutils literal notranslate"><span class="pre">nostderr</span></code>
option.</p>
<p>By default, commands are executed in the top-level source directory.  You can
choose an alternate working directory with the <code class="docutils literal notranslate"><span class="pre">cwd</span></code> option.  The argument of
this option is either a path relative to the current source file, or a absolute
path which means that it is relative to the top level source directory.</p>
<div class="section" id="shortening-the-output">
<h3>Shortening the output<a class="headerlink" href="#shortening-the-output" title="Permalink to this headline">¶</a></h3>
<p>Lengthy output can be shortened with the <code class="docutils literal notranslate"><span class="pre">ellipsis</span></code> option.  Its value
denotes lines to omit when inserting the output of the command.  Instead, a
single ellipsis <code class="docutils literal notranslate"><span class="pre">...</span></code> is inserted.</p>
<p>If used with a single number, all lines after the specified line are omitted:</p>
<div class="highlight-rest notranslate"><div class="highlight"><pre><span></span><span class="p">..</span> <span class="ow">program-output</span><span class="p">::</span> python --help
   <span class="nc">:ellipsis:</span> <span class="nf">2</span>
</pre></div>
</div>
<p>The above omits all lines after the second one:</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>usage: python [option] ... [-c cmd | -m mod | file | -] [arg] ...
Options and arguments (and corresponding environment variables):
...
</pre></div>
</div>
<p>Negative numbers count from the last line backwards, thus replacing <code class="docutils literal notranslate"><span class="pre">2</span></code> with
<code class="docutils literal notranslate"><span class="pre">-2</span></code> in the above example would only omit the last two lines.</p>
<p>If used with two comma-separated line numbers, all lines in between the
specified lines are omitted.  Again, a negative number counts from the last
line backwards:</p>
<div class="highlight-rest notranslate"><div class="highlight"><pre><span></span><span class="p">..</span> <span class="ow">program-output</span><span class="p">::</span> python --help
   <span class="nc">:ellipsis:</span> <span class="nf">2,-2</span>
</pre></div>
</div>
<p>The above omits all lines except the first two and the last two lines:</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>usage: python [option] ... [-c cmd | -m mod | file | -] [arg] ...
Options and arguments (and corresponding environment variables):
...
   str, bytes and datetime objects.  It can also be set to an integer
   in the range [0,4294967295] to get hash values with a predictable seed.
</pre></div>
</div>
</div>
<div class="section" id="mimicing-shell-input">
<h3>Mimicing shell input<a class="headerlink" href="#mimicing-shell-input" title="Permalink to this headline">¶</a></h3>
<p>You can mimic shell input with the <a class="reference internal" href="#directive-command-output" title="command-output directive"><code class="xref rst rst-dir docutils literal notranslate"><span class="pre">command-output</span></code></a> directive <a class="footnote-reference" href="#alias" id="id1">[1]</a>.
This directive inserts the command along with its output into the document:</p>
<div class="highlight-rest notranslate"><div class="highlight"><pre><span></span><span class="p">..</span> <span class="ow">command-output</span><span class="p">::</span> python -V
</pre></div>
</div>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>$ python -V
Python 2.7.16
</pre></div>
</div>
<p>The appearance of this output can be configured with
<a class="reference internal" href="#confval-programoutput_prompt_template"><code class="xref std std-confval docutils literal notranslate"><span class="pre">programoutput_prompt_template</span></code></a>.  When used in conjunction with
<code class="docutils literal notranslate"><span class="pre">ellipsis</span></code>, the command itself and any additional text is <em>never</em> omitted.
<code class="docutils literal notranslate"><span class="pre">ellipsis</span></code> always refers to the <em>immediate output</em> of the command:</p>
<div class="highlight-rest notranslate"><div class="highlight"><pre><span></span><span class="p">..</span> <span class="ow">command-output</span><span class="p">::</span> python --help
   <span class="nc">:ellipsis:</span> <span class="nf">2</span>
</pre></div>
</div>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>$ python --help
usage: python [option] ... [-c cmd | -m mod | file | -] [arg] ...
Options and arguments (and corresponding environment variables):
...
</pre></div>
</div>
</div>
<div class="section" id="command-execution-and-shell-expansion">
<h3>Command execution and shell expansion<a class="headerlink" href="#command-execution-and-shell-expansion" title="Permalink to this headline">¶</a></h3>
<p>Normally the command is splitted according to the POSIX shell syntax (see
<code class="xref py py-mod docutils literal notranslate"><span class="pre">shlex</span></code>), and executed directly.  Thus special shell features like
expansion of environment variables will not work:</p>
<div class="highlight-rest notranslate"><div class="highlight"><pre><span></span><span class="p">..</span> <span class="ow">command-output</span><span class="p">::</span> echo &quot;$USER&quot;
</pre></div>
</div>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>$ echo &quot;$USER&quot;
$USER
</pre></div>
</div>
<p>To enable these features, enable the <code class="docutils literal notranslate"><span class="pre">shell</span></code> option.  With this option, the
command is literally passed to the system shell:</p>
<div class="highlight-rest notranslate"><div class="highlight"><pre><span></span><span class="p">..</span> <span class="ow">command-output</span><span class="p">::</span> echo &quot;$USER&quot;
   <span class="nc">:shell:</span>
</pre></div>
</div>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>$ echo &quot;$USER&quot;
iurt
</pre></div>
</div>
<p>Other shell features like process expansion consequently work, too:</p>
<div class="highlight-rest notranslate"><div class="highlight"><pre><span></span><span class="p">..</span> <span class="ow">command-output</span><span class="p">::</span> ls -l $(which grep)
   <span class="nc">:shell:</span>
</pre></div>
</div>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>$ ls -l $(which grep)
-rwxr-xr-x 1 root root 162152 Dec 22 09:58 /usr/bin/grep
</pre></div>
</div>
<p>Remember to use <code class="docutils literal notranslate"><span class="pre">shell</span></code> carefully to avoid unintented interpretation of shell
syntax and swallowing of fatal errors!</p>
</div>
<div class="section" id="error-handling">
<h3>Error handling<a class="headerlink" href="#error-handling" title="Permalink to this headline">¶</a></h3>
<p>If an unexpected exit code (also known as <em>return code</em>) is returned by a
command, it is considered to have failed.  In this case, a build warning is
emitted to help you to detect misspelled commands or similar errors.  By
default, a command is expected to exit with an exit code of 0, all other codes
indicate an error.  In some cases however, it may be reasonable to demonstrate
failed programs.  To avoid a (superfluous) warning in such a case, you can
specify the expected return code of a command with the <code class="docutils literal notranslate"><span class="pre">returncode</span></code> option:</p>
<div class="highlight-rest notranslate"><div class="highlight"><pre><span></span><span class="p">..</span> <span class="ow">command-output</span><span class="p">::</span> python -c &#39;import sys; sys.exit(1)&#39;
   <span class="nc">:returncode:</span> <span class="nf">1</span>
</pre></div>
</div>
<p>The above command returns the exit code 1 (as given to <code class="xref py py-func docutils literal notranslate"><span class="pre">sys.exit()</span></code>),
but no warning will be emitted.  On the contrary, a warning will be emitted,
should the command return 0!</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p>Upon fatal errors which even prevent the execution of the command neither
return code nor command output are available.  In this case an error message
is inserted into the document instead.</p>
<p class="last">If <code class="docutils literal notranslate"><span class="pre">shell</span></code> is set however, most of these fatal errors are handled by the
system shell and turned into return codes instead.  In this case the error
message will only appear in the output of the shell.  If you’re using
<code class="docutils literal notranslate"><span class="pre">shell</span></code>, double-check the output for errors.  Best avoid <code class="docutils literal notranslate"><span class="pre">shell</span></code>, if
possible.</p>
</div>
</div>
</div>
<div class="section" id="reference">
<h2>Reference<a class="headerlink" href="#reference" title="Permalink to this headline">¶</a></h2>
<dl class="directive">
<dt id="directive-program-output">
<code class="descname">.. program-output::</code><code class="descclassname"> command</code><a class="headerlink" href="#directive-program-output" title="Permalink to this definition">¶</a></dt>
<dd><p>Include the output of <code class="docutils literal notranslate"><span class="pre">command</span></code> in the documentation.</p>
<p>The output is formatted as literal text, without any syntax highlighting.</p>
<p>By default, the command is split according to the POSIX shell syntax (using
<code class="xref py py-func docutils literal notranslate"><span class="pre">shlex.split()</span></code>), and executed directly.  Both standard output and
standard error are captured from the invocation of <code class="docutils literal notranslate"><span class="pre">command</span></code> and included
in the document.  However, if the option <code class="docutils literal notranslate"><span class="pre">shell</span></code> is given, <code class="docutils literal notranslate"><span class="pre">command</span></code> is
literally passed to the system shell.  With the <code class="docutils literal notranslate"><span class="pre">nostderr</span></code> option,
standard error is hidden from the output.</p>
<p>The working directory of the command can be configured with the <code class="docutils literal notranslate"><span class="pre">cwd</span></code>
option.  The argument of this option is a directory path, relative to the
current source file.  Absolute paths are interpreted as relative to the
root of the source directory.  The default working directory is <code class="docutils literal notranslate"><span class="pre">/</span></code>, i.e.
the root of the source directory.</p>
<p>If the <code class="docutils literal notranslate"><span class="pre">prompt</span></code> option is given, the <code class="docutils literal notranslate"><span class="pre">command</span></code> itself is included in the
document, so that the output mimics input in a shell prompt.
<a class="reference internal" href="#confval-programoutput_prompt_template"><code class="xref std std-confval docutils literal notranslate"><span class="pre">programoutput_prompt_template</span></code></a> controls the appearance of this.
The value of the <code class="docutils literal notranslate"><span class="pre">extraargs</span></code> option is appended at the end of <code class="docutils literal notranslate"><span class="pre">command</span></code>
(separated by a whitespace) before executing the command, but not included
in the output of the <code class="docutils literal notranslate"><span class="pre">prompt</span></code> option.  Use this to pass extra arguments
which should not appear in the document.</p>
<p>The output can be shortened with the <code class="docutils literal notranslate"><span class="pre">ellipsis</span></code> option.  The value of this
option is of the form <code class="docutils literal notranslate"><span class="pre">start[,end]</span></code> with <code class="docutils literal notranslate"><span class="pre">start</span></code> and <code class="docutils literal notranslate"><span class="pre">end</span></code> being
integers which refer to lines in the output of <code class="docutils literal notranslate"><span class="pre">command</span></code>.  <code class="docutils literal notranslate"><span class="pre">end</span></code> is
optional and defaults to the last line.  Negative line numbers count
backwards from the last line.  Everything in the interval <code class="docutils literal notranslate"><span class="pre">[start,</span> <span class="pre">end[</span></code>
is replaced with a single ellipsis <code class="docutils literal notranslate"><span class="pre">...</span></code>.  The <code class="docutils literal notranslate"><span class="pre">ellipsis</span></code> option only
affects the immediate output of <code class="docutils literal notranslate"><span class="pre">command</span></code>, but never any additional text
inserted by option <code class="docutils literal notranslate"><span class="pre">prompt</span></code>.</p>
<p>If the command does return an exit code different from the expected one, a
build warning is issued.  The expected return code defaults to 0, and can be
changed with the <code class="docutils literal notranslate"><span class="pre">returncode</span></code> option.</p>
</dd></dl>

<dl class="directive">
<dt id="directive-command-output">
<code class="descname">.. command-output::</code><a class="headerlink" href="#directive-command-output" title="Permalink to this definition">¶</a></dt>
<dd><p>Same as <a class="reference internal" href="#directive-program-output" title="program-output directive"><code class="xref rst rst-dir docutils literal notranslate"><span class="pre">program-output</span></code></a>, but with enabled <code class="docutils literal notranslate"><span class="pre">prompt</span></code> option.</p>
</dd></dl>

<div class="section" id="configuration">
<h3>Configuration<a class="headerlink" href="#configuration" title="Permalink to this headline">¶</a></h3>
<p>This extension understands the following configuration options:</p>
<dl class="confval">
<dt id="confval-programoutput_prompt_template">
<code class="descname">programoutput_prompt_template</code><a class="headerlink" href="#confval-programoutput_prompt_template" title="Permalink to this definition">¶</a></dt>
<dd><p>A <a class="reference external" href="https://docs.python.org/2/library/string.html#formatstrings">format string</a> template for the output of the <code class="docutils literal notranslate"><span class="pre">prompt</span></code> option to
<a class="reference internal" href="#directive-command-output" title="command-output directive"><code class="xref rst rst-dir docutils literal notranslate"><span class="pre">command-output</span></code></a>.  Defaults to <code class="docutils literal notranslate"><span class="pre">$</span> <span class="pre">{command}\n{output}</span></code> which renders
as follows:</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>$ python -V
Python 2.7.16
</pre></div>
</div>
<p>The following keys are provided to the format string:</p>
<ul class="simple">
<li><code class="docutils literal notranslate"><span class="pre">command</span></code> is replaced with the literal command as given to the
directive, <em>without</em> any <code class="docutils literal notranslate"><span class="pre">extraargs</span></code>.</li>
<li><code class="docutils literal notranslate"><span class="pre">output</span></code> is the output of the command, after the <code class="docutils literal notranslate"><span class="pre">ellipsis</span></code> option has
been applied.</li>
<li><code class="docutils literal notranslate"><span class="pre">returncode</span></code> is the return code of the command as integer.</li>
</ul>
</dd></dl>

</div>
</div>
<div class="section" id="support">
<h2>Support<a class="headerlink" href="#support" title="Permalink to this headline">¶</a></h2>
<p>Please report issues to the <a class="reference external" href="https://github.com/NextThought/sphinxcontrib-programoutput/issues">issue tracker</a> if you have trouble or found a bug
in this extension, but respect the following guidelines:</p>
<ul class="simple">
<li>Check that the issue has not already been reported.</li>
<li>Check that the issue is not already fixed in the <code class="docutils literal notranslate"><span class="pre">master</span></code> branch.</li>
<li>Open issues with clear title and a detailed description in grammatically
correct, complete sentences.</li>
</ul>
</div>
<div class="section" id="development">
<h2>Development<a class="headerlink" href="#development" title="Permalink to this headline">¶</a></h2>
<p>The source code is hosted on <a class="reference external" href="https://github.com/NextThought/sphinxcontrib-programoutput">Github</a>:</p>
<div class="highlight-rest notranslate"><div class="highlight"><pre><span></span>git clone https://github.com/NextThought/sphinxcontrib-programoutput
</pre></div>
</div>
<p>Please fork the repository and send pull requests with your fixes or features,
but respect these guidelines:</p>
<ul class="simple">
<li>Read <a class="reference external" href="https://gun.io/blog/how-to-github-fork-branch-and-pull-request/">how to properly contribute to open source projects on GitHub</a>.</li>
<li>Use a topic branch to easily amend a pull request later, if necessary.</li>
<li>Write <a class="reference external" href="http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html">good commit messages</a>.</li>
<li>Squash commits on the topic branch before opening a pull request.</li>
<li>Respect <span class="target" id="index-0"></span><a class="pep reference external" href="https://www.python.org/dev/peps/pep-0008"><strong>PEP 8</strong></a> (use <a class="reference external" href="https://pypi.python.org/pypi/pep8/">pep8</a> to check your coding style compliance)</li>
<li>Add unit tests.</li>
<li>Open a <a class="reference external" href="https://help.github.com/articles/using-pull-requests">new pull request</a>
that relates to but one subject with a clear title and description in
grammatically correct, complete sentences.</li>
</ul>
</div>
<div class="section" id="changelog">
<h2>Changelog<a class="headerlink" href="#changelog" title="Permalink to this headline">¶</a></h2>
</div>
</div>
<div class="section" id="changes">
<h1>Changes<a class="headerlink" href="#changes" title="Permalink to this headline">¶</a></h1>
<div class="section" id="id2">
<h2>0.14 (2019-04-08)<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>Add <code class="docutils literal notranslate"><span class="pre">python_requires</span></code> metadata to better allow tools like <code class="docutils literal notranslate"><span class="pre">pip</span></code>
to install a correct version.</li>
<li>Add support for Sphinx 2.0 on Python 3.</li>
<li>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, <a class="reference external" href="https://github.com/NextThought/sphinxcontrib-programoutput/issues/33">issue 33</a>
by latricewilgus.</li>
</ul>
</div>
<div class="section" id="id3">
<h2>0.13 (2018-12-22)<a class="headerlink" href="#id3" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>Drop support for Sphinx &lt; 1.7.</li>
<li>Fix tests on Sphinx &gt;= 1.8.0.</li>
<li>Restore error message into the document by default from failed
program runs on Sphinx &gt;= 1.8.0b1.</li>
<li>Fix deprecation warnings on Sphinx &gt;= 1.8. Reported in <a class="reference external" href="https://github.com/NextThought/sphinxcontrib-programoutput/issues/29">issue 29</a>
by miili.</li>
</ul>
</div>
<div class="section" id="id4">
<h2>0.11 (2017-05-18)<a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>Explicitly set <code class="docutils literal notranslate"><span class="pre">parallel_read_safe</span></code> to true in the extension
metadata. See <a class="reference external" href="https://github.com/NextThought/sphinxcontrib-programoutput/issues/25">issue 25</a>.
With thanks to Adam J. Stewart and Stephen McDowell.</li>
</ul>
</div>
<div class="section" id="id5">
<h2>0.10 (2017-03-17)<a class="headerlink" href="#id5" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>Decode output from the program tolerantly, using the ‘replace’
handler. Based on a <a class="reference external" href="https://github.com/habnabit/sphinxcontrib-programoutput/commit/592078e0386c2a36d50a6528b6e49d91707138bf">pull request</a>
by Stefan C. Müller.</li>
</ul>
</div>
<div class="section" id="id6">
<h2>0.9 (2017-03-15)<a class="headerlink" href="#id6" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>Forked and revived the project in <a class="reference external" href="https://github.com/NextThought/sphinxcontrib-programoutput">Gitub</a>.</li>
<li>Run the tests on Travis CI. Formatting and style is enforced by pylint.</li>
<li>The oldest supported and tested Sphinx version is now 1.3.5. See
<a class="reference external" href="https://github.com/NextThought/sphinxcontrib-programoutput/issues/17">issue 17</a>.</li>
<li>Remove support for Python 2.6, Python 3.2 and 3.3.</li>
<li>100% test coverage.</li>
<li>Remove support for <code class="docutils literal notranslate"><span class="pre">programoutput_use_ansi</span></code>. The
<code class="docutils literal notranslate"><span class="pre">sphinxcontrib.ansi</span></code> extension is no longer available on PyPI.</li>
</ul>
</div>
<div class="section" id="oct-12-2012">
<h2>0.8 (Oct 12, 2012)<a class="headerlink" href="#oct-12-2012" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>Migrated to GitHub</li>
</ul>
</div>
<div class="section" id="apr-17-2012">
<h2>0.7 (Apr 17, 2012)<a class="headerlink" href="#apr-17-2012" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>Added <code class="docutils literal notranslate"><span class="pre">cwd</span></code> option to <code class="docutils literal notranslate"><span class="pre">..program-output</span></code></li>
<li>Working directory of executed programs defaults to documentation root now</li>
</ul>
</div>
<div class="section" id="jan-07-2012">
<h2>0.6 (Jan 07, 2012)<a class="headerlink" href="#jan-07-2012" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>Python 3 support</li>
<li>Require Sphinx 1.1 now</li>
</ul>
</div>
<div class="section" id="sep-19-2011">
<h2>0.5 (Sep 19, 2011)<a class="headerlink" href="#sep-19-2011" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li><code class="docutils literal notranslate"><span class="pre">programoutput_prompt_template</span></code> is interpreted as format string now!</li>
<li>Require Python 2.6 now</li>
<li>Added <code class="docutils literal notranslate"><span class="pre">returncode</span></code> option to <code class="docutils literal notranslate"><span class="pre">program-output</span></code> (thanks to
Jan-Marek Glogowski)</li>
<li>Support <code class="docutils literal notranslate"><span class="pre">returncode</span></code> formatting key in
<code class="docutils literal notranslate"><span class="pre">programoutput_prompt_template</span></code></li>
<li>Warn on unexpected return codes instead of raising
<code class="docutils literal notranslate"><span class="pre">subprocess.CalledProcessError</span></code></li>
<li>Turn fatal errors during command into document error messages
instead of crashing the build</li>
</ul>
</div>
<div class="section" id="mar-11-2011">
<h2>0.4.1 (Mar 11, 2011)<a class="headerlink" href="#mar-11-2011" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>Some source code cleanups</li>
<li>Fixed installation instructions in documentation</li>
</ul>
</div>
<div class="section" id="may-21-2010">
<h2>0.4 (May 21, 2010)<a class="headerlink" href="#may-21-2010" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>Initial release</li>
</ul>
</div>
<div class="section" id="license">
<span id="id7"></span><h2>License<a class="headerlink" href="#license" title="Permalink to this headline">¶</a></h2>
<div class="highlight-rest notranslate"><div class="highlight"><pre><span></span>Copyright (c) 2010, 2011, 2012 Sebastian Wiesner &lt;lunaryorn@googlemail.com&gt;
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

<span class="m">*</span> Redistributions of source code must retain the above copyright
  notice, this list of conditions and the following disclaimer.

<span class="m">*</span> Redistributions in binary form must reproduce the above copyright
  notice, this list of conditions and the following disclaimer in the
  documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
&quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</pre></div>
</div>
<p class="rubric">Footnotes</p>
<table class="docutils footnote" frame="void" id="alias" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id1">[1]</a></td><td>This directive is just an alias for the <a class="reference internal" href="#directive-program-output" title="program-output directive"><code class="xref rst rst-dir docutils literal notranslate"><span class="pre">program-output</span></code></a>
directive with the <code class="docutils literal notranslate"><span class="pre">prompt</span></code> option set.</td></tr>
</tbody>
</table>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="#">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#"><code class="docutils literal notranslate"><span class="pre">sphinxcontrib.programoutput</span></code> – Insert command output</a><ul>
<li><a class="reference internal" href="#installation">Installation</a></li>
<li><a class="reference internal" href="#usage">Usage</a><ul>
<li><a class="reference internal" href="#shortening-the-output">Shortening the output</a></li>
<li><a class="reference internal" href="#mimicing-shell-input">Mimicing shell input</a></li>
<li><a class="reference internal" href="#command-execution-and-shell-expansion">Command execution and shell expansion</a></li>
<li><a class="reference internal" href="#error-handling">Error handling</a></li>
</ul>
</li>
<li><a class="reference internal" href="#reference">Reference</a><ul>
<li><a class="reference internal" href="#configuration">Configuration</a></li>
</ul>
</li>
<li><a class="reference internal" href="#support">Support</a></li>
<li><a class="reference internal" href="#development">Development</a></li>
<li><a class="reference internal" href="#changelog">Changelog</a></li>
</ul>
</li>
<li><a class="reference internal" href="#changes">Changes</a><ul>
<li><a class="reference internal" href="#id2">0.14 (2019-04-08)</a></li>
<li><a class="reference internal" href="#id3">0.13 (2018-12-22)</a></li>
<li><a class="reference internal" href="#id4">0.11 (2017-05-18)</a></li>
<li><a class="reference internal" href="#id5">0.10 (2017-03-17)</a></li>
<li><a class="reference internal" href="#id6">0.9 (2017-03-15)</a></li>
<li><a class="reference internal" href="#oct-12-2012">0.8 (Oct 12, 2012)</a></li>
<li><a class="reference internal" href="#apr-17-2012">0.7 (Apr 17, 2012)</a></li>
<li><a class="reference internal" href="#jan-07-2012">0.6 (Jan 07, 2012)</a></li>
<li><a class="reference internal" href="#sep-19-2011">0.5 (Sep 19, 2011)</a></li>
<li><a class="reference internal" href="#mar-11-2011">0.4.1 (Mar 11, 2011)</a></li>
<li><a class="reference internal" href="#may-21-2010">0.4 (May 21, 2010)</a></li>
<li><a class="reference internal" href="#license">License</a></li>
</ul>
</li>
</ul>

  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="_sources/index.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="nav-item nav-item-0"><a href="#">sphinxcontrib-programoutput 0.14 documentation</a> &#187;</li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2010, 2011, Sebastian Wiesner.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.8.4.
    </div>
  </body>
</html>