<p>从<a href="http://www.sphinx-doc.org/en/2.0/usage/restructuredtext/basics.html#substitutions" rel="nofollow noreferrer">Sphinx documentation</a>:</p>
<blockquote>
<p>reST supports “substitutions” (<a href="http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#substitution-definitions" rel="nofollow noreferrer">ref</a>), which are pieces of text and/or markup referred to in the text by <code>|name|</code>. They are defined like footnotes with explicit markup blocks, like this:</p>
<pre><code>.. |name| replace:: replacement *text*
</code></pre>
<p>or this:</p>
<pre><code>.. |caution| image:: warning.png
:alt: Warning!
</code></pre>
<p>See the <a href="http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#substitution-definitions" rel="nofollow noreferrer">reST reference for substitutions</a> for details.</p>
<p>If you want to use some substitutions for all documents, put them into <a href="http://www.sphinx-doc.org/en/2.0/usage/configuration.html#confval-rst_prolog" rel="nofollow noreferrer"><code>rst_prolog</code></a> or <a href="http://www.sphinx-doc.org/en/2.0/usage/configuration.html#confval-rst_epilog" rel="nofollow noreferrer"><code>rst_epilog</code></a> or put them into a separate file and include it into all documents you want to use them in, using the <code>include</code> directive. (Be sure to give the include file a file name extension differing from that of other source files, to avoid Sphinx finding it as a standalone document.)</p>
</blockquote>
<p>在<code>rst_prolog</code>中添加“项目变量”并使用替换。</p>