2016-02-04 16 views
10

獅身人面像的文件在我buildout.cfg文件,我有這樣的代碼:如何配置擴建創建使用斌/ sphinxbuilder

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腦電圖。

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)如何使獅身人面像自動工作與buildout? (2)如何在.rst文件中設置項目模塊(應用程序)的正確路徑? (3)conf.py文件在哪裏?

+1

你在Windows上工作? 0.8.2 py27 collective.recipe.sphinxbuilder egg中存在一個錯誤,它會導致我的錯誤(sphinxbuilder/__ init__.py中的第146行),從而導致我無法構建。我仍然可以使用其他腳本,但在文檔中使用「parts = sphinxbuilder」無法正常工作 –

+0

不,在Linux上。謝謝。 –

回答

0

在這裏的窗口,但我似乎還記得類似的問題。

延伸下面CFG確保兩件事情: 1)我們生成有權訪問斯芬克斯雞蛋 2)份,其依賴於斯芬克斯入口點會-after-相同的入口點被執行的生成的所有入口點

[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} 

利用這一點,你還可以添加依賴於編譯/ apidoc可執行部分和您的文檔生成變成了一鍵式擴建的一部分:

[sphinx.apidoc] 
recipe = plone.recipe.command 
command = ${buildout:bin-directory}\sphinx-apidoc.exe <all your flags/settiongs based on buildout>