#!/bin/bash
# Copyright (C) 2006, Stefano Zacchiroli <zack@bononia.it>
#
# This is free software, you can redistribute it and/or modify it under the
# terms of the GNU General Public License version 2 as published by the Free
# Software Foundation.

viewer="eog"
ftype="svg"
xsl="$HOME/bin/tomboy2dot.xsl"
renderer="dot"	# dot, twopi, fdp, circo, ... see dot(1) 

dot=$(tempfile -p tomg_ -s .dot)
out=$(tempfile -p tomg_ -s .$ftype)
trap "rm -f $dot $out" EXIT
echo "digraph tomboy {" > $dot
echo "  rankdir=\"LR\";" >> $dot  # comment this if you like top-bottom layout
xsltproc $xsl $HOME/.tomboy/*.note | sed 's/^/  /' >> $dot
echo "}" >> $dot
$renderer -T$ftype $dot > $out

$viewer $out

