summaryrefslogtreecommitdiff
path: root/tools/spec-to-docbook.in
diff options
context:
space:
mode:
authorRob Taylor <rob.taylor@codethink.co.uk>2007-03-28 17:58:56 +0100
committerRob Taylor <rob.taylor@codethink.co.uk>2007-03-28 17:58:56 +0100
commit729fdf43b7a76d4861cdb28f1bc65be2bf8989f9 (patch)
tree72ce292bbcabc5665bebb64db6fd26874bbf61a5 /tools/spec-to-docbook.in
Initial Commit of dbus-docHEADmaster
Creates seperate D-Bus intropsection documentation project from Jon McCann's documentation tools in ConsoleKit. README and TODO are from his posts to the D-Bus mailing list.
Diffstat (limited to 'tools/spec-to-docbook.in')
-rwxr-xr-xtools/spec-to-docbook.in32
1 files changed, 32 insertions, 0 deletions
diff --git a/tools/spec-to-docbook.in b/tools/spec-to-docbook.in
new file mode 100755
index 0000000..e78d1f7
--- /dev/null
+++ b/tools/spec-to-docbook.in
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+CMD=xsltproc
+XSL=@xsldir@/spec-to-docbook.xsl
+
+if test "x$1" = "x" -o "x$1" = "x-h" -o "x$1" = "x--help"; then
+ echo "usage: $0 [file] ..."
+ exit 1
+fi
+
+if [ ! -r ${XSL} ]; then
+ echo "Cannot find XSLT file"
+ exit 1
+fi
+
+FILES="$@"
+for FILE in $FILES; do
+ echo "${FILE}" | grep ".xml$" > /dev/null
+ if [ $? -ne 0 ]; then
+ echo "Skipping non-xml file: ${FILE}"
+ continue
+ fi
+
+ d=`dirname ${FILE}`
+ b=`basename ${FILE} .xml`
+
+ outfile="ref-${b}.xml"
+ echo "Creating: ${outfile}"
+ ${CMD} ${XSL} ${FILE} | tail -n +2 > ${outfile}
+done
+
+exit 0