Merge pull request #4525 from tk0miya/autosectionlabel_does_not_support_parallel_mode

Fix autosectionlabel does not support parallel build
This commit is contained in:
Takeshi KOMIYA 2018-01-30 23:03:55 +09:00 committed by GitHub
commit 280d2c79f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,8 +16,14 @@ from sphinx.util.nodes import clean_astext
logger = logging.getLogger(__name__)
if False:
# For type annotation
from typing import Any, Dict # NOQA
from sphinx.application import Sphinx # NOQA
def register_sections_as_label(app, document):
# type: (Sphinx, nodes.Node) -> None
labels = app.env.domaindata['std']['labels']
anonlabels = app.env.domaindata['std']['anonlabels']
for node in document.traverse(nodes.section):
@ -39,5 +45,12 @@ def register_sections_as_label(app, document):
def setup(app):
# type: (Sphinx) -> Dict[unicode, Any]
app.add_config_value('autosectionlabel_prefix_document', False, 'env')
app.connect('doctree-read', register_sections_as_label)
return {
'version': 'builtin',
'parallel_read_safe': True,
'parallel_write_safe': True,
}