summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Grainger <tagrain@gmail.com>2020-10-05 09:29:16 +0100
committerThomas Grainger <tagrain@gmail.com>2020-10-05 09:29:16 +0100
commit3eecf133d8a8af2f22f6f122d3245a1e2db940eb (patch)
treee1c8ef12ebd566b938a62a87435493f96513b3b3
parenta8abb9995f71b9bc02b6f83592751c779ae0f75a (diff)
downloadsphinx-git-3eecf133d8a8af2f22f6f122d3245a1e2db940eb.tar.gz
Fix #8289: Allow to suppress "duplicated ToC entry found" warnings from epub builder
-rw-r--r--CHANGES2
-rw-r--r--doc/usage/configuration.rst6
-rw-r--r--sphinx/builders/_epub_base.py7
3 files changed, 14 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index 600efc466..e9a6220bf 100644
--- a/CHANGES
+++ b/CHANGES
@@ -26,6 +26,8 @@ Features added
just before writing .tex file
* #7996: manpage: Add :confval:`man_make_section_directory` to make a section
directory on build man page
+* #8289: Allow to suppress "duplicated ToC entry found" warnings from epub builder
+ using :confval:`suppress_warnings`.
Bugs fixed
----------
diff --git a/doc/usage/configuration.rst b/doc/usage/configuration.rst
index 270fcbf33..1cda6a055 100644
--- a/doc/usage/configuration.rst
+++ b/doc/usage/configuration.rst
@@ -316,6 +316,7 @@ General configuration
* ``toc.circular``
* ``toc.secnum``
* ``epub.unknown_project_files``
+ * ``epub.duplicated_toc_entry``
* ``autosectionlabel.*``
You can choose from these types.
@@ -340,6 +341,11 @@ General configuration
Added ``autosectionlabel.*``
+
+ .. versionchanged:: 3.3.0
+
+ Added ``epub.duplicated_toc_entry``
+
.. confval:: needs_sphinx
If set to a ``major.minor`` version string like ``'1.1'``, Sphinx will
diff --git a/sphinx/builders/_epub_base.py b/sphinx/builders/_epub_base.py
index 95f9ab8ed..b126182e9 100644
--- a/sphinx/builders/_epub_base.py
+++ b/sphinx/builders/_epub_base.py
@@ -208,7 +208,12 @@ class EpubBuilder(StandaloneHTMLBuilder):
appeared = set() # type: Set[str]
for node in nodes:
if node['refuri'] in appeared:
- logger.warning(__('duplicated ToC entry found: %s'), node['refuri'])
+ logger.warning(
+ __('duplicated ToC entry found: %s'),
+ node['refuri'],
+ type="epub",
+ subtype="duplicated_toc_entry",
+ )
else:
appeared.add(node['refuri'])