-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Built-in privacy
plugin does not download external assets of embedded .html file
#7600
Comments
Thanks for reporting. While this might not be obvious, for MkDocs to consider your HTML file as something to process, it must be listed under extra_templates:
- maps/bounding_box.html The privacy plugin will process it and download all assets:
I think this can be considered a design flaw in MkDocs, as all HTML files that are located in the Note that dynamically generated asset URLs in JavaScript (= map tiles) are not downloaded - it's not possible to know what to download and replace without executing the JavaScript. Marking as resolved via configuration. |
My suggestion about the bug came from reading the source code: mkdocs-material/material/plugins/privacy/plugin.py Lines 83 to 85 in f0c99d8
The privacy plugin uses the def on_files(files, *, config):
print("Markdown Files:")
for file in files.documentation_pages():
print(" ", file.src_uri)
print("Static Pages:")
for file in files.static_pages():
print(" ", file.src_uri)
|
Yes, HTML is not considered media files but templates by MkDocs. Honestly I'd consider it such an edge case, that its not worth trying to fix what's not broken. Two lines of config and it works. We might add something to the documentation, though. PR appreciated |
Thanks to both of you for your help |
Context
As discussed in #7596
I use an inline frame (
<iframe>
) to embed .html files in my documentation.The .html files are generated by folium and download .js files from various CDNs.
The built-in
privacy
plugin is used for self-hosting of these external assets.Bug description
The built-in
privacy
plugin does not download the external assets of the embedded .html file.I would expect it to:
site
directoryRelated links
privacy
pluginReproduction
9.5.39-privacy-with-embedded-html.zip
Steps to reproduce
mkdocs serve
.cache/plugin/privacy
directory - the external assets of the embedded .html file are not downloadeddocs/maps/bounding_box.html
file - the references are not replaced with links to the downloaded copiesBrowser
No response
Before submitting
The text was updated successfully, but these errors were encountered: