| 1 |
@ECHO OFF |
| 2 |
REM ~ Windows command line make file for Sphinx documentation |
| 3 |
|
| 4 |
SETLOCAL |
| 5 |
|
| 6 |
SET SPHINXOPTS= |
| 7 |
SET SPHINXBUILD=sphinx-build |
| 8 |
SET PAPER= |
| 9 |
SET SRCDIR=source |
| 10 |
SET PYTHON=python |
| 11 |
|
| 12 |
IF "%PAPER%" == "" SET PAPER=a4 |
| 13 |
SET ALLSPHINXOPTS=-d build\doctrees -D latex_paper_size=%PAPER% %SPHINXOPTS% %SRCDIR% |
| 14 |
|
| 15 |
FOR %%X IN (%SPHINXBUILD%.exe) DO SET P=%%~$PATH:X |
| 16 |
|
| 17 |
FOR %%L IN (html html_noapi pickle htmlhelp latex changes linkcheck) DO ( |
| 18 |
IF "%1" == "%%L" ( |
| 19 |
IF "%P%" == "" ( |
| 20 |
ECHO. |
| 21 |
ECHO Error: Sphinx is not available. Please make sure it is correctly installed. |
| 22 |
GOTO END |
| 23 |
) |
| 24 |
MD build\doctrees 2>NUL |
| 25 |
MD build\%1 || GOTO DIR_EXIST |
| 26 |
%PYTHON% autogen_config.py && ECHO Created docs for config options |
| 27 |
%PYTHON% autogen_magics.py && ECHO Created docs for line ^& cell magics |
| 28 |
%PYTHON% autogen_shortcuts.py && ECHO Created docs for shortcuts |
| 29 |
IF NOT "%1" == "html_noapi" ( |
| 30 |
%PYTHON% autogen_api.py && ECHO Build API docs finished |
| 31 |
%SPHINXBUILD% -b %1 %ALLSPHINXOPTS% build\%1 |
| 32 |
) ELSE ( |
| 33 |
%SPHINXBUILD% -b html %ALLSPHINXOPTS% build\%1 |
| 34 |
) |
| 35 |
IF NOT ERRORLEVEL 0 GOTO ERROR |
| 36 |
ECHO. |
| 37 |
ECHO Build finished. Results are in build\%1. |
| 38 |
IF "%1" == "pickle" ( |
| 39 |
ECHO Now you can process the pickle files or run |
| 40 |
ECHO sphinx-web build\pickle to start the sphinx-web server. |
| 41 |
) |
| 42 |
IF "%1" == "htmlhelp" ( |
| 43 |
ECHO Now you can run HTML Help Workshop with the |
| 44 |
ECHO .hhp project file in build/htmlhelp. |
| 45 |
) |
| 46 |
IF "%1" == "linkcheck" ( |
| 47 |
ECHO Look for any errors in the above output |
| 48 |
ECHO or in build\linkcheck\output.rst. |
| 49 |
) |
| 50 |
GOTO END |
| 51 |
) |
| 52 |
) |
| 53 |
|
| 54 |
|
| 55 |
IF "%1" == "clean" ( |
| 56 |
RD /s /q build dist %SRCDIR%\api\generated 2>NUL |
| 57 |
IF ERRORLEVEL 0 ECHO Build environment cleaned! |
| 58 |
GOTO END |
| 59 |
) |
| 60 |
|
| 61 |
ECHO. |
| 62 |
ECHO Please use "make [target]" where [target] is one of: |
| 63 |
ECHO. |
| 64 |
ECHO html to make standalone HTML files |
| 65 |
ECHO html_noapi same as above, without the time consuming API docs |
| 66 |
ECHO jsapi to make standalone HTML files for the Javascript API |
| 67 |
ECHO pickle to make pickle files (usable by e.g. sphinx-web) |
| 68 |
ECHO htmlhelp to make HTML files and a HTML help project |
| 69 |
ECHO latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter |
| 70 |
ECHO changes to make an overview over all changed/added/deprecated items |
| 71 |
ECHO linkcheck to check all external links for integrity |
| 72 |
GOTO END |
| 73 |
|
| 74 |
:DIR_EXIST |
| 75 |
ECHO. |
| 76 |
ECHO Info: Run "make clean" to clean build environment |
| 77 |
|
| 78 |
:ERROR |
| 79 |
ECHO. |
| 80 |
ECHO Error: Build process failed! |
| 81 |
|
| 82 |
:END |
| 83 |
ENDLOCAL |