我希望能够在Python中解析基于sphinx的rst进行进一步处理和检查.就像是:
import sphinx
p = sphinx.parse("/path/to/file.rst")
do_something_with(p)
Run Code Online (Sandbox Code Playgroud)
似乎在使用docutils.core.publish_file的docutils中可以实现某些功能:
publish_file(open("/path/to/file.rst")
Run Code Online (Sandbox Code Playgroud)
但是,这对sphinx特定指令等一无所知......