summaryrefslogtreecommitdiff
path: root/db2html
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-08-01 13:53:15 +0000
committerCoprDistGit <infra@openeuler.org>2024-08-01 13:53:15 +0000
commita841aebecd86228ea94f801d5fb9259c035829f8 (patch)
tree9b8f17c4f7799054a82112fe3c88aba13649c438 /db2html
parent5a18b4b085bb1f0c8f7972a67c11a9decd7d79be (diff)
automatic import of docbook-utilsopeneuler24.03_LTS
Diffstat (limited to 'db2html')
-rwxr-xr-xdb2html59
1 files changed, 59 insertions, 0 deletions
diff --git a/db2html b/db2html
new file mode 100755
index 0000000..ca94b82
--- /dev/null
+++ b/db2html
@@ -0,0 +1,59 @@
+#! /bin/sh
+
+ADMON_GRAPHICS=/usr/share/sgml/docbook/dsssl-stylesheets/images/*.gif
+
+output=docbook2html-dir
+skip=0
+dbdircleanup=1
+outputdone=0
+for arg in "$@"
+do
+ if [ $skip -gt 0 ]
+ then
+ skip=$(($skip - 1))
+ continue
+ fi
+ case $arg in
+ -h|--help|-v|--version) break
+ ;;
+ -n|--nostd|-u|--nochunks) ;;
+ -o|--output) outputdone=1
+ ;;
+
+ -*) skip=1
+ ;;
+ *) dbdircleanup=0
+ if [ ${outputdone} -eq 1 ];
+ then
+ output="$(echo $arg | sed 's,\.sgml$,,;s,\.sgm$,,;s,\.xml,,')"
+ outputfile="$basename "$output""
+ outputdone=2
+ elif [ ${outputdone} -eq 2 ];
+ then
+ outputfile="$(echo $arg | sed 's,\.sgml$,,;s,\.sgm$,,;s,\.xml,,' | \
+ rev | cut -d'/' -f1 | rev)"
+ else
+ output="$(echo $arg | sed 's,\.sgml$,,;s,\.sgm$,,;s,\.xml,,')"
+ outputfile=$(basename "$output")
+ fi
+ ;;
+ esac
+done
+
+if [ ${dbdircleanup} -eq 0 ];
+then
+ echo "Output is $output/$outputfile.html"
+fi
+if [ -d ${output} ]
+then
+ rm -rf ${output}.junk
+ mv ${output} ${output}.junk
+fi
+mkdir ${output}
+mkdir ${output}/stylesheet-images
+cp ${ADMON_GRAPHICS} ${output}/stylesheet-images
+jw -f docbook -b html -o ${output} "$@"
+if [ ${dbdircleanup} -eq 1 ];
+then
+ rm -rf ${output}
+fi