sphinx-doc / sphinx-doc/sphinx
Change starting number for toctree :numbered: option
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8k
- Forks
- 2.6k
- PR merge metrics
- No merged PRs in 30d
Description
Is your feature request related to a problem? Please describe.
I'm trying to create a table of contents, split into two parts, like so:
.. toctree::
:maxdepth: 2
:numbered:
:caption: Part 1
chapter-1
chapter-2
.. toctree::
:maxdepth: 2
:numbered:
:caption: Part 2
chapter-3
chapter-4
What I get is:

What I'd like is:

Describe the solution you'd like
Either the ability to continue numbering from other toctrees, or (probably easier and would work just fine) the ability to set a flag e.g.
.. toctree::
:maxdepth: 2
:numbered:
:caption: Part 2
:start-from: 3
chapter-3
chapter-4
Describe alternatives you've considered
moving the two toctrees into one toctree, or typing the numbering manually
Additional context
NIL
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the implementation and tests for the toctree directive's :numbered: option; no specific files or tests are named in the issue. Compare the two example layouts and determine how a second toctree could begin at a requested number, then add coverage showing the expected numbering for Part 2.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100