Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何配置buildout以使用bin/sphinxbuilder创建sphinx文档_Python_Python Sphinx_Buildout - Fatal编程技术网

Python 如何配置buildout以使用bin/sphinxbuilder创建sphinx文档

Python 如何配置buildout以使用bin/sphinxbuilder创建sphinx文档,python,python-sphinx,buildout,Python,Python Sphinx,Buildout,在我的buildout.cfg文件中,我有这样的代码: parts = ... sphinxbuilder 同一文件中的下一个: eggs= ... jinja2 markupsafe sphinx 然后,在文件末尾: [sphinxbuilder] recipe = collective.recipe.sphinxbuilder source = ${buildout:directory}/docs-src build = ${buildout:di

在我的buildout.cfg文件中,我有这样的代码:

parts =
    ...
    sphinxbuilder
同一文件中的下一个:

eggs=
   ...
   jinja2
   markupsafe
   sphinx
然后,在文件末尾:

[sphinxbuilder]
recipe = collective.recipe.sphinxbuilder
source = ${buildout:directory}/docs-src
build = ${buildout:directory}/docs
我有:

给出输出(一般情况下:OK):

在鸡蛋文件夹中,我有
Sphinx
eeg

buildout
之后,在项目目录下我有一个新目录:
docs
。 然后我运行命令:

bin/sphinx-quickstart
作为文档的
根路径
I设置
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让sphinx自动工作? (2) 如何在.rst文件中设置项目模块(应用程序)的正确路径?
(3) windows上的
conf.py
文件放在哪里?

这里,但我似乎想起了一个类似的问题

扩展以下cfg可确保两件事: 1) 我们生成的所有入口点都可以进入斯芬克斯蛋 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}
[sphinx]
鸡蛋=
斯芬克斯
零件=
sphinx.console_脚本
[sphinx.console_脚本]
配方=zc.recipe.egg
依赖脚本=true
鸡蛋=
${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>
[sphinx.apidoc]
配方=plone.recipe.command
command=${buildout:bin directory}\sphinx-apidoc.exe

您正在使用Windows吗?在0.8.2 py27 collective.recipe.sphinxbuilder egg中有一个bug,它会给我造成一个错误(sphinxbuilder/__init__;.py中的第146行),这会阻止我进行构建。我仍然可以使用其他脚本,但是在他们的文档中使用“parts=sphinxbuilder”在Linux上无法正常工作。非常感谢。
[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}
[sphinx.apidoc]
recipe = plone.recipe.command
command = ${buildout:bin-directory}\sphinx-apidoc.exe <all your flags/settiongs based on buildout>