The final feature PR for version 0.19, adding support for mermaid diagrams to the Helium theme.
The initial support is implemented as follows:
Since this feature requires templating, it is part of the Helium theme and not available for the laika-core module.
In contrast to most other functionality in Laika it is only supported for HTML output, mermaid blocks passed to EPUB or PDF renderers trigger warnings and will be skipped.
The mermaid theme is automatically adjusted to the theme colors configured for Helium.
Dark mode is supported, but since mermaid styling is driven by JavaScript and not CSS, it is detected at load time and not dynamically.
Mermaid support is not configurable in this initial implementation. It's best to wait for actual adoption and user feedback to find out which level of configurability users might want, if any, meaning it'll be a topic for version 1.x.
The loading of mermaid JavaScript is driven by inspecting the content of pages, meaning we avoid unnecessary script loading times for pages that do not contain any mermaid diagrams.
Markup syntax is a standard fenced code block starting with ```mermaid, which means that GitHubFlavor needs to be active (it will be included by default when using Laika with sbt-typelevel, but not when using Laika standalone).
The final feature PR for version 0.19, adding support for mermaid diagrams to the Helium theme.
The initial support is implemented as follows:
laika-core
module.```mermaid
, which means thatGitHubFlavor
needs to be active (it will be included by default when using Laika withsbt-typelevel
, but not when using Laika standalone).Closes #331.