sphinx-doc / sphinx-doc/sphinx

Automatic :noindex: for sub-objects

Open
#7,871 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

In my documentation, I list an abridged version of several previously-defined classes. In order to prevent duplicate indexing, I assumed that I would only need one :noindex: for each:

.. class:: State
    :noindex:

    .. attribute:: turn_num
    .. attribute:: our_team
    .. method:: obj_by_coords(coords)

.. class:: Obj
    :noindex:

    .. attribute:: id
    .. attribute:: coords
    .. attribute:: obj_type

...but this produces warnings:

WARNING: duplicate object description of State.our_team, other instance in api, use :noindex: for one of them
WARNING: duplicate object description of State.obj_by_coords, other instance in api, use :noindex: for one of them
etc

The solution is very verbose:

.. class:: State
    :noindex:

    .. attribute:: turn_num
        :noindex:
    .. attribute:: our_team
        :noindex:
    .. method:: obj_by_coords(coords)
        :noindex:

.. class:: Obj
    :noindex:

    .. attribute:: id
        :noindex:
    .. attribute:: coords
        :noindex:
    .. attribute:: obj_type
        :noindex:

It seems to me like it would always make sense to automatically apply :noindex: to all the children of a parent with :noindex:. Am I missing something?

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

No file, test, or entry point is named in the issue. Start by locating how :noindex: is handled for class, attribute, and method directives, then check existing duplicate-object indexing tests. Done means a parent marked :noindex: suppresses indexing warnings for its documented children without requiring repeated options.

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.