myst_sphinx_gallery.images#
A module to manage images in a MyST markdown/notebook/rst file.
Functions
|
Parse the image information (url, alt) from a markdown content. |
|
Parse the images (url, alt) from a reStructuredText content. |
|
Strip the string and remove quotes. |
Classes
|
A class to manage images in a notebook code cell output. |
|
A class to manage images in a MyST markdown/notebook/rst file. |
|
A class to manage the thumbnail image. |
- class myst_sphinx_gallery.images.Thumbnail(image: Path | str | Image, output_dir: Path | str, ref_size: tuple[int, int] | int = (320, 224), operation: Literal['thumbnail', 'contain', 'cover', 'fit', 'pad'] = 'pad', max_animation_frames: int = 50, quality_static: int = 80, quality_animated: int = 15, operation_kwargs: dict[str, int] | None = None, save_kwargs: dict[str, int] | None = None)[source]#
A class to manage the thumbnail image.
- property image: Image#
The thumbnail image.
- save_thumbnail(out_path: Path | None = None) Path[source]#
Save the thumbnail image to the output directory.
- Parameters:
out_path (Path) – The path to save the thumbnail image. If None, the image will be saved with the same name as the original image.
- Returns:
out_path – The path to the saved thumbnail image.
- Return type:
Path
- class myst_sphinx_gallery.images.DocImages(images: list[tuple[str, str]])[source]#
A class to manage images in a MyST markdown/notebook/rst file.
- class myst_sphinx_gallery.images.CellImages(notebook_file: Path)[source]#
A class to manage images in a notebook code cell output.
- myst_sphinx_gallery.images.parse_md_images(markdown_content: str) DocImages[source]#
Parse the image information (url, alt) from a markdown content.
Two types of markdown image syntax are supported:
Conventional markdown image syntax:
Myst markdown image/figure syntax: See Images and figures for more details.
Warning
The html image syntax is not supported.