Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mkdocs warns in normal operation when ... nav entries are present #107

Open
gwhitney opened this issue Sep 16, 2024 · 2 comments
Open

mkdocs warns in normal operation when ... nav entries are present #107

gwhitney opened this issue Sep 16, 2024 · 2 comments

Comments

@gwhitney
Copy link

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.

@gwhitney
Copy link
Author

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.

@andboss
Copy link

andboss commented Sep 19, 2024

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 #105

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants