# HG changeset patch # User Sean Russell # Date 1311772319 14400 # Wed Jul 27 09:11:59 2011 -0400 # Branch prawn-tip # Node ID eeb42db4c05c3fb1352dd5bee65a256465ccf5cf # Parent 7eaf89595f3b1ce99ee9e0f59610cb6eea8582c9 Skip blank lines, comments in config file. Add some helper scripts for callouts, and more examples. diff --git a/contrib/clapham b/contrib/clapham new file mode 100755 --- /dev/null +++ b/contrib/clapham @@ -0,0 +1,28 @@ +#!/bin/sh +# USAGE: clapham +# Requires all of the clapham dependency jars to be in clapham.d in the same directory +# as this script. + +CLAPHAM=`dirname $0`/clapham.d +OUTDIR=clapham-$$ +CP=`find ${CLAPHAM} -name \*.jar | xargs echo | sed 's/ /:/g'` + +# Run clapham, generating the images into OUTDIR +java -cp $CP net.hydromatic.clapham.Clapham -d ${OUTDIR} $1 + +# Collect all of the jars and build a containing SVG, offsetting each included SVG by +# the height of the previous SVG +echo "" > $2 +height=0 +for x in ${OUTDIR}/*.svg +do + echo "" >> $2 + cat $x | egrep -v '(<\?xml)|(> $2 + echo "" >> $2 + newheight=`egrep -o '" >> $2 + +# Clean up +rm -rf ${OUTDIR} diff --git a/contrib/plantuml b/contrib/plantuml new file mode 100755 --- /dev/null +++ b/contrib/plantuml @@ -0,0 +1,12 @@ +#!/bin/sh +# USAGE: plantuml +# Requires plantuml.jar to be located in the same directory as this script + +TMP_INFILE=/tmp/plantuml_tmpfile.$$ +TMP_OUTFILE=${TMP_INFILE}.svg +PLANTUMLJAR=`dirname $0`/plantuml.jar + +cp $2 $TMP_INFILE +java -jar $PLANTUMLJAR -t$1 $TMP_INFILE +cp $TMP_OUTFILE $3 +rm $TMP_INFILE $TMP_OUTFILE diff --git a/rml.rb b/rml.rb --- a/rml.rb +++ b/rml.rb @@ -84,6 +84,7 @@ end if options[:config] and File.exists?(options[:config]) IO.readlines(options[:config]).each do |line| + next if line =~ /^((#.*)|(\s*))$/ app, arg = line.split(/=/, 2) arg, ext = arg.split(/\|/, 2) apps[app] = [arg, ext.strip] diff --git a/rmlrc b/rmlrc --- a/rmlrc +++ b/rmlrc @@ -1,2 +1,15 @@ -aafigure=aafigure -t png -o $RML_OUTPUT $RML_INPUT | png -dot=dot -o $RML_OUTPUT -T png $RML_INPUT | png +# Depends: http://packages.python.org/aafigure/ +aafigure=aafigure -t svg -o $RML_OUTPUT $RML_INPUT | svg + +# Depends: http://www.graphviz.org/ +dot=dot -o $RML_OUTPUT -T svg $RML_INPUT | svg + +# See contrib/plantuml +# Depends: http://plantuml.sourceforge.net/ +uml=plantuml svg $RML_INPUT $RML_OUTPUT | svg + +# See contrib/clapham. +# Depends: http://clapham.hydromatic.net/ +railroad=clapham $RML_INPUT $RML_OUTPUT | svg + +# ASCIIMath, WebMath