-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Report missing images #872
Comments
Seems like a good idea to me. We already display warnings for broken links to '.md' files. Looking at how that works would probably be a good start. |
This could be a little tricky as Markdown files are checked against the Nav (a previously compiled list of pages), not against the file system. And in that part of the code we don't have access to the In the end, I expect this to be more difficult that one would think. This will likely also be a problem if/when support for "hidden" pages is added (see #699). Those pages will be explicitly absent from the Nav and should not generate a warning, but with no way to determine that within the Markdown Extension, there is no way to conditionally not raise the warning. I see two possibilities to that problem (which would also directly affect this issue):
The problem stems in part from the fact that Python-Markdown does not really support passing data to an extension to modify its behavior on a file-by-file basis. The idea is that you create a Markdown instance with a config, and that instance is used (without changing behavior) for multiple files. Of course, MkDocs gets around this by creating a new instance for each page, but the API wasn't really designed with this use-case in mind. |
Hey there, |
How can I ignore this? I put the images somewhere not in the same repo, then got lots of warning. |
@zhangzq warnings are only issued for relative paths. If your images are in a different repo, then they are not within the MkDocs site and should be absolute paths, which would avoid the warnings. |
@waylan thanks. I'll change them to absolute paths. |
@waylan I found the absolute paths must contains the whole domain part, i.e. http://domain.com/path/file.pdf 。 However, I used different domains in internal and public deploys. Can I use |
Yes, that should work fine. If it does not, please open a new issue. |
Hello,
I'm thinking that it would be useful to report when local images that are referenced in the chapter are missing from the repo.
Wondering if this has been thought about before, and if there are any reasons why it isn't implemented (apart from resources/priorities).
I'd be willing to give it a go if people think it is a good idea.
The text was updated successfully, but these errors were encountered: