oprypin / mkdocs-literate-nav

MkDocs plugin to specify the navigation in Markdown instead of YAML
https://oprypin.github.io/mkdocs-literate-nav
MIT License
73 stars 8 forks source link

Question: literate-nav and fragments / query strings in --strict mode #24

Closed sn0wcat closed 1 year ago

sn0wcat commented 1 year ago

I am struggling with the use of literate-nav plugin together with --strict mode.

Mkdocs is throwing an error as soon as I pass a fragment or a query string like this

in nav.md

* [Libraries](../apis.html?resourceType=Library%2CSDK)
* [Contact](documentation.md#contact)

I get warnings which are then converted to errors in --strict mode

WARNING  -  A relative path to 'apis.html?resourceType=Library%2CSDK' is included in the 'nav' configuration, which is not found in the documentation files
WARNING  -  A relative path to 'documentation.md#contact' is included in the 'nav' configuration, which is not found in the documentation files

Is there a way to tell to mkdocs or to literate-nav to ignore the fragments or querystrings in the links? I don't want to abandon --strict mode just yet...

oprypin commented 1 year ago

mkdocs-literate-nav just prepares a nav and hands it over to MkDocs (i.e. you could always write the same nav in mkdocs.yml and get the same outcome), and indeed MkDocs can't deal with this. The solution would have to be in MkDocs