Skip to content

Instantly share code, notes, and snippets.

@cmrfrd
Last active October 18, 2019 21:11
Show Gist options
  • Save cmrfrd/3850821e1f9e47691c7806efe0dbde68 to your computer and use it in GitHub Desktop.
Save cmrfrd/3850821e1f9e47691c7806efe0dbde68 to your computer and use it in GitHub Desktop.
ascii_interact.org

org is super kool

This is a really cool and simple org document to be able to interactively compute ascii results from an isolated installation of easygraph && graphviz within docker using org mode SRC blocks.

The point of this is much broader though because any text based output tool like plantuml, easygraph, or other can be used interactively in org without installing either tool and purely using docker for isolation

Setup of languages

(org-babel-do-load-languages
  'org-babel-load-languages
  '((sh . t)))

Sample graph viz graph

digraph G {
	graph [rankdir = LR];

	node[shape=record];
	Bar[label="Yeet | <a>a|<b>b|<c>c", height=2];
	Foo[label="Yoot | <d>d|<e>e|<f>f", height=2];

	Bar -> Foo [label="asdf"];

	Bar:a  -> Foo:d;
	Bar:c  -> Foo:f [dir="both"];
}
echo $x | docker run --rm -i ge --from graphviz --ascii

Some gosh darn pretty output

+-------+----+---+----+
| Yeet  |  a | b |  c |
+-------+----+---+----+
  |        |        ^
  |        |        |
  | asdf   |        |
  v        v        v
+-------+----+---+----+
| Yoot  |  d | e |  f |
+-------+----+---+----+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment