indented outline markup -> dot
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Indented outline => dot

Convert a simple indented (markdown inspired) outline format to dot language.

Example input file:

# This is a comment; blank lines get eaten.

    # Default indent marker is 4 spaces. This can be changed.
    topic one
        subtopic one
    topic two
        subtopic one
        subtopic two

From the command line, running

./ input-file.txt

produces the output:

digraph G {
    "main" -> "topic one";
    "topic one" -> "subtopic one";
    "main" -> "topic two";
    "topic two" -> "subtopic one";
    "topic two" -> "subtopic two";

The default output is to standard out, but one can specify an output file with

./ -o input-filt.txt

So then

dot -Tpng -o output-graph.png

produces the following graph:

Another useful option is to maintain a strict tree structure in the output. This is specified as follows:

./ --tree=True input-file.txt

Using the same input as above, this produces a slightly different graph: