我是第一次使用 sphinx,所以我确信这只是一个理解基础知识的问题,对此感到抱歉。
使用 Windows,部分内容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 未注册或可通过入口点使用
我用谷歌搜索,这就是我找到的全部: https: //github.com/readthedocs/readthedocs-sphinx-ext/issues/27 所以看起来我可能必须将自动构建扩展添加到文件中conf.py
- 但如何呢?或者也许是别的什么?我确实用 pip 安装了 sphinx-autobuild 。
慕的地10843
相关分类