-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update doc tasks and scripts (w. GitHub Pages)
- Loading branch information
1 parent
0a321ac
commit ebf4709
Showing
6 changed files
with
201 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
@echo off | ||
REM This script was copied from PythonQwt project | ||
REM ====================================================== | ||
REM Build GitHub Pages documentation | ||
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 ====================================================== | ||
|
||
@REM Get the target path for GitHub Pages from `CDL_GHPAGES` environment variable: | ||
@REM if this variable is not defined, interrupt the script and show an error message | ||
if not defined CDL_GHPAGES ( | ||
echo ERROR: CDL_GHPAGES environment variable is not defined. | ||
echo Please define it to the path of the local clone of the GitHub Pages repository. | ||
echo For instance: | ||
echo set CDL_GHPAGES=C:\Dev\DataLab_GitHub_Pages | ||
echo. | ||
echo Then, run this script again. | ||
exit /b 1 | ||
) | ||
|
||
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 | ||
|
||
@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 ( | ||
set LANG=%%L | ||
%PYTHON% doc/update_screenshots.py | ||
set TARGET=%CDL_GHPAGES%\%%L | ||
if exist %TARGET% ( rmdir /s /q %TARGET% ) | ||
sphinx-build -b html -D language=%%L doc %TARGET% | ||
) | ||
|
||
call %FUNC% EndOfScript |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
@echo off | ||
REM This script was copied from PythonQwt project | ||
REM ====================================================== | ||
REM Preview GitHub Pages documentation | ||
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% SetPythonPath | ||
call %FUNC% UsePython | ||
|
||
start http://localhost:8000 | ||
|
||
cd %CDL_GHPAGES% | ||
%PYTHON% -m http.server | ||
|
||
call %FUNC% EndOfScript |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
@echo off | ||
REM This script was copied from PythonQwt project | ||
REM ====================================================== | ||
REM Upload GitHub Pages documentation | ||
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 ====================================================== | ||
|
||
@REM Get the target path for GitHub Pages from `CDL_GHPAGES` environment variable: | ||
@REM if this variable is not defined, interrupt the script and show an error message | ||
if not defined CDL_GHPAGES ( | ||
echo ERROR: CDL_GHPAGES environment variable is not defined. | ||
echo Please define it to the path of the local clone of the GitHub Pages repository. | ||
echo For instance: | ||
echo set CDL_GHPAGES=C:\Dev\DataLab_GitHub_Pages | ||
echo. | ||
echo Then, run this script again. | ||
exit /b 1 | ||
) | ||
|
||
call %~dp0utils GetScriptPath SCRIPTPATH | ||
|
||
pushd %CDL_GHPAGES% | ||
git checkout gh-pages | ||
git add . | ||
git commit -m "Update documentation" | ||
git push origin gh-pages | ||
popd | ||
|
||
call %FUNC% EndOfScript |