149

GitHub - arnm/ob-mermaid: Generate mermaid diagrams within Emacs org-mode babel

 4 years ago
source link: https://github.com/arnm/ob-mermaid
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

README.org

ob-mermaid

Generate mermaid diagrams using org-mode, org-babel and mermaid.cli.

Setup

If you use Spacemacs, use the mermaid Spacemacs layer.

  1. Install package from Melpa
  2. Install mermaid.cli
  3. Specify mmdc executable path:
    (setq ob-mermaid-cli-path "/your-installating-path/node_modules/.bin/mmdc")
        
  4. Open org-mode buffer and create a org-babel source block:
    sequenceDiagram
     A-->B: Works!
        
  5. Exporting the org-mode document or invoking the org-babel-execute-src-block function to generate diagram.

Supported properties

file - Output file. It should be either svg, png or pdf.

width - Width of the page. Optional.

height - Height of the page. Optional.

theme - Theme of the chart, could be default, forest, dark or neutral. Optional.

background-color - Background color. Example: transparent, red, ‘#F0F0F0’. Optional.

mermaid-config-file - JSON configuration file for mermaid. Optional.

css-file - CSS file for the page. Optional.

pupeteer-config-file - JSON configuration file for puppeteer. Optional.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK