oprypin / mkdocs-literate-nav

MkDocs plugin to specify the navigation in Markdown instead of YAML
https://oprypin.github.io/mkdocs-literate-nav
MIT License
73 stars 8 forks source link

nav_file doesn't work with hidden files #4

Open jaklan opened 2 years ago

jaklan commented 2 years ago

Hi, I wanted to use the convention known from mkdocs-awesome-pages plugin to put sub-navs into .pages files:

  - literate-nav:
      nav_file: .pages

Unforunately, it doesn't work. If I rename the file and the config to pages or pages.md - everything is okay, so it's clearly related to hidden files.

oprypin commented 2 years ago

References to relevant code:

https://github.com/oprypin/mkdocs-literate-nav/blob/1b02eb7412666a2150338b78522b205d07f06a8d/mkdocs_literate_nav/plugin.py#L63

https://github.com/mkdocs/mkdocs/blob/1779c181a32b62c89bdfbf888bf7e88a4fce58cf/mkdocs/structure/files.py#L30 https://github.com/mkdocs/mkdocs/blob/1779c181a32b62c89bdfbf888bf7e88a4fce58cf/mkdocs/structure/files.py#L230 https://github.com/mkdocs/mkdocs/blob/1779c181a32b62c89bdfbf888bf7e88a4fce58cf/mkdocs/structure/files.py#L253

Indeed, MkDocs excludes hidden files from the get-go, and mkdocs-literate-nav can't detect such files if it relies on that mechanism.

Thanks for the report. Maybe the implementation for finding the files can be changed.