Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/naoty/graphdown
Markdown extension for embedding graphs.
https://github.com/naoty/graphdown
Last synced: 2 months ago
JSON representation
Markdown extension for embedding graphs.
- Host: GitHub
- URL: https://github.com/naoty/graphdown
- Owner: naoty
- License: mit
- Created: 2014-01-20T12:43:00.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-02-16T13:33:09.000Z (almost 11 years ago)
- Last Synced: 2024-10-31T21:35:35.294Z (2 months ago)
- Language: Ruby
- Homepage:
- Size: 506 KB
- Stars: 28
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Graphdown
Markdown extension for embedding graphs.
## Installation
```sh
$ gem install graphdown
```## Usage
### CLI
```sh
$ graphdown sample.md
```This command generates `sample.html`, which is parsed into HTML with graphs in format of SVG.
### Redcarpet
```rb
require "redcarpet"
require "graphdown"class BaseRenderer < Redcarpet::Render::HTML
include Graphdown::Renderable
endmarkdown = 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 edgeGraphdown 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](examples/servers_arrangement.png)
# Path to naoty/graphdown on GitHub[/] -> [/naoty] -> [/naoty/graphdown]
[/] -> [/search] -> [/naoty/graphdown]
[/] -> [/notifications] -> [/naoty/graphdown]![Path to graphdown](examples/path_to_graphdown.png)
## 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.