A => contrib/clapham +28 -0
@@ 0,0 1,28 @@
+#!/bin/sh
+# USAGE: clapham <INFILE> <OUTFILE>
+# 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 "<svg xmlns='http://www.w3.org/2000/svg'>" > $2
+height=0
+for x in ${OUTDIR}/*.svg
+do
+ echo "<g transform='translate(0,${height})'>" >> $2
+ cat $x | egrep -v '(<\?xml)|(<!DOCTYPE)' >> $2
+ echo "</g>" >> $2
+ newheight=`egrep -o '<svg height="([0-9]*)"' $x | egrep -o '[0-9]+'`
+ height=`expr $height + $newheight`
+done
+echo "</svg>" >> $2
+
+# Clean up
+rm -rf ${OUTDIR}
A => contrib/plantuml +12 -0
@@ 0,0 1,12 @@
+#!/bin/sh
+# USAGE: plantuml <OUTFORMAT> <INFILE> <OUTFILE>
+# 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
M rml.rb +1 -0
@@ 84,6 84,7 @@ if File.exists?(config)
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]
M rmlrc +15 -2
@@ 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