mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #4525 from tk0miya/autosectionlabel_does_not_support_parallel_mode
Fix autosectionlabel does not support parallel build
This commit is contained in:
commit
280d2c79f8
@ -16,8 +16,14 @@ from sphinx.util.nodes import clean_astext
|
|||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
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):
|
def register_sections_as_label(app, document):
|
||||||
|
# type: (Sphinx, nodes.Node) -> None
|
||||||
labels = app.env.domaindata['std']['labels']
|
labels = app.env.domaindata['std']['labels']
|
||||||
anonlabels = app.env.domaindata['std']['anonlabels']
|
anonlabels = app.env.domaindata['std']['anonlabels']
|
||||||
for node in document.traverse(nodes.section):
|
for node in document.traverse(nodes.section):
|
||||||
@ -39,5 +45,12 @@ def register_sections_as_label(app, document):
|
|||||||
|
|
||||||
|
|
||||||
def setup(app):
|
def setup(app):
|
||||||
|
# type: (Sphinx) -> Dict[unicode, Any]
|
||||||
app.add_config_value('autosectionlabel_prefix_document', False, 'env')
|
app.add_config_value('autosectionlabel_prefix_document', False, 'env')
|
||||||
app.connect('doctree-read', register_sections_as_label)
|
app.connect('doctree-read', register_sections_as_label)
|
||||||
|
|
||||||
|
return {
|
||||||
|
'version': 'builtin',
|
||||||
|
'parallel_read_safe': True,
|
||||||
|
'parallel_write_safe': True,
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user