-
Notifications
You must be signed in to change notification settings - Fork 28
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
Unhandled exception when checking if URL exists #101
Comments
Thank you for your contribution! This is very appreciated. |
Came for the same issue. I wanted to remove use of extra_javascript and extra_css but since I'm building our documentation in an isolated network, the build fails checking the URL of mermaid on unpkg. |
Thank you. The business case makes sense and the approach appears sensible. |
I would advise against implementing a skip without making sure the admin is aware of the issue. Anyway, there are two PRs I tried to made in the same style as the original repo. One is correct reporting and the other is the way I worked around the problem. I split them because I consider one to be a bug and the other enhancement. Let me know if there is something I can do better. |
@BansheeHero Your approach has some good points.You complemented it with two procedures Maybe you wish to compare? The question we need to ask at this point, is how we want this issue to initially appear in the build process: as a warning to the admin (which would break only if the (For more background, see fralau/mkdocs-macros-plugin#226.) |
Since our documentation has a CI/CD pipeline, it is easy ok for us to make it fail in case there is an error in the documentation (missing documents, broken links, etc). As long as we can skip some specific errors that are expected due to network isolation. |
Thanks for all the input and PRs. To sum it up, we have an issue of
@BansheeHero Is that your analysis too? In general, this puts into question the mechanism for calling the library. In principle, if there is a local file, it should not make an http call., and that might solve the problem, I believe. Or, in the normal case just issue a warning and continue. If there is an --strict option (as mentioned) we could make it fail. @EvaSDK Would that second solution work for you? |
- Fixed behavior of the `url_exists()` function - Added log levels (Warning) - Documented the change
@BansheeHero @EvaSDK I took the idea of the pull request (#102), simplified it a little, and documented. Now a WARNING is issued when no Internet access is available and mkdocs continues (unless the option Could you please test whether it works for you? |
Impact: Cannot build or serve on some network isolated machines.
Issue: Code expects that request is always made and only evaluates the final HTTP code:
Discovered on ZScaler networks, where the product fails to inject SSL certificates. This part is not why this issue is raised.
Based on reading the code I would expect there to be a try and error message:
"Cannot find Mermaid library: %s" % javascript
I would like to also request an option to skip this check - this URL is available in the browser itself due to the way ZScaler works differently to python environment. This seems to align with the intention to just load the remote URL later with:
import mermaid from "https://unpkg.com/mermaid@10.4.0/dist/mermaid.esm.min.mjs";
I was able to reproduce the request, confirming the SSL issue is not related to this project.
https://github.com/fralau/mkdocs-mermaid2-plugin/pull/102 - Pull request for handling the exception,
The text was updated successfully, but these errors were encountered: