Codumentor logo Codumentor

Mermaid Render

Gives the agent a render_mermaid tool that turns Mermaid source into an SVG or PNG file. Rendering uses a Chromium-family browser and mermaid.js (same family of library the web UI uses).

Configuration

plugins:
  - module: codumentor.plugins.mermaid_render
    class: MermaidRenderPlugin
    args:
      enabled: true
      target_agents: "main"
      timeout: 30
      # mermaid_js_url: "file:///opt/mermaid/mermaid.min.js"  # offline

Users can enable or disable the plugin for themselves in settings.

Tool: render_mermaid

ArgumentRequiredDescription
sourceyesMermaid diagram source.
output_pathyesWhere to write the image. Relative paths use the working directory; parent dirs are created.
formatnosvg or png. Defaults from the path extension, otherwise svg.
themenoOverrides default_theme.
backgroundnoOverrides default_background.

Returns the absolute path plus format, size, and theme.

Notes