p6raiq
Last Updated: February 25, 2016
·
803
· carleeto

DOT build system for Sublime Text 3

If you work with state machines a lot, you probably have dot files lying around.

If you're reading this, you probably use Sublime Text 3 as well :)

To be able to hit Ctrl+B and have a dot file you're working on rendered to disk:

1) Make sure you have the dot command line program in your path.

2) Install the DOT syntax highlighter via Package Control.

3) Click on Tools > Build System > New Build System. Copy paste the following lines and hit save.

{
    "cmd": ["dot","-Tpng","$file","-o","$file.png"],
    "file_regex": "\\w+: (.+):([0-9]+): ()(.*)$",
    "selector" : "source.dot",
}

This will render the dot file to disk.

You can change the type of file : JPEG: -Tjpeg, Postscript: -Tps. (change the extension to match)