mkdocs_nype.plugins.webp_images.plugin
Synopsis
MkDocs plugin to convert images to WebP format
This plugin converts images concurrently and recursively to not block the main thread and injects the web image path during Markdown path validation / resolution to not parse HTML output with regex.
Parts adapted based on: - https://github.com/mur4d1n-lib/mkdocs-images-to-webp by mur4d1n (MIT) - https://github.com/squidfunk/mkdocs-material/tree/master/material/plugins/social by squidfunk (MIT) - https://gitlab.com/Shoun2137/ztexipy by Shoun2137 (GPLv3)
MIT License Kamil Krzyśków (HRY) for Nype (npe.cm) and Fiori Tracker (fioritracker.org)
LOG
Logger instance for this plugin.
WebpImagesPlugin
get_image_hash_key
Load the file via stream and calculate hash during the process
wrap_path_to_url
Wrap mkdocs.structure.pages._RelativePathTreeprocessor.path_to_url logic to swap in WebP paths
wrap_url_filter
Wrap mkdocs.utils.templates.url_filter logic to swap in WebP paths
wrap_run
Wrap mkdocs.structure.pages._RelativePathTreeprocessor.run logic to swap in WebP paths