Skip to content

KeyWeeUsr/mermaid-docker-mode

Repository files navigation

mermaid-docker-mode

MELPA MELPA Stable CI Coverage Status Buy me a coffee Liberapay PayPal

Render mermaid graphs with Docker service

This library attempts to create Mermaid graphs via the official mermaid-cli using the official Docker image and restricting network access, so that you are sure nothing gets out and your system is kept isolated from random Node.js deps/files noise all around the filesystem.

How to

Install it from Melpa or clone and install manually, then:

  1. Have mermaid-mode installed and activated.
  2. Run the install function M-x mermaid-docker-install
  3. Activate this mode with M-x mermaid-docker-mode
  4. After successful installation C-c C-c for mermaid-mode is patched and renders the graphs via Docker container

Customization

Name Type Default Description
mermaid-docker-verbose boolean t Emit messages when something's happening in the background.
mermaid-docker-always-check-deps boolean t Always look up binaries, libraries and other required tools.
mermaid-docker-image-name string "minlag/mermaid-cli" Official mermaid-cli image.
mermaid-docker-image-tag string "11.4.3-beta.30" Tag for official mermaid-cli image.
mermaid-docker-output-format string "png" Output format for rendered diagram.
mermaid-docker-output string "" Default file output ('' / empty string).
mermaid-docker-external-viewer-bin string "/usr/bin/xviewer" Path to external image viewer.
mermaid-docker-focus-steal-fix boolean t Should attempt to fix focus stealing?
mermaid-docker-focus-steal-ms number 200 Milliseconds to wait before stealing focus back.
mermaid-docker-external boolean nil Use external viewer to display rendered mermaid graph.
mermaid-docker-stay-in-window boolean nil Stay in window with the diagram after rendering.
mermaid-docker-bin string "docker" Docker or Docker-compatible binary on PATH or absolute value.