]> git.r.bdr.sh - rbdr/dotfiles/blobdiff - zsh/functions/graphviz.zsh
Remove prezto
[rbdr/dotfiles] / zsh / functions / graphviz.zsh
diff --git a/zsh/functions/graphviz.zsh b/zsh/functions/graphviz.zsh
new file mode 100644 (file)
index 0000000..d7b4e12
--- /dev/null
@@ -0,0 +1,24 @@
+# Graphviz functions
+dot-to-png () {
+  if [[ -n "${1+x}" ]]; then
+    dot -Tpng $1 -o ${1%.*}.png
+  else
+    echo 'Usage: dot-to-png <path_to_file>'
+  fi
+}
+
+neat-to-png () {
+  if [[ -n "${1+x}" ]]; then
+    neato -Tpng $1 -o ${1%.*}.png
+  else
+    echo 'Usage: dot-to-png <path_to_file>'
+  fi
+}
+
+seqdiag-to-png () {
+  if [[ -n "${1+x}" ]]; then
+    seqdiag -o ${1%.*}.png -f /System/Library/Fonts/SFNSText.ttf $1
+  else
+    echo 'Usage: seqdiag-to-png <path_to_file>'
+  fi
+}