-
Notifications
You must be signed in to change notification settings - Fork 5
/
make.bat
138 lines (118 loc) · 3.29 KB
/
make.bat
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
@ECHO OFF
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.\manual
set BUILDDIR=build
if "%BF_LANG%" == "" set BF_LANG=en
set SPHINXOPTS=-j auto -D language=%BF_LANG%
REM Check if sphinx-build is available and fallback to Python version if any
%SPHINXBUILD% 1>NUL 2>NUL
if errorlevel 9009 goto sphinx_python
goto sphinx_ok
:sphinx_python
set SPHINXBUILD=python -m sphinx.__init__
%SPHINXBUILD% 2> nul
if errorlevel 9009 (
echo.
echo The 'sphinx-build' command was not found. Make sure you have Sphinx
echo installed, then set the SPHINXBUILD environment variable to point
echo to the full path of the 'sphinx-build' executable. Alternatively you
echo may add the Sphinx directory to PATH.
echo.
echo If you don't have Sphinx installed, grab it from
echo http://sphinx-doc.org/
rem Exit with errorlevel 1
exit /b 1
)
:sphinx_ok
REM Default to livehtml
if "%1" == "" (
goto livehtml
)
if "%1" == "help" (
echo.
echo Sphinx
echo ======
%SPHINXBUILD% -M help "%SOURCEDIR%" "%BUILDDIR%" %SPHINXOPTS% %O%
echo.
echo Custom Targets
echo ==============
echo Convenience targets provided for building docs
echo.
echo - livehtml [default] to auto build on file changes and host on localhost
echo - readme to make a 'readme.html' file
echo - clean to delete all old build files
echo.
echo Translations
echo ------------
echo.
echo - update_po to update PO message catalogs
echo - report_po_progress to check the progress/fuzzy strings [optionally specify locale]
echo.
echo Checking
echo --------
echo.
echo - check_structure to check the structure of all .rst files
echo - check_syntax to check the syntax of all .rst files
echo - check_spelling to check spelling for text in RST files
goto EOF
)
if "%1" == "livehtml" (
:livehtml
sphinx-autobuild --open-browser --delay 0 "%SOURCEDIR%" "%BUILDDIR%\html" %SPHINXOPTS% %O%
if errorlevel 1 exit /b 1
goto EOF
)
if "%1" == "latexpdf" (
%SPHINXBUILD% -b latex %SPHINXOPTS% %O% "%SOURCEDIR%" "%BUILDDIR%\latex"
cd "%BUILDDIR%\latex"
make all-pdf
cd %~dp0
echo To view, run:
echo start "%BUILDDIR%\html\blender_manual.pdf"
goto EOF
)
if "%1" == "readme" (
rst2html5.py readme.rst > "%BUILDDIR%\readme.html"
echo Build finished. The HTML page is in "%BUILDDIR%\readme.html".
echo To view, run:
echo start "%BUILDDIR%\readme.html"
goto EOF
)
if "%1" == "check_syntax" (
python tools_rst\rst_check_syntax.py --kbd --long
goto EOF
)
if "%1" == "update_po" (
python tools_maintenance\update_po.py
goto EOF
)
if "%1" == "report_po_progress" (
IF NOT EXIST %cd%\locale GOTO MISSING_LOCALE
python tools_report\report_translation_progress.py locale\%2 --quiet
goto EOF
)
if "%1" == "check_spelling" (
echo here
python tools_rst\rst_check_spelling.py
goto EOF
)
if "%1" == "check_structure" (
python tools_rst\rst_check_images.py
goto EOF
) else (
%SPHINXBUILD% -M %1 "%SOURCEDIR%" "%BUILDDIR%" %SPHINXOPTS% %O%
goto EOF
)
:MISSING_LOCALE
echo.
echo The locale directory is missing.
echo.
echo To correct this, checkout one or more translation repositories.
echo Details can be found at:
echo https://docs.blender.org/manual/en/latest/about/contribute/translations/contribute.html
rem Exit with errorlevel 1
exit /b 1
:EOF