sphinx-doc / sphinx-doc/sphinx
`:number-lines: 0` for includes does not work correctly with docutils 0.22
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8k
- Forks
- 2.6k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
Because of this change: https://github.com/live-clones/docutils/commit/f39ac1413e56a330c8fea6e0d080fed0ff2b8483
.. include:: ...
:code: python
:number-lines: 0
.. include:: ...
:literal:
:number-lines: 0
Now numbering starts at 1 rather than 0
This is because the value parsed from the directive option has now changed from a None|str to None|int,
previously int("0" or 1) turned into 0, but now 0 or 1 turns into 1
How to Reproduce
...
Environment Information
...
Sphinx extensions
Additional context
No response
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 tracing how the include directive handles the :number-lines: option with docutils 0.22. Reproduce the two examples from the issue, then add or update a regression test confirming that :number-lines: 0 starts numbering at zero for both code and literal includes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100