mkdocs-literate-nav icon indicating copy to clipboard operation
mkdocs-literate-nav copied to clipboard

No easy way to hide single directory

Open jaklan opened this issue 3 years ago • 2 comments

In mkdocs-awesome-pages, we have two ways to exclude a directory:

  1. we can put a .pages file in the folder with hide: true
  2. 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.

jaklan avatar Oct 03 '21 10:10 jaklan

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).

jaklan avatar Oct 03 '21 12:10 jaklan

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.

oprypin avatar Oct 06 '21 21:10 oprypin