Maidr.save_html
Maidr.save_html(
file
*
lib_dir='lib'
include_version=True
data_in_svg=True
use_cdn='auto'
)Save the HTML representation of the figure with MAIDR to a file.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| file | str | The file to save to. | required |
| lib_dir | str | The directory to save the dependencies to (relative to the file’s directory). | "lib" |
| include_version | bool | Whether to include the version number in the dependency folder name. | True |
| data_in_svg | bool | Controls where the MAIDR JSON payload is placed in the output HTML or SVG. | True |
| use_cdn | bool or {'auto'} | * True: load maidr.js from the CDN only. * False: copy the bundled maidr.js / maidr.css into lib_dir next to the saved HTML and reference them with relative paths (no network access required). * "auto" (default): attempt the CDN first and fall back to the bundled copy client-side if the CDN request fails. The bundled files are still copied alongside the HTML so the fallback works offline. |
"auto" |