簡體   English   中英

從 epydoc 移動到 sphinx 以自動記錄一個簡單的 python .py 文件

[英]Moving from epydoc to sphinx to auto-document a simple python .py file

即使在應用補丁之后,Epydoc 也無法正常工作,所以我正在嘗試轉向 Sphinx。

我想從一個簡單的 python 文件自動生成文檔: test.py

安裝並運行sphinx-quickstart-script 后,我將test.py復制到文件夾並輸入:

sphinx-build -b html .\\source .\\build

但它只生成 minimiun html 文件,它不解析test.py文件

我的想法用完了。

謝謝你的幫助 :)

您必須在conf.py ( https://www.sphinx-doc.org/en/master/usage/configuration.html ) 中包含sphinx.ext.autodoc作為擴展名, conf.py才能使用.. automodule::指令(或來自這個模塊的對象,帶有.. autoclass:: , .. autofunction:: , ...)。

https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html

要自動生成必要的.rst文件,您可以使用sphinx-apidoc

這讓生活變得更加輕松。 因此,您不必手動記錄每個模塊。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM