← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6596: Added script for compiling the inline xml content from the docbx chapters

 

------------------------------------------------------------
revno: 6596
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-04-16 12:37:16 +0200
message:
  Added script for compiling the inline xml content from the docbx chapters
added:
  resources/util/compile_help_content.sh


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== added file 'resources/util/compile_help_content.sh'
--- resources/util/compile_help_content.sh	1970-01-01 00:00:00 +0000
+++ resources/util/compile_help_content.sh	2012-04-16 10:37:16 +0000
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+# Reads all dhis2_user_man_* files found from the current path and writes to file
+
+CONTENT_FILE="help_content.xml"
+
+INCLUDE_FILES=`find . -name "dhis2_user_man_*xml" -type f -printf "%f\n"`
+
+echo "Including the following files:"
+echo ${INCLUDE_FILES[@]}
+
+rm -f ${CONTENT_FILE}
+touch ${CONTENT_FILE}
+
+echo "<book>" >> ${CONTENT_FILE}
+
+for FILENAME in ${INCLUDE_FILES[@]}
+do
+  while read -r LINE
+  do
+    if [[ ${LINE} =~ (<\?xml|<!DOCTYPE|<!ENTITY) ]]; then
+      echo "Ignored ${LINE}"
+    else
+      echo ${LINE} >> ${CONTENT_FILE}
+    fi
+  done < ${FILENAME}
+done
+
+echo "</book>" >> ${CONTENT_FILE}
+
+echo "Done"