Python sphinx autobuild-用法、生成文件、扩展名
我第一次和斯芬克斯合作,所以我确信这只是理解基础知识的问题,对此我很抱歉 使用windows时,Python sphinx autobuild-用法、生成文件、扩展名,python,python-sphinx,Python,Python Sphinx,我第一次和斯芬克斯合作,所以我确信这只是理解基础知识的问题,对此我很抱歉 使用windows时,make.bat的一部分如下所示: if "%SPHINXBUILD%" == "" ( set SPHINXBUILD=sphinx-build ) set SOURCEDIR=. set BUILDDIR=_build if "%1" == "" goto help if "%1" ==
make.bat
的一部分如下所示:
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build
if "%1" == "" goto help
if "%1" == "deploy" goto deploy
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end
if "%1" == "livehtml" (
sphinx-autobuild %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %2
) else (
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %2
)
goto end
:deploy
rmdir /S /Q ..\..\public || true
cp -r _build\html ..\..\public
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
在我添加的部分中:
if "%1" == "livehtml" (
sphinx-autobuild %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %2
) else (
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %2
)
goto end
据
调用make.bat livehtml
时,出现错误:
生成器名称livehtml未注册或通过入口点可用
我在谷歌上搜索了一下,我只找到了这些:
因此,似乎我必须将autobuild扩展添加到conf.py
文件中,但是如何添加呢?
或者是别的什么?我确实用pip安装了sphinx autobuild。sphinx autobuild是一个应用程序,它启动web服务器并探测
文档
目录中的更改,以自动刷新浏览器中正在开发的文档的打开页面
它不是狮身人面像,也不自称是狮身人面像
您得到的错误是:
当我调用“make.bat livehtml”时,我得到一个错误:Builder name livehtml未注册或通过入口点不可用
表示您在尝试运行
make livehtml
时对make文件所做的更改尚未保存。对make文件的编辑将启动sphinx autobuild
,而不是通常的sphinx build
。因为sphinx-build
正在正常运行,将livehtml
作为一个无法找到的文件传递。sphinx-autobuild的文档没有说明必须在conf,py()中填充extensions
。我不认为sphinx autobuild是在中描述的sphinx扩展。@mzjn是的,没错,我得到了相同的印象。只是因为一个相似的原因才试过error@bad_coder非常感谢你的建议!我也可以试试。然而,由于其他人也将在研究它,我最终肯定需要一个不同的解决方案。@bad_coder这正是我3天前所做的,也是我从中得到错误的地方。现在,由于周末没有接触任何代码,甚至连我的电脑都没有,所以当我再次尝试构建它时,它没有出现任何错误。我现在觉得自己超级愚蠢。无论如何,非常感谢您的努力:)它仍然不会在浏览器中更新,但我想这是另一个问题。