File: build_doc.bat

package info (click to toggle)
datalab 0.18.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 41,724 kB
  • sloc: python: 27,814; makefile: 7
file content (49 lines) | stat: -rw-r--r-- 1,974 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
@echo off
REM This script was copied from PythonQwt project
REM ======================================================
REM Documentation build script
REM ======================================================
REM Licensed under the terms of the MIT License
REM Copyright (c) 2020 Pierre Raybaut
REM (see PythonQwt LICENSE file for more details)
REM ======================================================
call %~dp0utils GetScriptPath SCRIPTPATH
call %FUNC% GetLibName LIBNAME
call %FUNC% GetModName MODNAME
call %FUNC% SetPythonPath
call %FUNC% UsePython
call %FUNC% GetVersion CDL_VERSION
cd %SCRIPTPATH%\..
%PYTHON% doc\update_requirements.py
%PYTHON% doc\update_validation_status.py
%PYTHON% doc\update_processor_methods.py

@REM Set light mode for Qt applications and clean previous documentation ===============
set QT_COLOR_MODE=light
if exist %MODNAME%\data\doc ( rmdir /s /q %MODNAME%\data\doc )
mkdir %MODNAME%\data\doc

@REM Build documentation ===============================================================
for %%L in (fr en) do (
    @REM -------------------------------------------------------------------------------
    @REM Create dummy PDF file, otherwise the PDF menu entry in "?" menu
    @REM won't be visible in the automatic screenshot
    echo Dummy PDF file > %MODNAME%\data\doc\%LIBNAME%_%%L.pdf
    @REM -------------------------------------------------------------------------------
    set LANG=%%L
    %PYTHON% doc/update_screenshots.py
    if exist build\doc ( rmdir /s /q build\doc )
    sphinx-build -b latex -D language=%%L doc build\doc
    cd build\doc
    echo Building PDF documentation for %%L...
    pdflatex -interaction=nonstopmode -quiet %LIBNAME%.tex
    @REM Build again to fix table of contents (workaround)
    pdflatex -interaction=nonstopmode -quiet %LIBNAME%.tex
    echo Done.
    cd ..\..
    move /Y build\doc\%LIBNAME%.pdf %MODNAME%\data\doc\%LIBNAME%_%%L.pdf
)

@REM explorer %MODNAME%\data\doc

call %FUNC% EndOfScript