mkdocs-awesome-pages-plugin
mkdocs-awesome-pages-plugin copied to clipboard
mkdocs warns in normal operation when `...` nav entries are present
A portion of my nav in mkdocs.yml looks like:
nav:
- Overview: README.md
- User Guide:
- Introduction: doc/user_guide.md
- ... | src/visualizers-workbench/*
- ... | flat | src/visualizers/*
However, it appears that even when all is well with a setup like this, mkdocs generates
WARNING - A reference to '/... | src/visualizers-workbench/*' is included in
the 'nav' configuration, which is not found in the documentation
files.
WARNING - A reference to '/... | flat | src/visualizers/*' is included in the
'nav' configuration, which is not found in the documentation files.
(we do in fact have pages in both of these directories, and they do show up correctly in the built site). These warnings prevent us from getting the benefit of running with mkdocs build --strict in our test cycle to check for other mkdocs problems.
I thought about trying to switch to using .pages files for generating the nav structure, but our desired navigation hierarchy doesn't correspond too well with our source code file layout, so we are using the mkdocs.yml nav property to do a fair amount of rearranging. Unless I am mistaken, I don't think .pages files can do that.
Is there a way to suppress just the warnings from mkdocs for ... nav lines that awesome-pages is in fact going to fill in? Thanks for any help/pointers.
Aha, I found that I can turn these particular warnings into info messages via
validation:
nav:
omitted_files: info
not_found: info
So that greatly reduces the urgency of this issue. However, I am leaving it open for the moment, because I'd suggest that perhaps there should be a way for mkdocs not to be concerned at all about these patterns at the point where these messages are being generated, but then perform the checks with more teeth after awesome-pages has done its work, so that these could be set back to warn and there would be a doublecheck on awesome-pages behavior.
Perhaps you could set config.validation.nav.not_found (and ...omitted_files) to "ignore" the first time you call mkdocs.structure.nav.get_navigation, and then restore their values, and then when you are done recomputing the navigation layout, call get_navigation again with the original warning settings, just as a check? Just a thought; I'm not really clear on everything that get_navigation does and whether calling it again needlessly except as a check would disrupt the operation of awesome-pages.
We have identified this issue too and it looks like the pages are not included or the WANING is misleading.
It looks also related to https://github.com/lukasgeiter/mkdocs-awesome-pages-plugin/issues/105
This issue is not relevant anymore in the latest version of the plugin. With v3, ... entries are a thing of the past. In fact the plugin ignores the nav in mkdocs.yml entirely.
Please note that the package has been renamed and there are some breaking changes - find out more in the docs.