graphdown

Markdown extension for embedding graphs.

MIT License

Downloads
6.3K
Stars
28
Committers
3

Graphdown

Markdown extension for embedding graphs.

Installation

$ gem install graphdown

Usage

CLI

$ graphdown sample.md

This command generates sample.html, which is parsed into HTML with graphs in format of SVG.

Redcarpet

require "redcarpet"
require "graphdown"

class BaseRenderer < Redcarpet::Render::HTML
  include Graphdown::Renderable
end

markdown = Redcarpet::Markdown.new(BaseRenderer, fenced_code_blocks: true)

Graph notation

Graphdown extends following notations for graphs.

  • [label name]: Node named "label name"
  • [label A], [label B], ...: Multiple nodes
  • ->: Unidirectional edge
  • <->: Bidirectional edge

Graphdown parses these notations into graph images in SVG format.

Examples

References

  • Kazuo Misue, Kouzou Sugiyama, On Automatic Drowing of Compound Graphs for Computer Aided Diagrammatical Thinking, Journal of Information Processing Society of Japan, 1989, Vol.30, No.10, p1324-1334.
Package Rankings
Top 30.25% on Rubygems.org