[英]How to print a reStructuredText node tree?
Section Parsing the Document of The Docutils Hacker's Guide mentions the quicktest.py
utility that can be used to print a node tree representation of a parsed reStructuredText document. 《 Docutils Hacker's Guide》 的文档分析部分提到了quicktest.py
实用程序,该实用程序可用于打印已解析的reStructuredText文档的节点树表示形式。 However I can't find quicktest.py
anywhere in my docutils distribution installed in /usr/lib/python2.7/dist-packages/docutils
. 但是我在/usr/lib/python2.7/dist-packages/docutils
安装的docutils发行quicktest.py
任何地方都找不到quicktest.py
。 Is there other way to print the document tree? 还有其他打印文档树的方法吗?
As pointed out by @mzjn the quicktest.py
script is available at https://sourceforge.net/p/docutils/code/HEAD/tree/trunk/docutils/tools/quicktest.py 正如@mzjn所指出的,可以在https://sourceforge.net/p/docutils/code/HEAD/tree/trunk/docutils/tools/quicktest.py上找到quicktest.py
脚本。
A document tree can also be printed as follows: 也可以按以下方式打印文档树:
from docutils.core import publish_string
print publish_string(rst)
where rst
is a string containing reStructuredText to be processed. 其中rst
是包含要处理的reStructuredText的字符串。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.