docs: Try to enable parallel reads & writes

Reads still single threaded in Sphinx 1.8.5, though.
This commit is contained in:
Angus Gratton 2019-11-28 16:00:24 +11:00 committed by Angus Gratton
parent d1373119e1
commit cbede3a3a4
8 changed files with 14 additions and 0 deletions

View File

@ -69,6 +69,7 @@ def build_docs(language, target, build_dir):
environ['BUILDDIR'] = build_dir
args = [sys.executable, "-m", "sphinx",
"-j", "auto", # use all the cores! (where possible)
"-b", "html", # TODO: PDFs
"-d", os.path.join(build_dir, "doctrees"),
# TODO: support multiple sphinx-warning.log files, somehow

View File

@ -12,6 +12,8 @@ def setup(app):
# The idf_build_system extension will emit this event once it
app.connect('idf-info', generate_doxygen)
return { 'parallel_read_safe' : True, 'parallel_write_safe': True, 'version': '0.1' }
def _parse_defines(header_path):
defines = {}

View File

@ -45,6 +45,8 @@ def setup(app):
# to create HTML redirects
app.connect('html-collect-pages', create_redirect_pages)
return { 'parallel_read_safe' : True, 'parallel_write_safe': True, 'version': '0.1' }
def create_redirect_pages(app):
if not isinstance(app.builder, StandaloneHTMLBuilder):

View File

@ -26,6 +26,8 @@ def setup(app):
# we want this to run early in the docs build but unclear exactly when
app.connect('env-get-outdated', generate_idf_info)
return { 'parallel_read_safe' : True, 'parallel_write_safe': True, 'version': '0.1' }
def generate_idf_info(app, env, added, changed, removed):
print("Running CMake on dummy project to get build info...")
build_dir = os.path.dirname(app.doctreedir.rstrip(os.sep))

View File

@ -16,3 +16,5 @@ class IncludeBuildFile(BaseInclude, SphinxDirective):
def setup(app):
directives.register_directive('include-build-file', IncludeBuildFile)
return { 'parallel_read_safe' : True, 'parallel_write_safe': True, 'version': '0.1' }

View File

@ -10,6 +10,8 @@ def setup(app):
# has parsed the IDF project's information
app.connect('idf-info', generate_reference)
return { 'parallel_read_safe' : True, 'parallel_write_safe': True, 'version': '0.1' }
def generate_reference(app, project_description):
build_dir = os.path.dirname(app.doctreedir.rstrip(os.sep))

View File

@ -46,6 +46,8 @@ def setup(app):
app.add_role('link_to_translation', crosslink('%s../../%s/{}/%s.html'.format(tag_rev)))
return { 'parallel_read_safe' : True, 'parallel_write_safe': True, 'version': '0.1' }
def autolink(pattern):
def role(name, rawtext, text, lineno, inliner, options={}, content=[]):

View File

@ -7,6 +7,7 @@ from sphinx.util import docname_join
def setup(app):
app.add_directive('toctree', TocTreeFilt, override=True)
return { 'parallel_read_safe' : True, 'parallel_write_safe': True, 'version': '0.1' }
class TocTreeFilt(TocTree):
"""