sphinx自动构建-用法,makefile,扩展名

问题描述

我是第一次使用狮身人面像,所以我确定这只是一个了解基础知识的问题,对此感到抱歉。

使用窗口,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时收到错误消息:

注册或无法通过入口点访问的构建器名称livehtml

我用Google搜索,这就是我发现的全部内容https://github.com/readthedocs/readthedocs-sphinx-ext/issues/27 因此看来我可能必须将autobuild扩展名添加conf.py文件中-但是如何? 或者也许是其他东西?我确实用pip安装了sphinx-autobuild。

解决方法

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

它不是狮身人面像extension,也不是its documentation声称它是狮身人面像。

您收到的错误:

当我调用“ make.bat livehtml”时,出现错误:生成器名称livehtml未注册或通过入口点可用

表示当您尝试运行make livehtml时,尚未保存对Make文件的更改。对make文件的编辑将启动sphinx-autobuild,而不是通常的sphinx-build。由于sphinx-build正常运行,因此将livehtml传递为找不到的buildername