oprypin / mkdocs-gen-files

MkDocs plugin to programmatically generate documentation pages during the build
https://oprypin.github.io/mkdocs-gen-files
MIT License
107 stars 10 forks source link

Interaction bug with mkdocs-awesome-pages if you edit all the *md files in a directory #26

Open nphilbrook opened 1 year ago

nphilbrook commented 1 year ago

I am using both this plugin and https://github.com/lukasgeiter/mkdocs-awesome-pages-plugin

As part of that plugin, many of our directories have .pages files in them containing metadata for the plugin to build the nav.

If I happen to use gen-files to edit all of the .md files in one of these directories, then awesome-pages can no longer read the .pages file in that same directory. Example error message:

INFO     -  NavEntryNotFound: Nav entry "howto" not found. [/home/nphilbrook/repos/<REDACTED>/.pages]
              File "/usr/local/lib/python3.10/dist-packages/mkdocs_awesome_pages_plugin/navigation.py", line 127, in _nav
                result = _make_nav_rec(meta.nav)
              File "/usr/local/lib/python3.10/dist-packages/mkdocs_awesome_pages_plugin/navigation.py", line 124, in _make_nav_rec
                warnings.warn(warning)

If I only edit some of the .md files in this directory, awesome-pages works as expected.

I have been skimming the source code to see if I can spot the bug easily, but ran out of time. Something about the way the gen-files 'virtual' directory is interacting with mkdocs and awesome-pages.

nphilbrook commented 1 year ago

Just a note I did confirm I am on the latest version 0.4.0