1
我曾嘗試這樣的代碼:Python的轉換獅身人面像RST爲HTML
from docutils.core import publish_string
text = publish_string(open(file_path, 'r').read(), writer_name='html')
但它說:
<p>Unknown directive type "toctree".</p>
所以不會有一些具體的獅身人面像的指令工作。
爲獅身人面像RST文件做同樣的事情最簡單的方法是什麼?
upd。 好像它必須是:
sphinx-build -b singlehtml -D extensions='sphinx.ext.autodoc' -D master_doc='index' -C /mypath/docs .
我如何可以調用Python代碼,而不是控制檯?