Markdown extension for embedding graphs.
$ gem install graphdown
$ graphdown sample.md
This command generates sample.html
, which is parsed into HTML with graphs in format of SVG.
require "redcarpet"
require "graphdown"
class BaseRenderer < Redcarpet::Render::HTML
include Graphdown::Renderable
end
markdown = Redcarpet::Markdown.new(BaseRenderer, fenced_code_blocks: true)
Graphdown extends following notations for graphs.
[label name]
: Node named "label name"[label A], [label B], ...
: Multiple nodes->
: Unidirectional edge<->
: Bidirectional edgeGraphdown parses these notations into graph images in SVG format.