Project

tinydot

0.01
No commit activity in last 3 years
No release in over 3 years
Tiny language alternative to DOT.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.5
>= 0
~> 2.14.1

Runtime

~> 0.18.1
 Project Readme

Tinydot

Tiny language alternative to DOT.

Installation

$ gem install tinydot

Graphviz is required to convert files written by tinydot into images.

Usage

$ tinydot convert sample.tinydot

tinydot command converts *.tinydot or *.tdot into *.dot and converts the converted files into graph images using Graphviz.

Examples

Nodes, Edges

digraph "sample" do
  a >> b >> c
  a <=> d
  b <=> d
end

is equivalent to

digraph sample {
  a -> b;
  b -> c;
  a -> d [dir = both];
  b -> d [dir = both];
}

and converted into a following graph.

sample

Attributes

digraph "sample2", rankdir: "LR" do
  node shape: "record", style: "filled", fontname: "Osaka", fillcolor: "#ECF0F1"

  a "Label 1"
  b "Label 2"
  c "Label 3", fillcolor: "#27AE60"
  d "Label 4", fillcolor: "#F1C40F"
  e "Label 5", fillcolor: "#E74C3C"

  a <=> b
  a <=> c
  b >> d
  d <=> e
  d >> a
end

is equivalent to

digraph sample2 {
  graph [rankdir = LR];
  node [shape = record, style = filled, fontname = "Osaka", fillcolor = "#ECF0F1"];

  a [label = "Label 1"];
  b [label = "Label 2"];
  c [label = "Label 3", fillcolor = "#27AE60"];
  d [label = "Label 4", fillcolor = "#F1C40F"];
  e [label = "Label 5", fillcolor = "#E74C3C"];

  a -> b [dir = both];
  a -> c [dir = both];
  b -> d;
  d -> e [dir = both];
  d -> a;
}

and converted into a following graph.

sample2