Open Viech opened 5 years ago
Hi folks: Can I please take the ticket and PR?
Is this ever going to be implemented?
Duplicate of #4319, and overlapping with #9969.
I came here after looking for a way to exclude patterns from a toctree glob too. The documentation says this:
However, I didn't see any exclamation marks in glob_re
here, so I'm unsure if the documentation reflects the reality:
At least it seems that the documentation could be clarified? But I don't understand what globbing syntaxes are supported. I guess the real work is being done in sphinx.util.matching
, which does check for exclamation signs in the pattern.
:glob:
is pretty useful, but it doesn't seem to enable the following:package.[…]
but don't include any documents namedpackage.[…].[…]
.The reverse selection of only including documents that begin with
package
and contain two dots can be made withpackage.*.*
. I triedpackage.[!.]*
but the[!.]
seems to not interact with the*
but only affect a single character.I propose the addition of a
:regex:
option to thetoctree
directive using Python's builtin regex package. It should be relatively easy to implement and work around any shortcomings of:glob:
that users might encounter.