Skip to content

gh-57491: Reduce the EPUB table of contents depth to 2 - #158105

Merged
hugovk merged 1 commit into
python:mainfrom
Danishk2445:gh-57491-epub-tocdepth
Sep 26, 2026
Merged

hugovk merged 1 commit into
python:mainfrom
Danishk2445:gh-57491-epub-tocdepth

Conversation

@Danishk2445

@Danishk2445 Danishk2445 commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Set epub_tocdepth = 2 in Doc/conf.py, as @m-aciek suggested in the issue.

With Sphinx's default depth of 3, the EPUB table of contents has 1,516 entries. 1,328 of them are third-level, including every section of every "What's New" document. With depth 2 it has 188 entries. Every "What's New" version and every standard library category is still listed, and the pages under them are one step away through each chapter's own contents.

Tested with make -C Doc epub: the build passes with --fail-on-warning, and epubcheck plus Doc/tools/check-epub.py report no new errors. Since this is only a config change, it may be worth backporting, as @merwok suggested.

@python-cla-bot

python-cla-bot Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #34741034 | 📁 Comparing 1f45dc0 against main (0b72907)

  🔍 Preview build  

1 file changed
± whatsnew/changelog.html

@m-aciek m-aciek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, thank you! Could you attach a screenshot for before/after changes for a first (two?) page(s) of table of contents?

@StanFromIreland

StanFromIreland commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Seems fine to me too, but yes, please share some screenshots.

@Danishk2445

Copy link
Copy Markdown
Contributor Author

Thanks for the reviews. Here are the before and after screenshots of the first two pages of the table of contents:
epub-toc-page1
epub-toc-page2

@hugovk hugovk added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Sep 26, 2026
@hugovk
hugovk merged commit 5eb4ab5 into python:main Sep 26, 2026
47 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @Danishk2445 for the PR, and @hugovk for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Sep 26, 2026

Copy link
Copy Markdown

GH-158249 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Sep 26, 2026
@bedevere-app

bedevere-app Bot commented Sep 26, 2026

Copy link
Copy Markdown

GH-158250 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Sep 26, 2026
@bedevere-app

bedevere-app Bot commented Sep 26, 2026

Copy link
Copy Markdown

GH-158251 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Sep 26, 2026
hugovk pushed a commit that referenced this pull request Sep 26, 2026
) (#158251)

Co-authored-by: Danishk2445 <143554875+Danishk2445@users.noreply.github.com>
hugovk pushed a commit that referenced this pull request Sep 26, 2026
) (#158249)

Co-authored-by: Danishk2445 <143554875+Danishk2445@users.noreply.github.com>
hugovk pushed a commit that referenced this pull request Sep 26, 2026
) (#158250)

Co-authored-by: Danishk2445 <143554875+Danishk2445@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants