Skip to content

Add chapter numbers to Jupyter Book#39

Merged
rickecon merged 2 commits into
PSLmodels:masterfrom
jdebacker:jb_numbers
May 20, 2026
Merged

Add chapter numbers to Jupyter Book#39
rickecon merged 2 commits into
PSLmodels:masterfrom
jdebacker:jb_numbers

Conversation

@jdebacker
Copy link
Copy Markdown
Member

Summary

This PR updates the book structure so chapter numbering is generated automatically from the Jupyter Book / MyST table of contents, without hardcoding numbers into page titles.

What changed

  • enabled project-level title numbering in book/myst.yml
  • disabled numbering on the landing page in book/content/intro.md
  • converted each top-level TOC part into a real page with its own short introduction:
    • book/content/background/index.md
    • book/content/using/index.md
    • book/content/repomgt/index.md
    • book/content/txteditor/index.md
    • book/content/appendix/index.md
  • updated the TOC so those part pages act as the numbered top-level chapters and existing content pages are nested beneath them

Result

The numbering now behaves as follows:

  • the title page is unnumbered
  • top-level book parts are numbered 1, 2, 3, ...
  • pages within each part are numbered as child chapters, for example 2.1, 2.2, ...
  • numbers are generated from the TOC and will automatically update if pages are moved, inserted, or removed

Example

The book now renders part/chapter numbering in the style below:

  • 1 Git and GitHub Background and History
  • 2 Using Git and GitHub
  • 2.1 Installing Git
  • 2.5 Git and GitHub Collaborative Workflow
  • 3 Open Source Repository Management

Notes

  • This change introduces dedicated landing pages for each major TOC part, which currently use routes such as /index-1, /index-2, etc.
  • The numbering behavior is now driven entirely by the book configuration and TOC structure rather than manual text edits.

Addresses Issue #16

@rickecon rickecon merged commit 25bd662 into PSLmodels:master May 20, 2026
1 check passed
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.

2 participants