File: make.bat

package info (click to toggle)
blender-doc 4.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 253,604 kB
  • sloc: python: 13,030; javascript: 322; makefile: 113; sh: 107
file content (142 lines) | stat: -rw-r--r-- 3,395 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
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
139
140
141
142
@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.
	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
	echo.
	echo Utilities
	echo ---------
	echo.
	echo - update               to update the repository to the most recent version.
	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" == "check_syntax" (
	python tools\check_source\check_syntax.py --kbd --long
	goto EOF
)

if "%1" == "checkout_locale" (
	python build_files\utils\checkout_locale.py
	goto EOF
)

if "%1" == "update_po" (
	python tools/utils_maintenance\update_po.py
	goto EOF
)

if "%1" == "report_po_progress" (
	IF NOT EXIST %cd%\locale GOTO MISSING_LOCALE
	python tools\translations\report_translation_progress.py locale\%2 --quiet
	goto EOF

)

if "%1" == "check_spelling" (
	python tools\check_source\check_spelling.py
	goto EOF
)

if "%1" == "check_structure" (
	python tools\check_source\check_images.py
	python tools\check_source\check_structure.py
	goto EOF

if "%1" == "update" (
	python build_files\utils\make_update.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