diff --git a/CHANGES b/CHANGES index 1319812cf..ea66aadb4 100644 --- a/CHANGES +++ b/CHANGES @@ -99,6 +99,7 @@ Features added * #6306: html: Add a label to search form for accessability purposes * #6358: The ``rawsource`` property of ``production`` nodes now contains the full production rule +* #6373: Allow suppression of autosectionlabel warnings Bugs fixed ---------- diff --git a/doc/usage/configuration.rst b/doc/usage/configuration.rst index 31a9e0d1c..f411abb1c 100644 --- a/doc/usage/configuration.rst +++ b/doc/usage/configuration.rst @@ -296,25 +296,26 @@ General configuration Sphinx supports following warning types: - * app.add_node - * app.add_directive - * app.add_role - * app.add_generic_role - * app.add_source_parser - * download.not_readable - * image.not_readable - * ref.term - * ref.ref - * ref.numref - * ref.keyword - * ref.option - * ref.citation - * ref.footnote - * ref.doc - * ref.python - * misc.highlighting_failure - * toc.secnum - * epub.unknown_project_files + * ``app.add_node`` + * ``app.add_directive`` + * ``app.add_role`` + * ``app.add_generic_role`` + * ``app.add_source_parser`` + * ``download.not_readable`` + * ``image.not_readable`` + * ``ref.term`` + * ``ref.ref`` + * ``ref.numref`` + * ``ref.keyword`` + * ``ref.option`` + * ``ref.citation`` + * ``ref.footnote`` + * ``ref.doc`` + * ``ref.python`` + * ``misc.highlighting_failure`` + * ``toc.secnum`` + * ``epub.unknown_project_files`` + * ``autosectionlabel.*`` You can choose from these types. @@ -334,6 +335,10 @@ General configuration Added ``ref.footnote`` + .. versionchanged:: 2.1 + + Added ``autosectionlabel.*`` + .. confval:: needs_sphinx If set to a ``major.minor`` version string like ``'1.1'``, Sphinx will diff --git a/sphinx/ext/autosectionlabel.py b/sphinx/ext/autosectionlabel.py index de46cec52..3d55ad749 100644 --- a/sphinx/ext/autosectionlabel.py +++ b/sphinx/ext/autosectionlabel.py @@ -55,7 +55,7 @@ def register_sections_as_label(app, document): if name in labels: logger.warning(__('duplicate label %s, other instance in %s'), name, app.env.doc2path(labels[name][0]), - location=node) + location=node, type='autosectionlabel', subtype=docname) anonlabels[name] = docname, labelid labels[name] = docname, labelid, sectname