Project

graphdown

0.01
No commit activity in last 3 years
No release in over 3 years
Markdown extension for embedding graphs.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.5
>= 0
~> 2.14.1

Runtime

~> 3.0.0
>= 0
~> 0.18.1
 Project Readme

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

# Servers arrangement

[Load balancer] -> [Web server 1], [Web server 2], [Web server 3] -> [DB server], [Cache server]

Servers arrangement

# Path to naoty/graphdown on GitHub

[/] -> [/naoty] -> [/naoty/graphdown]
[/] -> [/search] -> [/naoty/graphdown]
[/] -> [/notifications] -> [/naoty/graphdown]

Path to graphdown

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.