擅长:python、mysql、java
<p>在Bonlenfum的解决方案之后,下面是一个(甚至更)简洁的示例,它在模块索引和doc字符串中打印模块指令:</p>
<pre><code>"""
.. module:: CONF
:synopsis: written in module index..................................newlines are
automatically handled (still, mind the spacing)
:platform: Windows
.. moduleauthor:: Mr Anderson <mr@matrix.com>
:synopsis: this is written in the docstrings..........................newlines are handled
automatically handled (mind spacing) or I can force newlines with \n
a newline character.
"""
</code></pre>
<p>我添加了“…”来增加空格,这样就可以让sphinx自动地在新行上继续。模块作者只显示在doc字符串(而不是索引)中。在</p>
<p>这与sphinx1.2和<a href="https://docs.readthedocs.org/en/latest/theme.html" rel="nofollow">read the docs</a>主题配合得很好</p>