autosectionlabel: Rename confval to autosectionlabel_maxdepth

This commit is contained in:
Takeshi KOMIYA 2019-02-11 18:07:57 +09:00
parent d548bf98f5
commit 4250b197c5
3 changed files with 6 additions and 6 deletions

View File

@ -186,7 +186,7 @@ Features added
* #5924: githubpages: create CNAME file for custom domains when
:confval:`html_baseurl` set
* #4261: autosectionlabel: restrict the labeled sections by new config value;
:confval:`autosectionlabel_max_depth`
:confval:`autosectionlabel_maxdepth`
Bugs fixed

View File

@ -44,8 +44,8 @@ def register_sections_as_label(app, document):
labels = app.env.domaindata['std']['labels']
anonlabels = app.env.domaindata['std']['anonlabels']
for node in document.traverse(nodes.section):
if (app.config.autosectionlabel_max_depth and
get_node_depth(node) > app.config.autosectionlabel_max_depth):
if (app.config.autosectionlabel_maxdepth and
get_node_depth(node) > app.config.autosectionlabel_maxdepth):
continue
labelid = node['ids'][0]
docname = app.env.docname
@ -69,7 +69,7 @@ def register_sections_as_label(app, document):
def setup(app):
# type: (Sphinx) -> Dict[str, Any]
app.add_config_value('autosectionlabel_prefix_document', False, 'env')
app.add_config_value('autosectionlabel_max_depth', None, 'env')
app.add_config_value('autosectionlabel_maxdepth', None, 'env')
app.connect('doctree-read', register_sections_as_label)
return {

View File

@ -71,7 +71,7 @@ def test_autosectionlabel_prefix_document_html(app, status, warning):
@pytest.mark.sphinx('html', testroot='ext-autosectionlabel',
confoverrides={'autosectionlabel_max_depth': 2})
def test_autosectionlabel_max_depth(app, status, warning):
confoverrides={'autosectionlabel_maxdepth': 2})
def test_autosectionlabel_maxdepth(app, status, warning):
return test_autosectionlabel_html(app, status, warning,
skipped_labels=True)