overlay

filters.overlay

Pandoc filter for the overlay component.

Demo and Browser Functionality

See the demo and examples to learn more about filter configuration and the intended functionality and the javascript documentation to learn more about how it works in the browser.

Use

The object is to hydrate overlays and add the necessary javascript (because writing many nested div fences is a garbage pattern and can become quite cumbersome).

Ideally, this filter should turn

::: { #my-overlay }

::: { .overlay-content-item }

It works!

:::

:::

into

<div>
    <div id="my-overlay" class="overlay">
        <div class="overlay-content">
            <div class="overlay-content-items">
                <div class="overlay-content-item">
                    It works!
                </div>
            </div>
        </div>
    </div>
    <script>
        Overlay(...)
    </script>
</div>

Classes

Name Description
Colorize Colorize configuration for the overlay.
Config Schema used to validate quarto metadata.
ConfigOverlay Overlay filter config.
FilterOverlay Overlay filter.

Colorize

filters.overlay.Colorize()

Colorize configuration for the overlay.

Attributes

Name Type Description
color BSColor Background color for the overlay navbar and border.
color_text BSColor Color of the navbar text and icons.
color_text_hover BSColor Color of the navbar text when hovered.

Config

filters.overlay.Config()

Schema used to validate quarto metadata.

Attributes

Name Type Description
overlay Annotated[dict[str, ConfigOverlay] | None, pydantic.Field(None), pydantic.BeforeValidator(util.content_from_list_identifier)] An optional list of overlay schemas.

ConfigOverlay

filters.overlay.ConfigOverlay()

Overlay filter config.

Attributes

Name Type Description
identifier FieldIdentifier Unique identifier for the configuration instance. This tells the filter which pandoc markdown div to hydrate.
colorize Annotated[Colorize | None, pydantic.Field(None)] Optional colorize settings.
classes util.FieldClasses Classes for the overlay element (e.g. overlay-blur).
classes_items_wrapper util.FieldClasses Classes to add to the overlay items wrapper.
classes_items util.FieldClasses Classes to add to each overlay item.

FilterOverlay

filters.overlay.FilterOverlay(self, doc=None)

Overlay filter.