sphinx-doc / sphinx-doc/sphinx

ignore duplicated labels in autosectionlabel extension

Open
#7,697 10 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

extensions:autosectionlabel type:enhancement
Dominant language
Python
Stars
8k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

When having duplicated section titles in the same file the autosectionlabel extension print a warning but adds the label anyway overriding the old one.

In this situation I think it would be better to simply not add labels for duplicated sections. In this way a user can define its own labels for that problematic sections avoiding inconsistencies.

This behaviour can be optionally enabled by a configuration option of the autosectionlabel extension.

If you want I can submit a PR.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the autosectionlabel extension and the code that emits a warning for duplicated section titles. Review how extension configuration is defined and how its existing tests cover duplicate sections. Done means duplicated sections no longer override an existing label when the requested option is enabled, while the current behavior remains available otherwise.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.