8000 GitHub - sindrel/excalidraw-converter: A command line tool for porting Excalidraw diagrams to Gliffy, draw.io and Mermaid.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

sindrel/excalidraw-converter

Repository files navigation

logo Excalidraw Converter

A command line tool for porting Excalidraw diagrams to Gliffy, draw.io and Mermaid.

Excalidraw is great for sketching diagrams as part of a design process, but chances are that you have to redo those sketches for documentation. This tool is made to bridge those tasks.

Excalidraw vs. Gliffy comparison

Supported Commands

Command Description Documentation
gliffy Convert Excalidraw diagrams to Gliffy format Usage
mermaid Convert Excalidraw diagrams to Mermaid format Usage

Getting Started

Installation

MacOS with Homebrew (stable)

brew install excalidraw-converter
Latest releases

Use this tap to stay on the latest releases that have not (yet) been added to the official Homebrew Formulae:

brew install sindrel/tap/excalidraw-converter

Installation for other OSes

Download a compatible binary from the Releases page.

If you're a Linux or MacOS user, move it to your local bin folder to make it available in your environment (optional).

Quick Start

Convert your Excalidraw diagram by running:

exconv <command> -i <input-file>

See below for details on each command, available options and examples.

Command Usage & Examples

Gliffy & Draw.io

Converts to a Gliffy compatible format, which can be imported directly into services like Gliffy, Gliffy for Confluence, draw.io or draw.io for Confluence.

Usage:

  • Mac/Linux:
    exconv gliffy -i my-diagram.excalidraw
  • Windows:
    exconv.exe gliffy -i C:\path\to\my-diagram.excalidraw

Flags:

  -h, --help            help for gliffy
  -i, --input string    input file path
  -o, --output string   output file path (default "your_file.gliffy")

Importing in Gliffy

Animation demonstrating use

After converting your diagram(s), import them into Gliffy (or draw.io) using the standard Import dialog. Mermaid diagrams can be pasted or included in markdown files or compatible tools.


Mermaid

Converts to a Mermaid diagram that can be used for a variety of cases, such as being included in markdown files on GitHub, GitLab, MkDocs or Docusaurus.

Note

  • Currently only supports conversion to flowcharts.
  • Only elements that are connected by arrows, or contained inside a connected element, are included.

Usage:

  • Mac/Linux:
    exconv mermaid -i my-diagram.excalidraw
  • Windows:
    exconv.exe mermaid -i C:\path\to\my-diagram.excalidraw

Flags:

  -d, --direction string   flow direction 'default', 'top-down', 'left-right', 'right-left' or 'bottom-top' (default "top-down")
  -h, --help               help for mermaid
  -i, --input string       input file path
  -o, --output string      output file path (default "your_file.mermaid")
  -p, --print-to-stdout    print output to stdout instead of a file

Validate a converted diagram

You can validate and customize a converted diagram using tools like Mermaid Live Editor.

Import a converted diagram back into Excalidraw

After converting your diagram(s), you can use the Mermaid to Excalidraw playground to convert it back to the Excalidraw format.

Note that some styling attributes could be lost as part of the conversion and import process.

Example diagram embedded in markdown

Click to expand
flowchart 
subgraph N0 [" "]
  N4(("Hello!"))
  N2{"Lorem Ipsum"}
  subgraph N1 ["Example"]
    N5("Sit Amet")
    N3["Dolor"]
  end
end
N2 --> N3
N2 --> N5
style N4 stroke:#e03131,stroke-width:2,fill:#ffffff,color:#e03131;
style N5 stroke:#1e1e1e,fill:#ffc9c9,font-size:90%;
style N3 stroke-dasharray: 2 2,stroke:#1e1e1e,stroke-width:2,fill:#ffec99,font-size:90%;
style N2 stroke-dasharray: 5 5,stroke:#1e1e1e,fill:#b2f2bb,font-size:90%;
style N0 stroke:#1e1e1e,stroke-width:2,fill:#a5d8ff;
style N1 stroke:#1e1e1e,fill:#e7f5ff,font-size:90%;
Loading

Features

All fixed shapes and most styling and text options are supported.

Shapes

Shape Gliffy Mermaid
Rectangle
Rounded rectangle
Diamond
Ellipse
Arrow
Line
Image
Free drawing (pencil)
Library graphics*

Text

Horizontal alignment
Text Option Gliffy Mermaid
Font family (Normal/Code)
Font size
Font color
Vertical alignment
Text contained in shapes

Styling

Styling Option Gliffy Mermaid
Canvas background color
Fill color
Fill style (hachure/cross)
Stroke color
Stroke width
Opacity
Links

* Library graphics are not fully supported (experimental).

Compatibility with draw.io

Converted Gliffy diagrams should also work in the online version of draw.io.

In draw.io, you can import a diagram by simply opening the file from your device. If you're using draw.io for Confluence, you should be able use the import dialog.

Note that this is only supported in the online version of draw.io, not the desktop app.

Compatibility with Excalidraw for Obsidian

Diagrams created using the Excalidraw for Obsidian plugin must be exported before conversion, as described here.

Contributing

See something you'd like to improve? Great! See the contributing guidelines for instructions.

Attributions

Development

Instructions

Prerequisites:

  • Go (see version in go.mod)

Download dependencies

go mod download

Run tests

go test -v ./...

Compile and run

go run ./cmd/main.go <command> <arguments>

About

A command line tool for porting Excalidraw diagrams to Gliffy, draw.io and Mermaid.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •  
0