Best "nav" plugin but Please have Regex/Glob patterns to specify files !
See original GitHub issueTL;DR
Best nav plugin, though it’s missing ability to specify files with Regex OR Glob pattern.
Everything is just beautiful. One thing though I noticed is it’s missing the ability to specify which files to place under a specific section using a regex or glob patterns.
So like the “…” just places anything that hasn’t been specified:
nav:
- section
- ...
… which is very useful ! But also what would be useful is if you could place specific files under a section based on a regular expression or glob pattern:
nav:
- Math:
- 'Math Notes - .+\.md'
- 'Math Notes - *.md'
- Physics:
- 'Physics Notes - .+\.md'
- 'Physics Notes - *.md'
- Exams:
- '**/* Exam - *.md'
Either Regex or Glob patterns, if you can do both even better. I’m not too familiar with what’s possible but just an idea: maybe to differentiate what’s a regular, regex or glob string, you could do kinda like the python format string and have: nothing/ ‘r’ / ‘g’ preprend the string respectively:
nav:
- Math:
- 'Math Notes - Calculus.md'
- r'Math Notes - .+\.md'
- g'Math Notes - *.md'
Probably just getting ahead of myself. But you get the idea. I think the mkdocs-exclude has an implementation of regex/glob patterns.
If you could make that happen that would be amazing ! And make this the most complete “nav” plugin. Thanks in advance. Very grateful for your plugin. 🎩 s off brother.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (5 by maintainers)
Top GitHub Comments
I’ve just released version 2.5.0 with this feature. The syntax I settled on is
... | foo-*.md
(or... | glob=foo-*.md
) for glob patterns and... | regex=foo-[0-9]+.md
for regex. You can find all details in the updated README.@lukasgeiter - I just wanted to send over a million thanks 🙏🙏🙏 for this feature.
This allows for example to hide specific files from the navigation:
I do have
template.md
files which I don’t want to show in navigation, but still want to generate and refer to. Perfect!