|
1 | | -@ECHO OFF |
2 | | - |
3 | | -pushd %~dp0 |
4 | | - |
5 | | -REM Command file to build Sphinx documentation |
6 | | - |
7 | | -set SOURCEDIR=. |
8 | | -set BUILDDIR=_build |
9 | | - |
10 | | -REM Check if a specific target was passed |
11 | | -if "%1" == "multi-docs" ( |
12 | | - REM Check if SPHINXBUILD is set, if not default to sphinx-multiversion |
13 | | - if "%SPHINXBUILD%" == "" ( |
14 | | - set SPHINXBUILD=sphinx-multiversion |
15 | | - ) |
16 | | - where %SPHINXBUILD% >NUL 2>NUL |
17 | | - if errorlevel 1 ( |
18 | | - echo. |
19 | | - echo.The 'sphinx-multiversion' command was not found. Make sure you have Sphinx |
20 | | - echo.installed, then set the SPHINXBUILD environment variable to point |
21 | | - echo.to the full path of the 'sphinx-multiversion' executable. Alternatively you |
22 | | - echo.may add the Sphinx directory to PATH. |
23 | | - echo. |
24 | | - echo.If you don't have Sphinx installed, grab it from |
25 | | - echo.http://sphinx-doc.org/ |
26 | | - exit /b 1 |
27 | | - ) |
28 | | - %SPHINXBUILD% %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% |
29 | | - |
30 | | - REM Copy the redirect index.html to the build directory |
31 | | - copy _redirect\index.html %BUILDDIR%\index.html |
32 | | - goto end |
33 | | -) |
34 | | - |
35 | | -if "%1" == "current-docs" ( |
36 | | - REM Check if SPHINXBUILD is set, if not default to sphinx-build |
37 | | - if "%SPHINXBUILD%" == "" ( |
38 | | - set SPHINXBUILD=sphinx-build |
39 | | - ) |
40 | | - where %SPHINXBUILD% >NUL 2>NUL |
41 | | - if errorlevel 1 ( |
42 | | - echo. |
43 | | - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx |
44 | | - echo.installed, then set the SPHINXBUILD environment variable to point |
45 | | - echo.to the full path of the 'sphinx-build' executable. Alternatively you |
46 | | - echo.may add the Sphinx directory to PATH. |
47 | | - echo. |
48 | | - echo.If you don't have Sphinx installed, grab it from |
49 | | - echo.http://sphinx-doc.org/ |
50 | | - exit /b 1 |
51 | | - ) |
52 | | - if exist "%BUILDDIR%\current" rmdir /s /q "%BUILDDIR%\current" |
53 | | - %SPHINXBUILD% -W "%SOURCEDIR%" "%BUILDDIR%\current" %SPHINXOPTS% |
54 | | - goto end |
55 | | -) |
56 | | - |
57 | | -REM If no valid target is passed, show usage instructions |
58 | | -echo. |
59 | | -echo.Usage: |
60 | | -echo. make.bat multi-docs - To build the multi-version documentation. |
61 | | -echo. make.bat current-docs - To build the current documentation. |
62 | | -echo. |
63 | | - |
64 | | -:end |
65 | | -popd |
| 1 | +@ECHO OFF |
| 2 | + |
| 3 | +pushd %~dp0 |
| 4 | + |
| 5 | +REM Command file to build Sphinx documentation |
| 6 | + |
| 7 | +set SOURCEDIR=. |
| 8 | +set BUILDDIR=_build |
| 9 | + |
| 10 | +REM Check if a specific target was passed |
| 11 | +if "%1" == "multi-docs" ( |
| 12 | + REM Check if SPHINXBUILD is set, if not default to sphinx-multiversion |
| 13 | + if "%SPHINXBUILD%" == "" ( |
| 14 | + set SPHINXBUILD=sphinx-multiversion |
| 15 | + ) |
| 16 | + where %SPHINXBUILD% >NUL 2>NUL |
| 17 | + if errorlevel 1 ( |
| 18 | + echo. |
| 19 | + echo.The 'sphinx-multiversion' command was not found. Make sure you have Sphinx |
| 20 | + echo.installed, then set the SPHINXBUILD environment variable to point |
| 21 | + echo.to the full path of the 'sphinx-multiversion' executable. Alternatively you |
| 22 | + echo.may add the Sphinx directory to PATH. |
| 23 | + echo. |
| 24 | + echo.If you don't have Sphinx installed, grab it from |
| 25 | + echo.http://sphinx-doc.org/ |
| 26 | + exit /b 1 |
| 27 | + ) |
| 28 | + %SPHINXBUILD% %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% |
| 29 | + |
| 30 | + REM Copy the redirect index.html to the build directory |
| 31 | + copy _redirect\index.html %BUILDDIR%\index.html |
| 32 | + goto end |
| 33 | +) |
| 34 | + |
| 35 | +if "%1" == "current-docs" ( |
| 36 | + REM Check if SPHINXBUILD is set, if not default to sphinx-build |
| 37 | + if "%SPHINXBUILD%" == "" ( |
| 38 | + set SPHINXBUILD=sphinx-build |
| 39 | + ) |
| 40 | + where %SPHINXBUILD% >NUL 2>NUL |
| 41 | + if errorlevel 1 ( |
| 42 | + echo. |
| 43 | + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx |
| 44 | + echo.installed, then set the SPHINXBUILD environment variable to point |
| 45 | + echo.to the full path of the 'sphinx-build' executable. Alternatively you |
| 46 | + echo.may add the Sphinx directory to PATH. |
| 47 | + echo. |
| 48 | + echo.If you don't have Sphinx installed, grab it from |
| 49 | + echo.http://sphinx-doc.org/ |
| 50 | + exit /b 1 |
| 51 | + ) |
| 52 | + if exist "%BUILDDIR%\current" rmdir /s /q "%BUILDDIR%\current" |
| 53 | + %SPHINXBUILD% -W "%SOURCEDIR%" "%BUILDDIR%\current" %SPHINXOPTS% |
| 54 | + goto end |
| 55 | +) |
| 56 | + |
| 57 | +REM If no valid target is passed, show usage instructions |
| 58 | +echo. |
| 59 | +echo.Usage: |
| 60 | +echo. make.bat multi-docs - To build the multi-version documentation. |
| 61 | +echo. make.bat current-docs - To build the current documentation. |
| 62 | +echo. |
| 63 | + |
| 64 | +:end |
| 65 | +popd |
0 commit comments