diff options
author | Anas Nashif <anas.nashif@intel.com> | 2012-11-06 21:13:37 -0800 |
---|---|---|
committer | Anas Nashif <anas.nashif@intel.com> | 2012-11-06 21:13:37 -0800 |
commit | 406716225c95ba3ba5ab14b2ce93667225f0ad80 (patch) | |
tree | d9181981542907ab562103e6f71eaf6914e1fd41 /format/docbook | |
download | xmlto-406716225c95ba3ba5ab14b2ce93667225f0ad80.tar.gz xmlto-406716225c95ba3ba5ab14b2ce93667225f0ad80.tar.bz2 xmlto-406716225c95ba3ba5ab14b2ce93667225f0ad80.zip |
Imported Upstream version 0.0.25upstream/0.0.25
Diffstat (limited to 'format/docbook')
-rwxr-xr-x | format/docbook/awt | 18 | ||||
-rwxr-xr-x | format/docbook/dvi | 32 | ||||
-rwxr-xr-x | format/docbook/epub | 28 | ||||
-rwxr-xr-x | format/docbook/fo | 12 | ||||
-rwxr-xr-x | format/docbook/html | 12 | ||||
-rwxr-xr-x | format/docbook/html-nochunks | 12 | ||||
-rwxr-xr-x | format/docbook/htmlhelp | 12 | ||||
-rwxr-xr-x | format/docbook/javahelp | 12 | ||||
-rwxr-xr-x | format/docbook/man | 13 | ||||
-rwxr-xr-x | format/docbook/mif | 18 | ||||
-rwxr-xr-x | format/docbook/pcl | 18 | ||||
-rwxr-xr-x | format/docbook/pdf | 37 | ||||
-rwxr-xr-x | format/docbook/ps | 37 | ||||
-rwxr-xr-x | format/docbook/svg | 18 | ||||
-rwxr-xr-x | format/docbook/txt | 61 | ||||
-rwxr-xr-x | format/docbook/xhtml | 12 | ||||
-rwxr-xr-x | format/docbook/xhtml-nochunks | 12 |
17 files changed, 364 insertions, 0 deletions
diff --git a/format/docbook/awt b/format/docbook/awt new file mode 100755 index 0000000..bb54946 --- /dev/null +++ b/format/docbook/awt @@ -0,0 +1,18 @@ +case "$1" in +stylesheet) + if [ "$VERBOSE" -ge 1 ] + then + echo >&2 "Convert to XSL-FO" + fi + echo "http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl" + ;; +post-process) + EXT=$(basename "$0") + if [ "$VERBOSE" -ge 1 ] + then + echo >&2 "Convert to ${EXT}" + fi + # Get the FO format script to do the rest + sh "$(dirname "$0")/../fo/${EXT}" "$1" + ;; +esac diff --git a/format/docbook/dvi b/format/docbook/dvi new file mode 100755 index 0000000..a48be6b --- /dev/null +++ b/format/docbook/dvi @@ -0,0 +1,32 @@ +case "$USE_BACKEND" in +DEFAULT|FOP) + case "$1" in + stylesheet) + if [ "$VERBOSE" -ge 1 ] + then + echo >&2 "Convert to XSL-FO" + fi + echo "http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl" + ;; + post-process) + # Get the FO format script to do the rest + sh "$(dirname "$0")/../fo/$(basename "$0")" "$1" + ;; + esac + ;; +DBLATEX) + EXT=$(basename "$0") + case "$1" in + stylesheet) + ;; + post-process) + if [ "$VERBOSE" -ge 1 ] + then + echo >&2 "Convert to ${EXT}" + POSTARGS="${POSTARGS} --verbose" + fi + "$DBLATEX_PATH" ${POSTARGS} -P doc.collab.show=0 -P latex.output.revhistory=0 "${XSLT_PROCESSED}" --"${EXT}" --output="$OUTPUT_DIR/$(basename ${XSLT_PROCESSED%.*}).${EXT}" + ;; + esac + ;; +esac diff --git a/format/docbook/epub b/format/docbook/epub new file mode 100755 index 0000000..1c854fa --- /dev/null +++ b/format/docbook/epub @@ -0,0 +1,28 @@ +if [ -z "`type -t $ZIP_PATH`" ] +then + echo >&2 "Missing zip utility at $ZIP_PATH, conversion to epub not possible." + echo >&2 "Exiting !" + exit 3 +fi + +case "$1" in + stylesheet) + if [ "$VERBOSE" -ge 1 ] + then + echo >&2 "Converting Docbook to epub" + fi + echo "http://docbook.sourceforge.net/release/xsl/current/epub/docbook.xsl" + ;; + post-process) + if [ "$VERBOSE" -ge 1 ] + then + echo >&2 "Creating epub file" + fi + echo "application/epub+zip" > mimetype + EPUB_NAME=$(basename "${XSLT_PROCESSED%.*}").epub + [ -e "$XSLT_PROCESSED" ] && rm "$XSLT_PROCESSED" + ${ZIP_PATH} -0Xq $EPUB_NAME mimetype + ${ZIP_PATH} -Xr9D $EPUB_NAME * + ${GCP_PATH:-cp} -R -P -p -- $EPUB_NAME "$OUTPUT_DIR" 2>/dev/null + ;; +esac diff --git a/format/docbook/fo b/format/docbook/fo new file mode 100755 index 0000000..8b4f200 --- /dev/null +++ b/format/docbook/fo @@ -0,0 +1,12 @@ +case "$1" in +stylesheet) + if [ "$VERBOSE" -ge 1 ] + then + echo >&2 "Convert to XSL-FO" + fi + echo "http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl" + ;; +post-process) + ${GCP_PATH:-cp} -R -P -p -- "$XSLT_PROCESSED" "$OUTPUT_DIR/$(basename "${XSLT_PROCESSED%.*}").fo" + ;; +esac diff --git a/format/docbook/html b/format/docbook/html new file mode 100755 index 0000000..3b2cd71 --- /dev/null +++ b/format/docbook/html @@ -0,0 +1,12 @@ +case "$1" in +stylesheet) + if [ "$VERBOSE" -ge 1 ] + then + echo >&2 "Convert to HTML (with chunks)" + fi + echo "http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl" + ;; +post-process) + ${GCP_PATH:-cp} -R -P -p -- * "$OUTPUT_DIR" + ;; +esac diff --git a/format/docbook/html-nochunks b/format/docbook/html-nochunks new file mode 100755 index 0000000..82b635b --- /dev/null +++ b/format/docbook/html-nochunks @@ -0,0 +1,12 @@ +case "$1" in +stylesheet) + if [ "$VERBOSE" -ge 1 ] + then + echo >&2 "Convert to HTML (no chunks)" + fi + echo "http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl" + ;; +post-process) + ${GCP_PATH:-cp} -R -P -p -- "$XSLT_PROCESSED" "$OUTPUT_DIR/$(basename "${XSLT_PROCESSED%.*}").html" + ;; +esac diff --git a/format/docbook/htmlhelp b/format/docbook/htmlhelp new file mode 100755 index 0000000..01553df --- /dev/null +++ b/format/docbook/htmlhelp @@ -0,0 +1,12 @@ +case "$1" in +stylesheet) + if [ "$VERBOSE" -ge 1 ] + then + echo >&2 "Convert to htmlhelp" + fi + echo "http://docbook.sourceforge.net/release/xsl/current/htmlhelp/htmlhelp.xsl" + ;; +post-process) + ${GCP_PATH:-cp} -R -P -p -- * "$OUTPUT_DIR" + ;; +esac diff --git a/format/docbook/javahelp b/format/docbook/javahelp new file mode 100755 index 0000000..57710f0 --- /dev/null +++ b/format/docbook/javahelp @@ -0,0 +1,12 @@ +case "$1" in +stylesheet) + if [ "$VERBOSE" -ge 1 ] + then + echo >&2 "Convert to javahelp" + fi + echo "http://docbook.sourceforge.net/release/xsl/current/javahelp/javahelp.xsl" + ;; +post-process) + ${GCP_PATH:-cp} -R -P -p -- *.htm* *.hs *.xml *.jhm "$OUTPUT_DIR" + ;; +esac diff --git a/format/docbook/man b/format/docbook/man new file mode 100755 index 0000000..525b03b --- /dev/null +++ b/format/docbook/man @@ -0,0 +1,13 @@ +case "$1" in +stylesheet) + if [ "$VERBOSE" -ge 1 ] + then + echo >&2 "Convert to troff" + fi + echo "http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl" + ;; +post-process) + [ -e "$XSLT_PROCESSED" ] && rm "$XSLT_PROCESSED" + ${GCP_PATH:-cp} -R -P -p -- * "$OUTPUT_DIR" 2>/dev/null + ;; +esac diff --git a/format/docbook/mif b/format/docbook/mif new file mode 100755 index 0000000..bb54946 --- /dev/null +++ b/format/docbook/mif @@ -0,0 +1,18 @@ +case "$1" in +stylesheet) + if [ "$VERBOSE" -ge 1 ] + then + echo >&2 "Convert to XSL-FO" + fi + echo "http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl" + ;; +post-process) + EXT=$(basename "$0") + if [ "$VERBOSE" -ge 1 ] + then + echo >&2 "Convert to ${EXT}" + fi + # Get the FO format script to do the rest + sh "$(dirname "$0")/../fo/${EXT}" "$1" + ;; +esac diff --git a/format/docbook/pcl b/format/docbook/pcl new file mode 100755 index 0000000..a7889b1 --- /dev/null +++ b/format/docbook/pcl @@ -0,0 +1,18 @@ +case "$1" in +stylesheet) + if [ "$VERBOSE" -ge 1 ] + then + echo >&2 "Convert to XSL-FO" + fi + echo "http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl" + ;; +post-process) + EXT=$(basename "$0") + if [ "$VERBOSE" -ge 1 ] + then + echo >&2 "Convert to ${EXT}" + fi + # Get the FO format script to do the rest + sh "$(dirname "$0")/../fo/${EXT}" "$1" + ;; +esac diff --git a/format/docbook/pdf b/format/docbook/pdf new file mode 100755 index 0000000..86fc423 --- /dev/null +++ b/format/docbook/pdf @@ -0,0 +1,37 @@ +case "$USE_BACKEND" in +DEFAULT|FOP) + case "$1" in + stylesheet) + if [ "$VERBOSE" -ge 1 ] + then + echo >&2 "Convert to XSL-FO" + fi + echo "http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl" + ;; + post-process) + EXT=$(basename "$0") + if [ "$VERBOSE" -ge 1 ] + then + echo >&2 "Convert to ${EXT}" + fi + # Get the FO format script to do the rest + sh "$(dirname "$0")/../fo/${EXT}" "$1" + ;; + esac + ;; +DBLATEX) + EXT=$(basename "$0") + case "$1" in + stylesheet) + ;; + post-process) + if [ "$VERBOSE" -ge 1 ] + then + echo >&2 "Convert to ${EXT}" + POSTARGS="${POSTARGS} --verbose" + fi + "$DBLATEX_PATH" ${POSTARGS} -P doc.collab.show=0 -P latex.output.revhistory=0 "${XSLT_PROCESSED}" --"${EXT}" --output="$OUTPUT_DIR/$(basename ${XSLT_PROCESSED%.*}).${EXT}" + ;; + esac + ;; +esac diff --git a/format/docbook/ps b/format/docbook/ps new file mode 100755 index 0000000..86fc423 --- /dev/null +++ b/format/docbook/ps @@ -0,0 +1,37 @@ +case "$USE_BACKEND" in +DEFAULT|FOP) + case "$1" in + stylesheet) + if [ "$VERBOSE" -ge 1 ] + then + echo >&2 "Convert to XSL-FO" + fi + echo "http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl" + ;; + post-process) + EXT=$(basename "$0") + if [ "$VERBOSE" -ge 1 ] + then + echo >&2 "Convert to ${EXT}" + fi + # Get the FO format script to do the rest + sh "$(dirname "$0")/../fo/${EXT}" "$1" + ;; + esac + ;; +DBLATEX) + EXT=$(basename "$0") + case "$1" in + stylesheet) + ;; + post-process) + if [ "$VERBOSE" -ge 1 ] + then + echo >&2 "Convert to ${EXT}" + POSTARGS="${POSTARGS} --verbose" + fi + "$DBLATEX_PATH" ${POSTARGS} -P doc.collab.show=0 -P latex.output.revhistory=0 "${XSLT_PROCESSED}" --"${EXT}" --output="$OUTPUT_DIR/$(basename ${XSLT_PROCESSED%.*}).${EXT}" + ;; + esac + ;; +esac diff --git a/format/docbook/svg b/format/docbook/svg new file mode 100755 index 0000000..a7889b1 --- /dev/null +++ b/format/docbook/svg @@ -0,0 +1,18 @@ +case "$1" in +stylesheet) + if [ "$VERBOSE" -ge 1 ] + then + echo >&2 "Convert to XSL-FO" + fi + echo "http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl" + ;; +post-process) + EXT=$(basename "$0") + if [ "$VERBOSE" -ge 1 ] + then + echo >&2 "Convert to ${EXT}" + fi + # Get the FO format script to do the rest + sh "$(dirname "$0")/../fo/${EXT}" "$1" + ;; +esac diff --git a/format/docbook/txt b/format/docbook/txt new file mode 100755 index 0000000..fe42a1f --- /dev/null +++ b/format/docbook/txt @@ -0,0 +1,61 @@ +case "$USE_BACKEND" in +DEFAULT|DBLATEX) + if [ -n "`type -t $W3M_PATH`" ] + then + CONVERT="$W3M_PATH" + ARGS="-T text/html -dump" + elif [ -n "`type -t $LYNX_PATH`" ] + then + CONVERT="$LYNX_PATH" + ARGS="-force_html -dump -nolist -width=72" + elif [ -n "`type -t $LINKS_PATH`" ] + then + CONVERT="$LINKS_PATH" + ARGS="-dump" + else + echo >&2 "No way to convert HTML to text found." + echo >&2 "Try either installing text web browser(lynx/w3m/links) or use option --with-fop" + exit 3 + fi + + case "$1" in + stylesheet) + if [ "$VERBOSE" -ge 1 ] + then + echo >&2 "Convert to HTML (no chunks)" + fi + echo "http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl" + ;; + post-process) + if [ "$VERBOSE" -ge 1 ] + then + echo >&2 "Convert HTML to ASCII" + BASENAMEFILE="`basename ${XSLT_PROCESSED%.}`" + echo >&2 "Using : \"${CONVERT} ${ARGS} ${POSTARGS} ${XSLT_PROCESSED} > $OUTPUT_DIR/${BASENAMEFILE}.txt\"" + fi + ${CONVERT} ${ARGS} ${POSTARGS} "${XSLT_PROCESSED}" > \ + "$OUTPUT_DIR/$(basename "${XSLT_PROCESSED%.*}").txt" + ;; + esac +;; +FOP) + case "$1" in + stylesheet) + if [ "$VERBOSE" -ge 1 ] + then + echo >&2 "Convert to XSL-FO" + fi + echo "http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl" + ;; + post-process) + EXT=$(basename "$0") + if [ "$VERBOSE" -ge 1 ] + then + echo >&2 "Convert to ${EXT}" + fi + # Get the FO format script to do the rest + sh "$(dirname "$0")/../fo/${EXT}" "$1" + ;; + esac +;; +esac diff --git a/format/docbook/xhtml b/format/docbook/xhtml new file mode 100755 index 0000000..8204549 --- /dev/null +++ b/format/docbook/xhtml @@ -0,0 +1,12 @@ +case "$1" in +stylesheet) + if [ "$VERBOSE" -ge 1 ] + then + echo >&2 "Convert to XHTML (with chunks)" + fi + echo "http://docbook.sourceforge.net/release/xsl/current/xhtml/chunk.xsl" + ;; +post-process) + ${GCP_PATH:-cp} -R -P -p -- *.*htm* "$OUTPUT_DIR" + ;; +esac diff --git a/format/docbook/xhtml-nochunks b/format/docbook/xhtml-nochunks new file mode 100755 index 0000000..82b555d --- /dev/null +++ b/format/docbook/xhtml-nochunks @@ -0,0 +1,12 @@ +case "$1" in +stylesheet) + if [ "$VERBOSE" -ge 1 ] + then + echo >&2 "Convert to XHTML (no chunks)" + fi + echo "http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl" + ;; +post-process) + ${GCP_PATH:-cp} -R -P -p -- "$XSLT_PROCESSED" "$OUTPUT_DIR/$(basename ${XSLT_PROCESSED%.*}).html" + ;; +esac |