mkdocs-literate-nav
mkdocs-literate-nav copied to clipboard
No easy way to hide single directory
In mkdocs-awesome-pages
, we have two ways to exclude a directory:
- we can put a
.pages
file in the folder withhide: true
- in the parent folder, we can put a
.pages
file like:
nav:
- ... | *.md
- another-subdir-to-include
To get sth similar with mkdocs-literate-nav
, we need to create a SUMMARY.md
file like:
- *.md
- [Another subdir to include](another-subdir-to-include/)
This doesn't work:
- *.md
- another-subdir-to-include/
Error:
The problematic item:
<li>another-subdir-to-include/</li>
Afaik - there's no equivalent of hide: true
, and also writing a sub-dir nav is not as smooth, because you need to specify all the titles for sub-dirs you want to include, which is quite redundant.
I see there's some workaround:
- *.md
- another-sub*dir-to-include/
This actually works. Note the asterisk - it can be placed in whatever place. But anyway, it should also work without it, because using the asterisk can lead to some unexpected results (imagine you have such folders: subdir
, subsubdir
, subdir2
and you want to include only subdir
: all combinations like sub*dir/
, subdir*/
*subdir/
would fail).
It seems that this report boils down to the overall fact that mkdocs-literate-nav simply doesn't let you omit the title of anything. The overall philosophy is that the literate nav remains as a readable Markdown document itself, and that's also the original rationale. But yes, with the whole thing with wildcards being available, that philosophy isn't satisfiable anymore anyway, so maybe this can be reconsidered.