Skip to content
This repository has been archived by the owner on Aug 5, 2020. It is now read-only.
/ mermaid-go Public archive

Successful attempt to run mermaid-js in go

Notifications You must be signed in to change notification settings

joshcarp/mermaid-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mermaid-go

mermaid-js executable written in go

uses chromedp to run mermaid js.

Use

CLI

Installation

go get -u github.com/joshcarp/mermaid-go

Execute

mermaid-go <input.mmdc> -o <output.svg>

See demo

As a go package

go get -u github.com/joshcarp/mermaid-go/mermaid

package main

import (
	"io/ioutil"

	"github.com/joshcarp/mermaid-go/mermaid"
)

func main() {
	str := `
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
	`
	svg := mermaid.Execute(str)
	if err := ioutil.WriteFile("mermaid.svg", []byte(svg), 0644); err != nil {
		panic(err)
	}
}

About

Successful attempt to run mermaid-js in go

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages