Comments (8)
It is expected that a link ending with /
or .html
will always be wrong (unless you've actually put a .html document into docs). Links need to be always to .md files that exist in docs dir.
See previously https://github.com/mkdocs/mkdocs/releases/tag/1.5.0#expanded-validation-of-links "Validated links in Markdown" - and the same applies to the newly enabled absolute links
from mkdocs.
Okay, but it seems no matter what I use, it produces the same warning. I can see the file in site/Framework/Events/Request/index.html
. So that should map to /Framework/Events/Request/index.md
; but seems only URL that actually works is /Framework/Events/Request
with or without a trailing /
.
NOTE: I changed something in the sub-project to make the url have a capitalized Framework
in the URL, but that didn't change anything.
EDIT: /Framework/Events/Request/index.html
actually does work, but still produces the error:
WARNING - Doc file 'architecture.md' contains a link '/Framework/Events/Request/index.html', but the target is not found
among documentation files.
from mkdocs.
@oprypin Seems this is a https://squidfunk.github.io/mkdocs-material/plugins/projects/ specific thing. Only seems to happen when pointing to a file a part of a sub-project. Imma close and open an issue over there.
from mkdocs.
Just from that plugin's concept, I guess the whole point is to split up sites into sub-sites, and validation is not really possible to implement fully correctly without running some part of the build process of MkDocs (files get added dynamically) for the other sites. So the correct mode for that plugin may be absolute_links: ignore
๐ฌ
from mkdocs.
@oprypin I'm seeing the same issue, but for a different use case (without plugins):
Doc file 'user-guide/index.md' contains an unrecognized relative link './foo/', it was left as is. Did you mean './foo/index.md'?
We have use_directory_urls: true
, and we want to keep using ./foo/
, instead of ./foo/index.md
. The links are actually compiled correctly, and the resulting site works! so I'm not sure if the warning is useful here.
Since mkdocs
already works correctly with this input, I do believe it is a false positive indeed. This validation is very useful otherwise.
from mkdocs.
I believe the rationale is that it's easier for MkDocs to detect and validate links when they use /index.md
. That also makes validation more robust against configuration changes, like switching from directory URLs to non-directory ones.
from mkdocs.
like switching from directory URLs to non-directory ones.
In that case, the warning should be conditional on that flag use_directory_urls
IMO. This is a valid user scenario, and is already supported and working correctly in the compiled site. It is only validation that is incorrectly flagging the link as broken.
from mkdocs.
I think I remember there were technical reasons why it's better to use /index.md
but I can't seem to find them. I think it's good that MkDocs pushes you to use the best approach for writing links, while allowing you to discard (debug) or disarm (info) the warnings with configuration options.
EDIT: ah, one of the reason might be that using /index.md
plays nicer with other tools like editors which are then able to see you're linking to an existing file.
from mkdocs.
Related Issues (20)
- Improve performance and authoring experience of `mkdocs serve` HOT 14
- Emit INFO instead of WARNING for Deprecated options HOT 5
- Break search plugin out into separate package HOT 8
- Empty mkdocs_theme.yml breaks build
- Generate nav with links to headers HOT 1
- ModuleNotFoundError: No module named 'mkdocs.tests' HOT 1
- FR: Anchor validation warning should remind the user it's case sensitive, especially if there are case-insensitive matches. HOT 3
- Anchor validation and special characters. HOT 2
- How to specify the port in MkDocs HOT 1
- AttributeError: 'EntryPoints' object has no attribute 'get' in xarray.backends HOT 1
- Should the markdown renderer treat a single line break as <br>? HOT 2
- Feature Request: Extend the `on_page_context` event with the reference to the Jinja2 Environment HOT 1
- Mkdocs no longer respecting set display text for same .md files. HOT 3
- Cannot get mkdocs to recognize the caseinsensitive plugin HOT 1
- Table display โflickersโ when refreshing the page HOT 2
- sourcing an external js library with in mkdocs HOT 6
- Please allow running MkDocs with Docker and strict mode HOT 6
- Default theme: N and P keys no longer work HOT 5
- ERROR - Config value 'docs_dir': The path 'mkdocs/Docs' isn't an existing directory. HOT 1
- Errors in macros plugin result in zero exit code HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mkdocs.