sphinx-doc / sphinx

The Sphinx documentation generator
https://www.sphinx-doc.org/
Other
6.5k stars 2.11k forks source link

Allow use of regex objects in exclude_patterns. #4319

Open Varriount opened 6 years ago

Varriount commented 6 years ago

I am currently working on a project which generates multiple possible documentation sets from one documentation tree, depending on a tag passed on the command line.

For some of the targets (specifically the targets that consist of a single document) Sphinx includes files in the build that aren't being used in the root document (this occurs even with the singlehtml builder). I've attempted to use the exclude_patterns configuration key to work around this, however the glob syntax just doesn't support the kind of pattern matching I need.

My first thought was that the exclude_patterns key should support adding regex objects - this way standard glob strings would still be supported, while also allowing more extensive matching.

tk0miya commented 6 years ago

+0; either is fine to me.

psychemedia commented 1 year ago

The include / exclude behaviour could also be enhanced by allowing include_override and exclude_override behaviours, so a general pattern might be excluded, for example, but a very specific example (that ordinarily matches the excluded pattern) is accepted into the processed docs as a forced override.