1.1.3 • Published 5 years ago

markdown-it-graphviz-exec v1.1.3

Weekly downloads
2
License
MIT
Repository
-
Last release
5 years ago

markdown-it-graphviz-exec

Render GraphViz dot language to svg using executables.

Depends on GraphViz

@graphviz_open
digraph G {

	subgraph cluster_0 {
		style=filled;
		color=lightgrey;
		node [style=filled,color=white];
		a0 -> a1 -> a2 -> a3;
		label = "process #1";
	}

	subgraph cluster_1 {
		node [style=filled];
		b0 -> b1 -> b2 -> b3;
		label = "process #2";
		color=blue
	}
	start -> a0;
	start -> b0;
	a1 -> b3;
	b2 -> a3;
	a3 -> a0;
	a3 -> end;
	b3 -> end;

	start [shape=Mdiamond];
	end [shape=Msquare];
}
@graphviz_close

Example

Add attributes to the output element with JSON argument

@graphviz_open { "attrs": { "width": "100%", "style": "border: 2px dashed blue" } }
digraph G {Hello->World}
@grophviz_close
@graphviz_open { "cmd": "neato" }
digraph sequenceDiagramExample {
  node [ shape="record" ]
  clientHead [ label="Client" pos="0,1.5!" ];
  clientPoint0 [ pos="0,0.75!" shape="point" width="0" ];
  clientFoot [ label="Client" pos="0,0!" ];
  htmlHead [ label="HTML" pos="1,1.5!" ];
  htmlPoint0 [ pos="1,0.75!" shape="point" width="0" ];
  htmlFoot [ label="HTML" pos="1,0!" ];
  clientHead -> clientPoint0 -> clientFoot [ dir="none" style="dashed" ]
  htmlHead -> htmlPoint0 -> htmlFoot [ dir="none" style="dashed" ]
  clientPoint0 -> htmlPoint0 [ label="get" labelloc="c" style="solid" ]
}
@graphviz_close

Install

yarn add markdown-it-graphviz-exec

on macOS:

brew install graphviz

on Fedora:

dnf install graphviz

on Debian:

apt install graphviz
1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago