Registry / web-framework / mkdocs-panzoom-plugin

mkdocs-panzoom-plugin

JSON →
library0.5.2pypypiunverified

The MkDocs PanZoom Plugin is an active MkDocs plugin, currently at version 0.5.2, designed to add pan and zoom functionality to images and Mermaid/D2 diagrams within your MkDocs generated documentation. It enhances user interaction with visual content by allowing navigation and magnification, and it maintains a steady release cadence with recent updates improving performance and features.

web-framework
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

To activate the plugin, add `panzoom` to your `plugins` list in `mkdocs.yml`. For Mermaid and D2 diagrams to work correctly with pan/zoom since version 0.4.0, you must also configure `pymdownx.superfences` under `markdown_extensions` and define your `site_url`. The example demonstrates enabling pan/zoom for images, showing the hint permanently, setting an initial zoom, and configuring `pymdownx.superfences`.

plugins: - search - panzoom: # Enable pan/zoom for images include_selectors: - "img" # Optional: always show the hint (default: false) always_show_hint: true # Optional: set initial zoom level (default: 1.0) initial_zoom_level: 1.2 # Optional: enable fullscreen (still in development) full_screen: False # Required for Mermaid/D2 diagrams with panzoom since v0.4.0 markdown_extensions: - pymdownx.superfences: custom_fences: - name: mermaid class: mermaid format: !!python/name:pymdownx.superfences.fence_code_format site_url: https://example.com/your-docs/
mkdocs --version
Debug
Known footguns
breakingAs of version 0.4.0, the plugin requires explicit configuration of `pymdownx.superfences` for Mermaid/D2 diagrams to work, and the `site_url` must be defined in `mkdocs.yml`. Additionally, the `exclude` (pages) configuration option was removed.
gotchaThe `site_url` parameter in `mkdocs.yml` must be defined for the plugin to function correctly, particularly with diagram and image handling.
gotchaThe `exclude_selectors` option in the plugin configuration is intended only to disable the *default* selectors (e.g., '.mermaid', '.d2'). To exclude a *specific item* (image or diagram) from pan/zoom, you must add the CSS class `pz-ignore` to that item in your Markdown.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
13 hits · last 30 days
ahrefsbot
4
gptbot
3
chatgpt-user
2
script
1
qwantbot
1
googlebot
1
Resources