myst_sphinx_gallery.grid#
Patterns for the myst-sphinx-gallery extension.
Functions
|
Format the grid or card parameters. |
Classes
|
A class to create a grid pattern by given parameters. |
|
A class to create a grid item card pattern by given parameters. |
|
A class to create a table of content for the gallery images. |
- class myst_sphinx_gallery.grid.TocTree(pattern: str | None = None)[source]#
A class to create a table of content for the gallery images.
- class myst_sphinx_gallery.grid.Grid(outline: bool | None = None, reverse: bool | None = None, class_container: str | list[str] | None = None, class_row: str | list[str] | None = None)[source]#
A class to create a grid pattern by given parameters.
Detailed explanation of the parameters can be found in the grid options.
- class_container: str | list[str] | None = None#
Additional CSS classes for the grid container element.
- add_item(item: GridItemCard | str) None[source]#
Add an item to the grid pattern.
- class myst_sphinx_gallery.grid.GridItemCard(width: Literal['25%', '50%', '75%', '100%', 'auto'] | None = None, text_align: Literal['left', 'right', 'center', 'justify'] = 'center', shadow: Literal['none', 'sm', 'md', 'lg'] = 'md', border: Literal[0, 1, 2, 3, 4, 5] | tuple[int, int, int, int] = 0, rounded: Literal[0, 1, 2, 3, 'circle', 'pill'] = 2, class_card: str | list[str] | None = None, class_title: str | list[str] | None = None, class_img_top: str | list[str] | None = None, class_header: str | list[str] | None = None, class_body: str | list[str] | None = None, class_footer: str | list[str] | None = None)[source]#
A class to create a grid item card pattern by given parameters.
Detailed explanation of the parameters can be found in the card options. and grid item card.
- width: Literal['25%', '50%', '75%', '100%', 'auto'] | None = None#
Additional CSS classes for the grid row element.
- text_align: Literal['left', 'right', 'center', 'justify'] = 'center'#
left, right, center or justify
- Type:
Default horizontal text alignment
- shadow: Literal['none', 'sm', 'md', 'lg'] = 'md'#
none, sm (default), md, lg.
- Type:
The size of the shadow below the card
- border: Literal[0, 1, 2, 3, 4, 5] | tuple[int, int, int, int] = 0#
0, 1, 2, 3, 4, 5 or a tuple of four integers for (top bottom left right).
- Type:
The border width of the card
- rounded: Literal[0, 1, 2, 3, 'circle', 'pill'] = 2#
0, 1, 2, 3, “circle”, “pill”.
- Type:
The border radius of the card
Additional CSS classes for the footer element.
- add_class_option(option: str, value: str) None[source]#
Add class option to the grid item card pattern.
- property pattern: str#
Return the grid item card pattern string.
This property is a alias for the to_string method.
- format(target_ref: str, img_path: str) str[source]#
Format grid item card pattern with target reference and image path.
- copy() GridItemCard[source]#
Return a new instance of GridItemCard with same options.
Note
The new instance will only have the same options, but no items.