[Bf-docboard-svn] bf-manual: [8151] trunk/blender_docs: Makefile: Remove Support for quickly building chapters
Aaron Carlisle
noreply at blender.org
Tue Jun 22 02:06:44 CEST 2021
Revision: 8151
https://developer.blender.org/rBM8151
Author: Blendify
Date: 2021-06-22 02:06:44 +0200 (Tue, 22 Jun 2021)
Log Message:
-----------
Makefile: Remove Support for quickly building chapters
Now that sphinx has better multiprocessing support (on linux)
this feature is no longer needed and overcomplicates things.
Modified Paths:
--------------
trunk/blender_docs/Makefile
trunk/blender_docs/manual/about/contribute/build/linux.rst
trunk/blender_docs/manual/about/contribute/build/macos.rst
trunk/blender_docs/manual/conf.py
Removed Paths:
-------------
trunk/blender_docs/manual/quicky_index_gen.py
Modified: trunk/blender_docs/Makefile
===================================================================
--- trunk/blender_docs/Makefile 2021-06-21 23:13:02 UTC (rev 8150)
+++ trunk/blender_docs/Makefile 2021-06-22 00:06:44 UTC (rev 8151)
@@ -14,25 +14,9 @@
SPHINXOPTS ?= -j auto -D language='$(BF_LANG)'
LATEXOPTS ?= "-interaction nonstopmode"
-# full paths
-CHAPTERS_FULL:=$(filter %/, $(wildcard manual/*/))
-# names only
-CHAPTERS:=$(notdir $(sort $(CHAPTERS_FULL:%/=%)))
-# intersect make goals and possible chapters
-QUICKY_CHAPTERS=$(filter $(MAKECMDGOALS),$(CHAPTERS))
-# Remove chapters from command line arguments.
-CMD_ARGS_WITHOUT_CHAPTERS=$(filter-out $(CHAPTERS),$@)
-
# -----------------------
# for echoing output only
-ifeq ($(QUICKY_CHAPTERS), )
- CONTENTS_HTML="index.html"
-else
- CONTENTS_HTML="contents_quicky.html"
-endif
-
-# os specific
ifeq ($(OS), Darwin)
# OSX
OPEN_CMD="open"
@@ -74,12 +58,10 @@
# --------------------
livehtml:
- @QUICKY_CHAPTERS=$(QUICKY_CHAPTERS) \
- sphinx-autobuild --open-browser --delay 0 "$(SOURCEDIR)" "$(BUILDDIR)/html" $(SPHINXOPTS) $(O)
+ @sphinx-autobuild --open-browser --delay 0 "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
latexpdf: .SPHINXBUILD_EXISTS
- @QUICKY_CHAPTERS=$(QUICKY_CHAPTERS) \
- $(SPHINXBUILD) -M latexpdf "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
+ @$(SPHINXBUILD) -M latexpdf "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@make -C "$(BUILDDIR)/latex" LATEXOPTS="-interaction nonstopmode"
@echo "To view, run:"
@echo " "$(OPEN_CMD) $(shell pwd)"/$(BUILDDIR)/latex/blender_manual.pdf"
@@ -129,14 +111,11 @@
@echo "=============="
@echo "Convenience targets provided for building docs"
@echo ""
- @echo "- livehtml (default) to auto build on file changes and host on localhost"
+ @echo "- livehtml to auto build on file changes on host on localhost"
@echo "- epubpdf to convert an epub file to pdf"
@echo "- readme to make a 'readme.html' file"
@echo "- clean to delete all old build files"
@echo ""
- @echo "Chapters to quickly build a single chapter"
- @$(foreach ch,$(CHAPTERS),echo "- "$(ch);)
- @echo ""
@echo "Translations"
@echo "------------"
@echo ""
@@ -155,11 +134,5 @@
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
-#
-# $(CMD_ARGS_WITHOUT_CHAPTERS) is used so building single chapters doesn't interfere
-# with sphinx arguments.
%: Makefile .SPHINXBUILD_EXISTS
- @if [ -n "$(CMD_ARGS_WITHOUT_CHAPTERS)" ]; then \
- QUICKY_CHAPTERS=$(QUICKY_CHAPTERS) \
- $(SPHINXBUILD) -M $(CMD_ARGS_WITHOUT_CHAPTERS) "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O); \
- fi
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
Modified: trunk/blender_docs/manual/about/contribute/build/linux.rst
===================================================================
--- trunk/blender_docs/manual/about/contribute/build/linux.rst 2021-06-21 23:13:02 UTC (rev 8150)
+++ trunk/blender_docs/manual/about/contribute/build/linux.rst 2021-06-22 00:06:44 UTC (rev 8151)
@@ -26,22 +26,7 @@
The building process may take several minutes the first time (or after any major changes),
but for subsequent changes it should only take a few seconds.
-Now that you are able to build the manual, the next paragraph is about an optional quick build.
-
-Building a Single Chapter
-=========================
-
-If you are working on a specific chapter of the manual, you can build it quickly using::
-
- make <chapter name>
-
-For example, to build only the documentation for the modifiers, use ``make modeling``.
-You can then view this quick build by opening :file:`build/html/contents_quicky.html`.
-
-This will build very quickly, but it will mean your next complete build of all the chapters will be slow.
-
-
------------------------
Continue with the next step: :doc:`Editing </about/contribute/editing>`.
Modified: trunk/blender_docs/manual/about/contribute/build/macos.rst
===================================================================
--- trunk/blender_docs/manual/about/contribute/build/macos.rst 2021-06-21 23:13:02 UTC (rev 8150)
+++ trunk/blender_docs/manual/about/contribute/build/macos.rst 2021-06-22 00:06:44 UTC (rev 8151)
@@ -26,22 +26,7 @@
The building process may take several minutes the first time (or after any major changes),
but for subsequent changes it should only take a few seconds.
-Now that you are able to build the manual, the next paragraph is about an optional quick build.
-
-Building a Single Chapter
-=========================
-
-If you are working on a specific chapter of the manual, you can build it quickly using::
-
- make <chapter name>
-
-For example, to build only the documentation for the modifiers, use ``make modeling``.
-You can then view this quick build by opening :file:`build/html/contents_quicky.html`.
-
-This will build very quickly, but it will mean your next complete build of all the chapters will be slow.
-
-
------------------------
Continue with the next step: :doc:`Editing </about/contribute/editing>`.
Modified: trunk/blender_docs/manual/conf.py
===================================================================
--- trunk/blender_docs/manual/conf.py 2021-06-21 23:13:02 UTC (rev 8150)
+++ trunk/blender_docs/manual/conf.py 2021-06-22 00:06:44 UTC (rev 8151)
@@ -78,28 +78,6 @@
# The master toctree document.
master_doc = 'index'
-if os.environ.get('QUICKY_CHAPTERS') is None:
- exclude_patterns = ["contents_quicky.rst"]
- master_doc = 'index'
-else:
- # Call quicky_index_gen.from_chapters()
- # and use the QUICKY_CHAPTERS env var if its set
-
- def exec_file(fn):
- code = compile(open(fn, 'r').read(), fn, 'exec')
- namespace = {"__file__": fn}
- exec(code, namespace, namespace)
- return namespace
-
- mod_path = os.path.join(os.path.dirname(__file__), "quicky_index_gen.py")
- namespace = exec_file(mod_path)
- del mod_path
-
- master_doc, exclude_patterns = namespace["from_chapters"]()
- del namespace
-
-print("Using Index:", master_doc)
-
# General information about the project.
project = 'Blender %s Manual' % blender_version
copyright = ': This page is licensed under a CC-BY-SA 4.0 Int. License'
@@ -132,7 +110,7 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
-exclude_patterns += ['_build']
+# exclude_patterns = ['_build']
# The reST default role (used for this markup: `text`) to use for all
# documents.
Deleted: trunk/blender_docs/manual/quicky_index_gen.py
===================================================================
--- trunk/blender_docs/manual/quicky_index_gen.py 2021-06-21 23:13:02 UTC (rev 8150)
+++ trunk/blender_docs/manual/quicky_index_gen.py 2021-06-22 00:06:44 UTC (rev 8151)
@@ -1,82 +0,0 @@
-# Apache License, Version 2.0
-
-"""
-Script to create a partial contents, for generating partial chapters.
-
-Called from conf.py
-"""
-
-# Note, keep Python2 & 3 Compatible
-import os
-
-CURRENT_DIR = os.path.abspath(os.path.dirname(__file__))
-
-def from_chapters():
- """
- Return conf.py: (master_doc, exclude_patterns) values.
- """
-
- master_doc = "index"
- exclude_patterns = []
-
- quicky_chapters = [c for c in os.environ.get('QUICKY_CHAPTERS', "").strip(":").split(":") if c]
- if not quicky_chapters:
- exclude_patterns.append("contents_quicky.rst")
- return master_doc, exclude_patterns
-
- master_doc = "contents_quicky"
-
- fn_src = os.path.join(CURRENT_DIR, "index.rst")
- fn_dst = os.path.join(CURRENT_DIR, "contents_quicky.rst")
-
- f = open(fn_src, 'r')
- data = f.read()
- f.close()
- del f
-
- lines = data.split("\n")
-
- lines_new = []
- for l in lines:
- l_orig = l
-
- # Extract the identifier
- # world/index.rst --> world
- # world.rst --> world
-
- l = l.strip()
- if l.endswith(".rst"):
- l = l[:-4]
- if l.endswith("/index"):
- l = l.rsplit("/", 1)[0]
- # Now we have an identifier
- if l not in quicky_chapters:
- # print(" skipping:", l_orig.strip())
- continue
- # print(" using:", l_orig.strip())
- lines_new.append(l_orig)
-
- data = "\n".join(lines_new)
-
- f = open(fn_dst, 'w')
- f.write(data)
- f.close()
- del f
-
- # now exclude all dirs not in chapters
- exclude_patterns.append("contents.rst")
- for fn in os.listdir(CURRENT_DIR):
- if os.path.isdir(os.path.join(CURRENT_DIR, fn)):
- if fn not in quicky_chapters:
- # print(" exclude:", fn)
- exclude_patterns.append(fn)
- else:
- if fn in ("contents_quicky.rst",):
- continue
-
- if fn.endswith(".rst"):
- if fn[:-4] not in quicky_chapters:
- exclude_patterns.append(fn)
-
-
- return master_doc, exclude_patterns
More information about the Bf-docboard-svn
mailing list