You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to disable navigation warning? I mean this message:
The following pages exist in the docs directory, but are not included in the "nav" configuration:
Reacted by Oleh Prypin, Hash, Carson Lam, Kyle Gerard Felker, Micael Jarniac and LinasKo
That is an "info" message, not a warning. The only benefit to disabling it from being displayed it that it is not displayed. In other words, it does not cause "strict" mode to fail, for example.
Interestingly, some have requested the opposite (see #1755).
I guess I'll consider this a request for a "quiet" option. To be clear, if we adding this option, it would disable the display of all "info" messages, not just the list of pages not included in the nav.
It would be useful to be able to mark a page as intentionally not included in the nav. When new people contribute to the docs they don't know which pages are intentionally excluded and which may have been missed by accident.
Reacted by Oleh Prypin, k2s, Steve Baker, Jim Finnis, Nico MASSART, Jakub Beránek, Manuel Kaufmann, Kyle Gerard Felker, tmerker, Fedello and 2 more
I have bunch of files repoted as warning since one plugin keeps internal stuff in the docs structure. Its houndreeds of warnings like this:
I know about those, and it must be that way, so all this warning does is spam other output. Ideally I would be able to say that there should be no warning for path /db/*.
@oprypin , its effectivelly the same problem - warning spam. Its IMO irrevelant what is the precise reason.
That's just the plugins fault. If you want help fixing it, you can point me to the issue.
Its not plugins fault, its the way I use it, and it works great. In short, some pages describing the database automatically look for sql definition and txt examples in a same folder where md page is located and adds links to those files to the md page (also adding content to the md page). Except for huge amount of warnings there is absolutelly no reason to move those sql and txt files to other place.
The warning is also incorrect and possibly even a bug - files are found among documentation.
But I digress, the issue is warning spam, when you know the warnings are irrelevant. Majority of systems allow for disabling specific or all of the warnings.
I am not dismissing that these warnings should be able to be silenced. I'll handle that in the upcoming months.
That is great, thanks.
Yes, it's a bug in the plugin. It will be there regardless if you're able to silence all warnings.
I don't think that is the case. Plugin I use is mkdocs-macros that lets me, among other things, use python to create functions which I can use on md pages via jinja templates. This is the macro I wrote which creates this problem.
I have 3 files X.md, X.sql, X.txt, each in the same folder inside the docs folder. The md page describes a database table and X.sql contas DDL while X.txt contains data sample.
My only problem with this is that some files are not linked from nav, like the contacts page is linked in the footer and posts in a blog are handled by the plugin, I don't want to have a flood of lots files not in nav because they simply shouldn't be there.
So, if I don't miss something, would be nice to have a "not_in_nav" setting that can be configured with both files and directories (glob), like "the files in this list and these directories are known to be handled somewhere else".
@oprypin , while this probably helps with the warning, it is because files are now not built at all? Or am I missing something?
In my case, I do build files, they are just not in nav, and since I have lots of them not in nav, I have lots of warnings. So the issue is warning for the files to be built, not the exlusions of such files.
I had similar issue. If you have many pages that you don't include in nav section I created a simple plugin to exclude all .md files that are not mentioned in nav section.
Activity
waylan commentedon Oct 20, 2019
That is an "info" message, not a warning. The only benefit to disabling it from being displayed it that it is not displayed. In other words, it does not cause "strict" mode to fail, for example.
Interestingly, some have requested the opposite (see #1755).
I guess I'll consider this a request for a "quiet" option. To be clear, if we adding this option, it would disable the display of all "info" messages, not just the list of pages not included in the nav.
isedwards commentedon Mar 31, 2021
It would be useful to be able to mark a page as intentionally not included in the nav. When new people contribute to the docs they don't know which pages are intentionally excluded and which may have been missed by accident.
NicolasMassart commentedon Jul 21, 2022
I'd like that as for me, the root
index.mdat least should not raise a warning as I don't need it in the nav...majkinetor commentedon Sep 24, 2022
I have similar warning I want to hide.
I have bunch of files repoted as warning since one plugin keeps internal stuff in the docs structure. Its houndreeds of warnings like this:
I know about those, and it must be that way, so all this warning does is spam other output. Ideally I would be able to say that there should be no warning for path
/db/*.oprypin commentedon Sep 24, 2022
oprypin commentedon Sep 24, 2022
majkinetor commentedon Sep 24, 2022
@oprypin , its effectivelly the same problem - warning spam. Its IMO irrevelant what is the precise reason.
Its not plugins fault, its the way I use it, and it works great. In short, some pages describing the database automatically look for sql definition and txt examples in a same folder where md page is located and adds links to those files to the md page (also adding content to the md page). Except for huge amount of warnings there is absolutelly no reason to move those sql and txt files to other place.
The warning is also incorrect and possibly even a bug - files are found among documentation.
But I digress, the issue is warning spam, when you know the warnings are irrelevant. Majority of systems allow for disabling specific or all of the warnings.
oprypin commentedon Sep 24, 2022
majkinetor commentedon Sep 24, 2022
That is great, thanks.
I don't think that is the case. Plugin I use is mkdocs-macros that lets me, among other things, use python to create functions which I can use on md pages via jinja templates. This is the macro I wrote which creates this problem.
I have 3 files X.md, X.sql, X.txt, each in the same folder inside the
docsfolder. The md page describes a database table and X.sql contas DDL while X.txt contains data sample.In
main.pythat macros plugin lets me use:In X.md
# X ... {{ inc( page, 'sql', 'SQL') }} {{ inc( page, 'txt', 'Data Example') }}So this is mkdocs that warns me about this, not the plugin, so handling warning should help as far as I can see.
redtide commentedon Apr 16, 2023
My only problem with this is that some files are not linked from nav, like the contacts page is linked in the footer and posts in a blog are handled by the plugin, I don't want to have a flood of lots files not in nav because they simply shouldn't be there.
So, if I don't miss something, would be nice to have a "not_in_nav" setting that can be configured with both files and directories (glob), like "the files in this list and these directories are known to be handled somewhere else".
oprypin commentedon May 17, 2023
majkinetor commentedon Jun 11, 2023
@oprypin , while this probably helps with the warning, it is because files are now not built at all? Or am I missing something?
In my case, I do build files, they are just not in nav, and since I have lots of them not in nav, I have lots of warnings. So the issue is warning for the files to be built, not the exlusions of such files.
oprypin commentedon Jun 11, 2023
majkinetor commentedon Jun 11, 2023
Thats it.
Cheers @oprypin for your work. 🍾
michal2612 commentedon Oct 12, 2024
I had similar issue. If you have many pages that you don't include in nav section I created a simple plugin to exclude all .md files that are not mentioned in nav section.
https://pypi.org/project/mkdocs-exclude-unused/