-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Disable navigation warning #1888
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
Comments
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. |
I'd like that as for me, the root |
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 |
That's just the plugins fault. If you want help fixing it, you can point me to the issue. |
Also that's not even what the current issue is about. |
@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. |
I am not dismissing that these warnings should be able to be silenced. I'll handle that in the upcoming months. But please don't also dismiss what I am saying.
Yes, it's a bug in the plugin. It will be there regardless if you're able to silence all warnings. |
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 In @env.macro
def inc( page, ext="sql", title="SQL" ):
fileFullName = page.title + '.' + ext
fileFullPath = page.file.abs_src_path.replace('.md', f'.{ext}')
try:
with open(fileFullPath) as f:
lines = f.read()
except FileNotFoundError:
return ''
return f"""
## {title}
Download: [{fileFullName}](../{fileFullName}) <============ generates warnings
```{ext}
{lines}
``` `
""" 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. |
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. |
I am now indeed thinking to add a way to configure patterns of files that are OK to not be in nav.
|
@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. |
See |
Thats it. Cheers @oprypin for your work. 🍾 |
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. |
Hi,
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:
The text was updated successfully, but these errors were encountered: