[Bf-docboard-svn] bf-manual: [8633] branches/blender-3.0-release/blender_docs/make.bat: Cleanup of make.bat for Windows systems
Aaron Carlisle
noreply at blender.org
Wed Nov 17 00:50:01 CET 2021
Revision: 8633
https://developer.blender.org/rBM8633
Author: Blendify
Date: 2021-11-17 00:50:00 +0100 (Wed, 17 Nov 2021)
Log Message:
-----------
Cleanup of make.bat for Windows systems
The make.bat had several issues that needed fixing:
# Bad use of parenthesis on one line "(default)" changed to "[default]". This caused a syntax error when trying to run `make help`. The error was " to was unexpected at this time."
# Incorrect style use of `echo.` On Windows, the command `echo.` should be used to generate a blank line. A period should never be placed after echo for any other text on a line. This is considered bad syntax on Windows and may fail unpredictably.
# Incorrect use of UN*X style forward slashes. On WIndows, paths should use proper backslash syntax.
# The "LOCALE_MISSING" section was itself missing from the batch file. Added it and provided a link to the documentation page specifying how to install locales.
# Added quotes around all pathspecs to allow for directories with spaces in the name.
I tested these changes and they do not break functions, and restore proper use of `make help`. I'm guessing this has been broken for a LONG time.
Author: @Nikhil.Net
Differential Revision: https://developer.blender.org/D13172
Modified Paths:
--------------
branches/blender-3.0-release/blender_docs/make.bat
Modified: branches/blender-3.0-release/blender_docs/make.bat
===================================================================
--- branches/blender-3.0-release/blender_docs/make.bat 2021-11-16 16:31:03 UTC (rev 8632)
+++ branches/blender-3.0-release/blender_docs/make.bat 2021-11-16 23:50:00 UTC (rev 8633)
@@ -5,7 +5,7 @@
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
-set SOURCEDIR=./manual
+set SOURCEDIR=.\manual
set BUILDDIR=build
if "%BF_LANG%" == "" set BF_LANG=en
set SPHINXOPTS=-j auto -D language=%BF_LANG%
@@ -21,13 +21,14 @@
%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 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/
+ echo If you don't have Sphinx installed, grab it from
+ echo http://sphinx-doc.org/
+ rem Exit with errorlevel 1
exit /b 1
)
@@ -40,88 +41,98 @@
if "%1" == "help" (
echo.
- echo.Sphinx
- echo.======
- %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
+ echo Sphinx
+ echo ======
+ %SPHINXBUILD% -M help "%SOURCEDIR%" "%BUILDDIR%" %SPHINXOPTS% %O%
echo.
- echo.Custom Targets
- echo.==============
- echo.Convenience targets provided for building docs
+ 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 - 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 Translations
+ echo ------------
echo.
- echo.- update_po to update PO message catalogs
- echo.- report_po_progress to check the progress/fuzzy strings
+ 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 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 - 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%
+ 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
+ %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
+ 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
+ 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
+ python tools_rst\rst_check_syntax.py --kbd --long
goto EOF
)
if "%1" == "update_po" (
- python tools_maintenance/update_po.py
+ 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
+ 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
+ echo here
+ python tools_rst\rst_check_spelling.py
goto EOF
)
if "%1" == "check_structure" (
- python tools_rst/rst_check_images.py
+ python tools_rst\rst_check_images.py
goto EOF
) else (
- %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
+ %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
More information about the Bf-docboard-svn
mailing list