Skip to content

rs_rich.mermaid

Generated from the type stubs by scripts/gen_python_api.py; do not edit.

rs_rich.mermaid: rich-mermaid diagrams (no Rich counterpart).

Mermaid draws flowcharts as text (and, in a wheel built with the mmdc feature and backend="mmdc", every diagram type through Mermaid's CLI); what it cannot draw shows as source under a note. parse_flowchart and draw_flowchart raise instead. MermaidFences renders ``mermaid fences in Markdown; MermaidPlugin registers them with a plugin host.

MERMAID_HAS_MMDC module-attribute

MERMAID_HAS_MMDC: bool

MERMAID_MAX_EDGES module-attribute

MERMAID_MAX_EDGES: int
MERMAID_MAX_LINK_LENGTH: int

MERMAID_MAX_NODES module-attribute

MERMAID_MAX_NODES: int

MERMAID_MAX_SOURCE module-attribute

MERMAID_MAX_SOURCE: int

parse module-attribute

parse = parse_flowchart

draw module-attribute

draw = draw_flowchart

clean_label module-attribute

clean_label = mermaid_clean_label

render_png module-attribute

render_png = mmdc_render_png

HAS_MMDC module-attribute

HAS_MMDC = MERMAID_HAS_MMDC

MAX_SOURCE module-attribute

MAX_SOURCE = MERMAID_MAX_SOURCE

MAX_NODES module-attribute

MAX_NODES = MERMAID_MAX_NODES

MAX_EDGES module-attribute

MAX_EDGES = MERMAID_MAX_EDGES
MAX_LINK_LENGTH = MERMAID_MAX_LINK_LENGTH

MermaidPlugin module-attribute

MermaidPlugin = _native.MermaidPlugin

Flowchart

direction property

direction: Literal['TD', 'BT', 'LR', 'RL']

nodes property

nodes: List[FlowchartNode]

edges property

edges: List[FlowchartEdge]

notes property

notes: List[str]

FlowchartEdge

source instance-attribute

source: int

target instance-attribute

target: int

label instance-attribute

label: Optional[str]

stroke instance-attribute

stroke: str

start instance-attribute

start: Optional[str]

end instance-attribute

end: Optional[str]

length instance-attribute

length: int

FlowchartNode

id instance-attribute

id: str

label instance-attribute

label: str

shape instance-attribute

shape: str

Mermaid

source property

source: str

backend property

backend: str

ascii property

ascii: Optional[bool]

mmdc property

mmdc: Optional[MmdcOptions]

MermaidDiagram

lines instance-attribute

lines: List[str]

width instance-attribute

width: int

MermaidError

Bases: Exception

The base of the Mermaid errors.

MermaidFences

backend property

backend: str

ascii property

ascii: Optional[bool]

mmdc property

mmdc: Optional[MmdcOptions]

accepts

accepts(language: str) -> bool

render_fence

render_fence(language: str, code: str, console: Any = None, options: Any = None) -> Optional[Mermaid]

MermaidLayoutError

Bases: MermaidError

A flowchart too large to lay out as text.

kind instance-attribute

kind: str

MermaidParseError

Bases: MermaidError

Not a flowchart the text renderer draws; kind is "empty", "unsupported", "too_large" or "syntax" (with line).

kind instance-attribute

kind: str

line instance-attribute

line: Optional[int]

MmdcError

Bases: MermaidError

Mermaid's CLI produced no image; kind says why.

kind instance-attribute

kind: str

MmdcOptions

program property

program: str

timeout property

timeout: float

max_input property

max_input: int

max_output property

max_output: int

puppeteer_config property

puppeteer_config: Optional[str]

background property

background: str

draw_flowchart

draw_flowchart(chart: Union[str, Flowchart], ascii: bool = False) -> MermaidDiagram

mermaid_clean_label

mermaid_clean_label(text: str) -> str

mmdc_render_png

mmdc_render_png(source: str, options: Optional[MmdcOptions] = None) -> bytes

parse_flowchart

parse_flowchart(source: str) -> Flowchart