From 31e3bbe614414bce632bb27f8e1e78e728b5f213 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Tue, 7 May 2024 18:07:45 +0900 Subject: [PATCH 1/2] gh-118689: fix ePub build --- Doc/library/allos.rst | 1 - Doc/tools/extensions/glossary_search.py | 2 +- Doc/tools/templates/layout.html | 2 ++ 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Doc/library/allos.rst b/Doc/library/allos.rst index f7105d8af8e28b..0223c1054ea5d8 100644 --- a/Doc/library/allos.rst +++ b/Doc/library/allos.rst @@ -16,7 +16,6 @@ but they are available on most other systems as well. Here's an overview: io.rst time.rst argparse.rst - getopt.rst logging.rst logging.config.rst logging.handlers.rst diff --git a/Doc/tools/extensions/glossary_search.py b/Doc/tools/extensions/glossary_search.py index 59a6862ea3d3f4..232782093926f6 100644 --- a/Doc/tools/extensions/glossary_search.py +++ b/Doc/tools/extensions/glossary_search.py @@ -20,7 +20,7 @@ def process_glossary_nodes(app, doctree, fromdocname): - if app.builder.format != 'html': + if app.builder.format != 'html' or app.builder.embedded: return terms = {} diff --git a/Doc/tools/templates/layout.html b/Doc/tools/templates/layout.html index 3c12b01b558f83..e931147813ae03 100644 --- a/Doc/tools/templates/layout.html +++ b/Doc/tools/templates/layout.html @@ -42,6 +42,7 @@ {{ super() }} +{%- if not embedded %} +{%- endif %} {% endblock %} From 4d326d7f5117d323c7ee81058395b5853e9a1d10 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Tue, 7 May 2024 20:29:38 +0900 Subject: [PATCH 2/2] do not generate index for ePub --- Doc/conf.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Doc/conf.py b/Doc/conf.py index 86371d17ae742a..0e86de837d35d2 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -435,6 +435,10 @@ epub_author = 'Python Documentation Authors' epub_publisher = 'Python Software Foundation' +# index pages are not valid xhtml +# https://github.com/sphinx-doc/sphinx/issues/12359 +epub_use_index = False + # Options for the coverage checker # --------------------------------