sphinx autobuild - 用法、makefile、扩展

sphinx autobuild - usage, makefile, extensions

我是第一次使用 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

根据https://bskinn.github.io/Sphinx-Autobuild-Windows/

当我调用 make.bat livehtml 时,出现错误:

Builder name livehtml not registered or available through entry point

我用谷歌搜索,这就是我找到的全部内容:https://github.com/readthedocs/readthedocs-sphinx-ext/issues/27 所以看起来我可能必须将自动构建扩展添加到 conf.py 文件中 - 但是如何呢? 或者也许是别的什么?我确实用 pip 安装了 sphinx-autobuild。

sphinx-autobuild 是一个应用程序,它启动 Web 服务器并探测 docs 目录中的更改,以自动刷新您在浏览器中开发的文档的打开页面。

它不是狮身人面像 extension nor does its documentation 声称它是。

你遇到的错误:

When I call "make.bat livehtml", I get the error: Builder name livehtml not registered or available through entry point

表示当您尝试 运行ning make livehtml 时,您对 make 文件所做的更改尚未保存。对 make 文件的编辑启动 sphinx-autobuild 而不是通常的 sphinx-build。因为 sphinx-build 被 运行 通常传递 livehtml 作为 buildername 无法找到。