从sphinx autodoc发出reStructuredText吗? [英] Emit reStructuredText from sphinx autodoc?
问题描述
CPython的文档不使用autodoc,而是使用手写散文。
CPython doesn't use autodoc for its documentation - we use hand-written prose.
对于PEP 3144(ipaddress模块),我想使用sphinx-apidoc生成初始参考文档。这意味着我要运行两遍操作:
For PEP 3144 (the ipaddress module), I'd like to use sphinx-apidoc to generate the initial reference documentation. That means I want to run a two-pass operation:
-
使用sphinx-apidoc为该模块发出Sphinx项目取决于autodoc
Use sphinx-apidoc to emit a Sphinx project for the module that depends on autodoc
运行一个狮身人面像生成器,该创建新的reStructuredText源文件,所有autodoc指令都替换为内联reStructuredText内容和产生相同输出的标记
Run a sphinx builder that creates new reStructuredText source files, with all the autodoc directives replaced by inline reStructuredText content and markup that produces the same output
第一步很简单,但是我不知道第二步该怎么做,甚至都没有想到沿着这些思路搜索任何现有项目的好方法。
The first step is straightforward, but I have no idea how to do the second step and can't even think of good ways to search for any existing projects along these lines.
推荐答案
我遇到了同样的问题,有一次我生成了文档我们使用了非常难看的解决方案来修补Sphinx,请参见使Sphinx生成RST类文档来自pydoc 。
I had same problem and for one time generating of docs I've used quite ugly solution to patch Sphinx, see Make Sphinx generate RST class documentation from pydoc.
这篇关于从sphinx autodoc发出reStructuredText吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!