blob: 0b5b56e428c70ac95b5e0e6021c37fd701c72cc5 [file] [log] [blame]
Antoine Pitrou7f1e1742011-02-25 14:19:48 +00001@@echo off
2setlocal
3
Terry Jan Reedy3b220e12013-03-13 21:33:50 -04004if "%PYTHON%" EQU "" set PYTHON=py -2
Antoine Pitrou7f1e1742011-02-25 14:19:48 +00005if "%HTMLHELP%" EQU "" set HTMLHELP=%ProgramFiles%\HTML Help Workshop\hhc.exe
6if "%DISTVERSION%" EQU "" for /f "usebackq" %%v in (`%PYTHON% tools/sphinxext/patchlevel.py`) do set DISTVERSION=%%v
7
8if "%1" EQU "" goto help
9if "%1" EQU "html" goto build
10if "%1" EQU "htmlhelp" goto build
11if "%1" EQU "latex" goto build
12if "%1" EQU "text" goto build
13if "%1" EQU "suspicious" goto build
14if "%1" EQU "linkcheck" goto build
15if "%1" EQU "changes" goto build
Antoine Pitrou7f1e1742011-02-25 14:19:48 +000016
17:help
18set this=%~n0
19echo HELP
20echo.
Antoine Pitrou7f1e1742011-02-25 14:19:48 +000021echo %this% html
22echo %this% htmlhelp
23echo %this% latex
24echo %this% text
25echo %this% suspicious
26echo %this% linkcheck
27echo %this% changes
28echo.
29goto end
30
Antoine Pitrou7f1e1742011-02-25 14:19:48 +000031:build
32if not exist build mkdir build
33if not exist build\%1 mkdir build\%1
34if not exist build\doctrees mkdir build\doctrees
35cmd /C %PYTHON% --version
36cmd /C %PYTHON% tools\sphinx-build.py -b%1 -dbuild\doctrees . build\%*
37if "%1" EQU "htmlhelp" "%HTMLHELP%" build\htmlhelp\python%DISTVERSION:.=%.hhp
38goto end
39
40:end