Skip to main content

Module mermaid

Module mermaid 

Source
Expand description

Mermaid code block extraction, rendering via mmdc, and content-hash caching.

Renders mermaid diagrams as halfblock images when:

  1. mmdc is installed
  2. Terminal supports inline images (Ghostty, iTerm2, Kitty)
  3. NOT inside a multiplexer (tmux) which strips graphics escape sequences

Falls back to styled source code otherwise.

Structs§

MermaidBlock
A mermaid code block extracted from markdown.
MermaidCache
Cache and state manager for mermaid diagram rendering.

Enums§

ImageProtocol
Which inline image protocol the terminal supports.
ImageSupport
Whether mermaid image rendering is supported in the current environment.
MermaidRenderState
State of a mermaid diagram render.

Functions§

detect_image_support
Detect whether the current terminal environment supports inline image rendering.