[Bf-docboard-svn] bf-manual: [7187] trunk/blender_docs/make.bat: make.bat: Use sphinx makefile command

Aaron Carlisle noreply at blender.org
Mon Oct 5 22:02:45 CEST 2020


Revision: 7187
          https://developer.blender.org/rBM7187
Author:   Blendify
Date:     2020-10-05 22:02:45 +0200 (Mon, 05 Oct 2020)
Log Message:
-----------
make.bat: Use sphinx makefile command

Modified Paths:
--------------
    trunk/blender_docs/make.bat

Modified: trunk/blender_docs/make.bat
===================================================================
--- trunk/blender_docs/make.bat	2020-10-05 19:10:30 UTC (rev 7186)
+++ trunk/blender_docs/make.bat	2020-10-05 20:02:45 UTC (rev 7187)
@@ -6,34 +6,52 @@
 	set SPHINXBUILD=sphinx-build
 )
 set SOURCEDIR=./manual
-set BUILDDIR=_build
+set BUILDDIR=build
 set SPHINXOPTS=-j %Number_Of_Processors%
 
+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/
+	exit /b 1
+)
+
+:sphinx_ok
+
 REM Default to HTML
 if "%1" == "" (
-	echo.No command given, defaulting to html.
-	echo.
 	goto html
 )
 
 if "%1" == "help" (
-	echo.Please use `make ^<target^>` where ^<target^> is one of
 	echo.
-	echo.Documentation
-	echo.=============
+	echo.Sphinx
+	echo.======
+	%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
 	echo.
+	echo.Custom Targets
+	echo.==============
 	echo.Convenience targets provided for building docs
-	echo.- html                 to make standalone HTML files ^(default^)
-	echo.- singlehtml           to make a single large HTML file
-	echo.- latexpdf             to make a PDF using LaTeX warning: this currently has some problems,
-	echo.                       though the PDF generates, there are various unresolved issues
-	echo.- gettext              to make PO message catalogs
-	echo.- epub                 to make an epub
+	echo.
 	echo.- readme               to make a 'readme.html' file
 	echo.- clean                to delete all old build files
 	echo.
 	echo.Translations
-	echo.============
+	echo.------------
 	echo.
 	echo.- gettext              to make PO message catalogs
 	echo.- update_po            to update PO message catalogs
@@ -40,45 +58,13 @@
 	echo.- report_po_progress   to check the progress/fuzzy strings
 	echo.
 	echo.Checking
-	echo.========
+	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_links          to check all external links for integrity
 	goto EOF
 )
 
-if "%1" == "clean" (
-	for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
-	del /q /s %BUILDDIR%\*
-	goto EOF
-)
-
-
-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/
-	exit /b 1
-)
-
-:sphinx_ok
-
-
 if "%1" == "html" (
 	:html
 	%SPHINXBUILD% -b html %SPHINXOPTS% %SOURCEDIR% %BUILDDIR%/html
@@ -91,24 +77,6 @@
 	goto EOF
 )
 
-if "%1" == "singlehtml" (
-	%SPHINXBUILD% -b singlehtml %SPHINXOPTS% %SOURCEDIR% %BUILDDIR%/singlehtml
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
-	echo.To view, run:
-	echo.  start %BUILDDIR%/singlehtml/index.html
-	goto EOF
-)
-
-if "%1" == "readme" (
-	rst2html5.py readme.rst > build/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" == "latexpdf" (
 	%SPHINXBUILD% -b latex %SPHINXOPTS% %SOURCEDIR% %BUILDDIR%/latex
 	cd %BUILDDIR%/latex
@@ -119,33 +87,25 @@
 	goto EOF
 )
 
-if "%1" == "gettext" (
-	%SPHINXBUILD% -t builder_html -b gettext %SPHINXOPTS% %SOURCEDIR% %BUILDDIR%/locale
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
-	goto EOF
-)
-
-if "%1" == "epub" (
-	%SPHINXBUILD% -b epub %SPHINXOPTS% %SOURCEDIR% %BUILDDIR%/epub
-	if errorlevel 1 exit /b 1
-	echo.
-	echo.Build finished. The epub file is in %BUILDDIR%/epub.
-	goto EOF
-)
-
 if "%1" == "translations" (
 	sphinx-intl build
 	%SPHINXBUILD% -b html -D language='%2' %SPHINXOPTS% %SOURCEDIR% %BUILDDIR%/html
 	if errorlevel 1 exit /b 1
 	echo.
-	echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
+	echo.Build finished. The HTML pages are in %BUILDDIR%/html.
 	echo.To view, run:
 	echo.  start %BUILDDIR%/html/index.html
 	goto EOF
 )
 
+if "%1" == "readme" (
+	rst2html5.py readme.rst > build/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_links" (
 	%SPHINXBUILD% -b linkcheck %SPHINXOPTS% %SOURCEDIR% %BUILDDIR%/linkcheck
 	if errorlevel 1 exit /b 1
@@ -185,8 +145,8 @@
 	DEL rst_check_structure.log
 	goto EOF
 
-	) else (
-	echo.Command not found, type make help for a list of commands. Aborting...
+) else (
+	%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
 	goto EOF
 )
 



More information about the Bf-docboard-svn mailing list