我正在嘗試使用 sphinx 為我的項目的 python 部分生成文檔。我想在 gitlab-ci 文件中執行此操作,但目前我什至無法使其在本地工作。項目結構:dev/ src/ other-src/ python-api/ src/ conf.py index.rst mymodule/ submodule1/ some python files submodule2/ some python files submodule3/ some python files some python filesdoc/ source/ build/public/我想為 dev/src/python/src/mymodule 中的所有 python 文件生成文檔。然而,我所有的嘗試都會導致一個空文檔,我想我誤解了一些東西。我嘗試遵循官方快速入門:https://www.sphinx-doc.org/en/master/usage/quickstart.html
1 回答

縹緲止盈
TA貢獻2041條經驗 獲得超4個贊
聽起來您沒有定義 Sphinx 應考慮文檔字符串中文檔的哪些部分。例如,假設您有一個./docs/sourc/index.rst
包含以下內容的文件:
..?automodule::?python.package.path.to.class ????:noindex:
完成后,只需進入您的 doc 文件夾并執行以下命令:
sphinx-build?-b?html?source?build
添加回答
舉報
0/150
提交
取消