[英]How to configure buildout to create sphinx documentation using bin/sphinxbuilder
在我的buildout.cfg文件中,我有這樣的代碼:
parts =
...
sphinxbuilder
下一個在同一檔案中:
eggs=
...
jinja2
markupsafe
sphinx
然后,在文件的末尾:
[sphinxbuilder]
recipe = collective.recipe.sphinxbuilder
source = ${buildout:directory}/docs-src
build = ${buildout:directory}/docs
我做:
bin/buildout
它給出了輸出(通常:OK):
Updating sphinxbuilder.
collective.recipe.sphinxbuilder: writing MAKEFILE..
collective.recipe.sphinxbuilder: writing BATCHFILE..
collective.recipe.sphinxbuilder: writing custom sphinx-builder script..
在雞蛋文件夾中,我有Sphinx
eeg。
在buildout
之后,在項目目錄下我有一個新的目錄: docs
。 然后我運行命令:
bin/sphinx-quickstart
作為root path for the documentation
我設置了docs
然后我編輯docs/conf.py
並取消注釋
sys.path.insert(0, os.path.abspath('.'))
我運行命令bin/sphinxbuilder
並得到錯誤:
Makefile:12: *** The 'sphinx-build' command was not found.
Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the 'sphinx-build' executable.
Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/. Stop.
主要問題 :(1)如何通過擴建自動進行獅身人面像的工作? (2)如何在.rst文件中設置項目模塊(apps)的正確路徑? (3)在哪里放置conf.py
文件?
在這里的窗戶,但我似乎回想起類似的問題。
擴展以下cfg確保了兩件事:1)我們生成的所有入口點都可以訪問sphinx蛋2)依賴於sphinx入口點的部分將被執行 - 之后生成這些入口點
[sphinx]
eggs =
sphinx
<if you have theme eggs or other extensions, put em here>
parts =
sphinx.console_scripts
[sphinx.console_scripts]
recipe = zc.recipe.egg
dependent-scripts = true
eggs =
${sphinx.eggs}
${buildout:eggs}
使用它,您還可以添加依賴於build / apidoc可執行文件的部件,並且您的文檔生成將成為一鍵式構建的一部分:
[sphinx.apidoc]
recipe = plone.recipe.command
command = ${buildout:bin-directory}\sphinx-apidoc.exe <all your flags/settiongs based on buildout>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.