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