sphinx icon indicating copy to clipboard operation
sphinx copied to clipboard

Make toctree accept 'genindex', 'modindex' and 'search' docnames

Open brechtm opened this issue 3 years ago • 2 comments

Subject: Make toctree accept 'genindex', 'modindex' and 'search' docnames

Feature or Bugfix

Bugfix

Relates

Fixes #8438

brechtm avatar Jul 16 '22 19:07 brechtm

The PR works when building a project, but there's obviously still something missing. I'll need to look into the failing tests...

brechtm avatar Jul 16 '22 20:07 brechtm

I have some questions on how to continue with this:

  1. Should this target master or 0.5?
  2. mypy: sphinx/environment/adapters/toctree.py:142:51: error: "Domain" has no attribute "labels"; maybe "label"? [attr-defined] Domain definitely has a labels attribute, but perhaps not at object initialization time. Can this be somehow flagged for mypy to ignore this?

brechtm avatar Jul 18 '22 23:07 brechtm

Is there anything I can do at this point? Thanks!

brechtm avatar Sep 08 '22 08:09 brechtm

mypy: sphinx/environment/adapters/toctree.py:142:51: error: "Domain" has no attribute "labels"; maybe "label"? [attr-defined]

Domain definitely has a labels attribute, but perhaps not at object initialization time. Can this be somehow flagged for mypy to ignore this?

Add # type: ignore[attr-defined] as a quick fix.

A

AA-Turner avatar Sep 08 '22 12:09 AA-Turner

Looks good, I updated the implementation so as not to hard-code the "special" in more places. The only open question is the glob behaviour (see linked issue).

A

AA-Turner avatar Sep 09 '22 08:09 AA-Turner

Thanks @brechtm!

A

AA-Turner avatar Sep 12 '22 19:09 AA-Turner

Many thanks, @AA-Turner, for bringing this to completion!

brechtm avatar Sep 15 '22 07:09 brechtm