Debian Codegraph @

scripts/build_ghpages.bat

raw
1 @echo off
2 REM This script was copied from PythonQwt project
3 REM ======================================================
4 REM Build GitHub Pages documentation
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
11 setlocal enabledelayedexpansion
12
13 @REM Get the target path for GitHub Pages from `DATALAB_GHPAGES` environment variable:
14 @REM if this variable is not defined, interrupt the script and show an error message
15 if not defined DATALAB_GHPAGES (
16 echo ERROR: DATALAB_GHPAGES environment variable is not defined.
17 echo Please define it to the path of the local clone of the GitHub Pages repository.
18 echo For instance:
19 echo set DATALAB_GHPAGES=C:\Dev\DataLab-Platform.github.io
20 echo.
21 echo Then, run this script again.
22 exit /b 1
23 )
24
25 call %~dp0utils GetScriptPath SCRIPTPATH
26 call %FUNC% GetLibName LIBNAME
27 call %FUNC% GetModName MODNAME
28 call %FUNC% SetPythonPath
29 call %FUNC% UsePython
30 call %FUNC% GetVersion DATALAB_VERSION
31 cd %SCRIPTPATH%\..
32
33 set QT_COLOR_MODE=light
34
35 @REM Build documentation ===============================================================
36 for %%L in (fr en) do (
37 set LANG=%%L
38 set TARGET=%DATALAB_GHPAGES%\%%L
39 %PYTHON% doc/update_screenshots.py
40 if exist !TARGET! ( rmdir /s /q !TARGET! )
41 sphinx-build -b html -D language=%%L doc !TARGET!
42 )
43
44 call %FUNC% EndOfScript