Debian Codegraph @

scripts/build_doc.bat

raw
1 @echo off
2 REM This script was copied from PythonQwt project
3 REM ======================================================
4 REM Documentation build script
5 REM ======================================================
6 REM Licensed under the terms of the MIT License
7 REM Copyright (c) 2020 Pierre Raybaut
8 REM (see PythonQwt LICENSE file for more details)
9 REM ======================================================
10 call %~dp0utils GetScriptPath SCRIPTPATH
11 call %FUNC% GetLibName LIBNAME
12 call %FUNC% GetModName MODNAME
13 call %FUNC% SetPythonPath
14 call %FUNC% UsePython
15 call %FUNC% GetVersion DATALAB_VERSION
16 cd %SCRIPTPATH%\..
17
18 @REM Set light mode for Qt applications and clean previous documentation ===============
19 set QT_COLOR_MODE=light
20 if exist %MODNAME%\data\doc ( rmdir /s /q %MODNAME%\data\doc )
21 mkdir %MODNAME%\data\doc
22
23 @REM Build documentation ===============================================================
24 for %%L in (fr en) do (
25 @REM -------------------------------------------------------------------------------
26 @REM Create dummy PDF file, otherwise the PDF menu entry in "?" menu
27 @REM won't be visible in the automatic screenshot
28 echo Dummy PDF file > %MODNAME%\data\doc\DataLab_%%L.pdf
29 @REM -------------------------------------------------------------------------------
30 set LANG=%%L
31 %PYTHON% doc/update_screenshots.py
32 if exist build\doc ( rmdir /s /q build\doc )
33 sphinx-build -b latex -D language=%%L doc build\doc
34 cd build\doc
35 echo Building PDF documentation for %%L...
36 pdflatex -interaction=nonstopmode -quiet DataLab.tex
37 @REM Build again to fix table of contents (workaround)
38 pdflatex -interaction=nonstopmode -quiet DataLab.tex
39 echo Done.
40 cd ..\..
41 move /Y build\doc\DataLab.pdf %MODNAME%\data\doc\DataLab_%%L.pdf
42 )
43
44 @REM explorer %MODNAME%\data\doc
45
46 call %FUNC% EndOfScript