From 89e03451f9907e8697642fd2b374f7fa366c0443 Mon Sep 17 00:00:00 2001 From: Packit Service Date: Dec 09 2020 12:29:18 +0000 Subject: Prepare for a new update Reverting patches so we can apply the latest update and changes can be seen in the spec file and sources. --- diff --git a/backends/dvi b/backends/dvi index 8646065..ace0cf8 100644 --- a/backends/dvi +++ b/backends/dvi @@ -6,31 +6,31 @@ TEXINPUTS="$(dirname "${SGML_FILE}"):${TEXINPUTS}" export TEXINPUTS # Convert to TeX -$SGML_JADE -t tex -o "${SGML_FILE_NAME}.tex" $SGML_ARGUMENTS "$SGML_FILE" +$SGML_JADE -t tex -o ${SGML_FILE_NAME}.tex $SGML_ARGUMENTS if [ $? -ne 0 ] then exit 1 fi # Convert from TeX to DVI -jadetex "${SGML_FILE_NAME}.tex" > "${SGML_FILE_NAME}.tmp" +jadetex ${SGML_FILE_NAME}.tex >${SGML_FILE_NAME}.tmp if [ $? -ne 0 ] then - cat "${SGML_FILE_NAME}.tmp" - rm "${SGML_FILE_NAME}.tmp" - rm "${SGML_FILE_NAME}.tex" + cat ${SGML_FILE_NAME}.tmp + rm ${SGML_FILE_NAME}.tmp + rm ${SGML_FILE_NAME}.tex exit 2 fi -rm "${SGML_FILE_NAME}.tmp" +rm ${SGML_FILE_NAME}.tmp # If there are unresolved references, re-run jadetex, twice -if egrep '^LaTeX Warning: There were undefined references.$' "${SGML_FILE_NAME}.log" >/dev/null 2>&1 +if egrep '^LaTeX Warning: There were undefined references.$' ${SGML_FILE_NAME}.log >/dev/null 2>&1 then - jadetex "${SGML_FILE_NAME}.tex" >/dev/null - jadetex "${SGML_FILE_NAME}.tex" >/dev/null + jadetex ${SGML_FILE_NAME}.tex >/dev/null + jadetex ${SGML_FILE_NAME}.tex >/dev/null fi -rm "${SGML_FILE_NAME}.log" -rm "${SGML_FILE_NAME}.aux" -rm "${SGML_FILE_NAME}.tex" -rm "${SGML_FILE_NAME}.out" +rm ${SGML_FILE_NAME}.log +rm ${SGML_FILE_NAME}.aux +rm ${SGML_FILE_NAME}.tex +rm ${SGML_FILE_NAME}.out exit 0 diff --git a/backends/dvi.2ndspaces b/backends/dvi.2ndspaces deleted file mode 100644 index ace0cf8..0000000 --- a/backends/dvi.2ndspaces +++ /dev/null @@ -1,36 +0,0 @@ -# Backend to convert something into DVI -# Send any comments to Eric Bischoff -# This program is under GPL license. See LICENSE file for details. - -TEXINPUTS="$(dirname "${SGML_FILE}"):${TEXINPUTS}" -export TEXINPUTS - -# Convert to TeX -$SGML_JADE -t tex -o ${SGML_FILE_NAME}.tex $SGML_ARGUMENTS -if [ $? -ne 0 ] -then exit 1 -fi - -# Convert from TeX to DVI -jadetex ${SGML_FILE_NAME}.tex >${SGML_FILE_NAME}.tmp -if [ $? -ne 0 ] -then - cat ${SGML_FILE_NAME}.tmp - rm ${SGML_FILE_NAME}.tmp - rm ${SGML_FILE_NAME}.tex - exit 2 -fi -rm ${SGML_FILE_NAME}.tmp - -# If there are unresolved references, re-run jadetex, twice -if egrep '^LaTeX Warning: There were undefined references.$' ${SGML_FILE_NAME}.log >/dev/null 2>&1 -then - jadetex ${SGML_FILE_NAME}.tex >/dev/null - jadetex ${SGML_FILE_NAME}.tex >/dev/null -fi -rm ${SGML_FILE_NAME}.log -rm ${SGML_FILE_NAME}.aux -rm ${SGML_FILE_NAME}.tex -rm ${SGML_FILE_NAME}.out - -exit 0 diff --git a/backends/html b/backends/html index ae32a32..ee301f6 100644 --- a/backends/html +++ b/backends/html @@ -3,7 +3,7 @@ # This program is under GPL license. See LICENSE file for details. # Convert to HTML -$SGML_JADE -t sgml $SGML_ARGUMENTS "$SGML_FILE" +$SGML_JADE -t sgml $SGML_ARGUMENTS if [ $? -ne 0 ] then exit 1 fi diff --git a/backends/html.2ndspaces b/backends/html.2ndspaces deleted file mode 100644 index ee301f6..0000000 --- a/backends/html.2ndspaces +++ /dev/null @@ -1,11 +0,0 @@ -# Backend to convert something into HTML -# Send any comments to Eric Bischoff -# This program is under GPL license. See LICENSE file for details. - -# Convert to HTML -$SGML_JADE -t sgml $SGML_ARGUMENTS -if [ $? -ne 0 ] -then exit 1 -fi - -exit 0 diff --git a/backends/man.in b/backends/man.in index 163e72f..e95d3c6 100644 --- a/backends/man.in +++ b/backends/man.in @@ -7,7 +7,7 @@ HELPER=$SGML_BASE_DIR/docbook/utils-@VERSION@/helpers/docbook2man-spec.pl TMPDIR=`mktemp -d /tmp/man.XXXXXX` || \ { echo >&2 "man backend: could not create secure temporary directory"; exit 1;} trap 'rm -rf "${TMPDIR}"' EXIT -nsgmls ${SGML_INCLUDE} "$SGML_FILE" > "${TMPDIR}/nsgmls.tmp" +nsgmls $SGML_FILE > "${TMPDIR}/nsgmls.tmp" sgmlspl $HELPER <"${TMPDIR}/nsgmls.tmp" 2>"${TMPDIR}/errs" if [ $? -ne 0 ] then diff --git a/backends/man.in.2ndspaces b/backends/man.in.2ndspaces deleted file mode 100644 index e95d3c6..0000000 --- a/backends/man.in.2ndspaces +++ /dev/null @@ -1,27 +0,0 @@ -# Backend to convert a DocBook file into a man page -# Send any comments to Jochem Huhmann -# This program is under GPL license. See LICENSE file for details. - -# Convert to *roff -HELPER=$SGML_BASE_DIR/docbook/utils-@VERSION@/helpers/docbook2man-spec.pl -TMPDIR=`mktemp -d /tmp/man.XXXXXX` || \ - { echo >&2 "man backend: could not create secure temporary directory"; exit 1;} -trap 'rm -rf "${TMPDIR}"' EXIT -nsgmls $SGML_FILE > "${TMPDIR}/nsgmls.tmp" -sgmlspl $HELPER <"${TMPDIR}/nsgmls.tmp" 2>"${TMPDIR}/errs" -if [ $? -ne 0 ] -then - cat "${TMPDIR}/errs" - exit 1 -fi - -if grep unresolved "${TMPDIR}/errs" >/dev/null 2>&1 -then - echo "Resolving references.." - sgmlspl $HELPER <"${TMPDIR}/nsgmls.tmp" - if [ $? -ne 0 ] - then exit 1 - fi -fi - -exit 0 diff --git a/backends/man.in.sgmlinclude b/backends/man.in.sgmlinclude deleted file mode 100644 index 9fe9d3b..0000000 --- a/backends/man.in.sgmlinclude +++ /dev/null @@ -1,27 +0,0 @@ -# Backend to convert a DocBook file into a man page -# Send any comments to Jochem Huhmann -# This program is under GPL license. See LICENSE file for details. - -# Convert to *roff -HELPER=$SGML_BASE_DIR/docbook/utils-@VERSION@/helpers/docbook2man-spec.pl -TMPDIR=`mktemp -d /tmp/man.XXXXXX` || \ - { echo >&2 "man backend: could not create secure temporary directory"; exit 1;} -trap 'rm -rf "${TMPDIR}"' EXIT -nsgmls "$SGML_FILE" > "${TMPDIR}/nsgmls.tmp" -sgmlspl $HELPER <"${TMPDIR}/nsgmls.tmp" 2>"${TMPDIR}/errs" -if [ $? -ne 0 ] -then - cat "${TMPDIR}/errs" - exit 1 -fi - -if grep unresolved "${TMPDIR}/errs" >/dev/null 2>&1 -then - echo "Resolving references.." - sgmlspl $HELPER <"${TMPDIR}/nsgmls.tmp" - if [ $? -ne 0 ] - then exit 1 - fi -fi - -exit 0 diff --git a/backends/pdf b/backends/pdf index dd3e270..d292f46 100644 --- a/backends/pdf +++ b/backends/pdf @@ -6,26 +6,26 @@ TEXINPUTS="$(dirname "${SGML_FILE}"):${TEXINPUTS}" export TEXINPUTS # Convert to TeX -$SGML_JADE -t tex -o "${SGML_FILE_NAME}.tex" $SGML_ARGUMENTS "$SGML_FILE" +$SGML_JADE -t tex -o ${SGML_FILE_NAME}.tex $SGML_ARGUMENTS if [ $? -ne 0 ] then exit 1 fi # Convert from TeX to PDF -pdfjadetex "${SGML_FILE_NAME}.tex" > "${SGML_FILE_NAME}.tmp" +pdfjadetex ${SGML_FILE_NAME}.tex >${SGML_FILE_NAME}.tmp if [ $? -ne 0 ] then - cat "${SGML_FILE_NAME}.tmp" - rm "${SGML_FILE_NAME}.tmp" - rm "${SGML_FILE_NAME}.tex" + cat ${SGML_FILE_NAME}.tmp + rm ${SGML_FILE_NAME}.tmp + rm ${SGML_FILE_NAME}.tex exit 2 fi -rm "${SGML_FILE_NAME}.tmp" +rm ${SGML_FILE_NAME}.tmp # Unconditionally re-run pdfjadetex, twice -pdfjadetex "${SGML_FILE_NAME}.tex" >/dev/null -pdfjadetex "${SGML_FILE_NAME}.tex" >/dev/null -rm -f "${SGML_FILE_NAME}.log" "${SGML_FILE_NAME}.aux" \ - "${SGML_FILE_NAME}.tex" "${SGML_FILE_NAME}.out" +pdfjadetex ${SGML_FILE_NAME}.tex >/dev/null +pdfjadetex ${SGML_FILE_NAME}.tex >/dev/null +rm -f ${SGML_FILE_NAME}.log ${SGML_FILE_NAME}.aux \ + ${SGML_FILE_NAME}.tex ${SGML_FILE_NAME}.out exit 0 diff --git a/backends/pdf.2ndspaces b/backends/pdf.2ndspaces deleted file mode 100644 index d292f46..0000000 --- a/backends/pdf.2ndspaces +++ /dev/null @@ -1,31 +0,0 @@ -# Backend to convert something into PDF -# Send any comments to Eric Bischoff -# This program is under GPL license. See LICENSE file for details. - -TEXINPUTS="$(dirname "${SGML_FILE}"):${TEXINPUTS}" -export TEXINPUTS - -# Convert to TeX -$SGML_JADE -t tex -o ${SGML_FILE_NAME}.tex $SGML_ARGUMENTS -if [ $? -ne 0 ] -then exit 1 -fi - -# Convert from TeX to PDF -pdfjadetex ${SGML_FILE_NAME}.tex >${SGML_FILE_NAME}.tmp -if [ $? -ne 0 ] -then - cat ${SGML_FILE_NAME}.tmp - rm ${SGML_FILE_NAME}.tmp - rm ${SGML_FILE_NAME}.tex - exit 2 -fi -rm ${SGML_FILE_NAME}.tmp - -# Unconditionally re-run pdfjadetex, twice -pdfjadetex ${SGML_FILE_NAME}.tex >/dev/null -pdfjadetex ${SGML_FILE_NAME}.tex >/dev/null -rm -f ${SGML_FILE_NAME}.log ${SGML_FILE_NAME}.aux \ - ${SGML_FILE_NAME}.tex ${SGML_FILE_NAME}.out - -exit 0 diff --git a/backends/ps b/backends/ps index 91d7ebf..160c63b 100644 --- a/backends/ps +++ b/backends/ps @@ -6,30 +6,30 @@ TEXINPUTS="$(dirname "${SGML_FILE}"):${TEXINPUTS}" export TEXINPUTS # Convert to TeX -$SGML_JADE -t tex -o "${SGML_FILE_NAME}.tex" $SGML_ARGUMENTS "$SGML_FILE" +$SGML_JADE -t tex -o ${SGML_FILE_NAME}.tex $SGML_ARGUMENTS if [ $? -ne 0 ] then exit 1 fi # Convert from TeX to DVI -jadetex "${SGML_FILE_NAME}.tex" > "${SGML_FILE_NAME}.tmp" +jadetex ${SGML_FILE_NAME}.tex >${SGML_FILE_NAME}.tmp if [ $? -ne 0 ] then - cat "${SGML_FILE_NAME}.tmp" - rm "${SGML_FILE_NAME}.tmp" - rm "${SGML_FILE_NAME}.tex" + cat ${SGML_FILE_NAME}.tmp + rm ${SGML_FILE_NAME}.tmp + rm ${SGML_FILE_NAME}.tex exit 2 fi -rm "${SGML_FILE_NAME}.tmp" +rm ${SGML_FILE_NAME}.tmp # If there are unresolved references, re-run jadetex, twice -if egrep '^LaTeX Warning: There were undefined references.$' "${SGML_FILE_NAME}.log" >/dev/null 2>&1 +if egrep '^LaTeX Warning: There were undefined references.$' ${SGML_FILE_NAME}.log >/dev/null 2>&1 then - jadetex "${SGML_FILE_NAME}.tex" >/dev/null - jadetex "${SGML_FILE_NAME}.tex" >/dev/null + jadetex ${SGML_FILE_NAME}.tex >/dev/null + jadetex ${SGML_FILE_NAME}.tex >/dev/null fi -rm -f "${SGML_FILE_NAME}.log" "${SGML_FILE_NAME}.aux" \ - "${SGML_FILE_NAME}.tex" "${SGML_FILE_NAME}.out" +rm -f ${SGML_FILE_NAME}.log ${SGML_FILE_NAME}.aux \ + ${SGML_FILE_NAME}.tex ${SGML_FILE_NAME}.out # Convert from DVI to PostScript PAPERSIZE="-t letter" @@ -38,12 +38,12 @@ then PAPERSIZE="-t a4" fi -dvips -R -q $PAPERSIZE "${SGML_FILE_NAME}.dvi" -o "${SGML_FILE_NAME}.ps" +dvips -R -q $PAPERSIZE ${SGML_FILE_NAME}.dvi -o ${SGML_FILE_NAME}.ps if [ $? -ne 0 ] then - rm "${SGML_FILE_NAME}.dvi" + rm ${SGML_FILE_NAME}.dvi exit 3 fi -rm "${SGML_FILE_NAME}.dvi" +rm ${SGML_FILE_NAME}.dvi exit 0 diff --git a/backends/ps.2ndspaces b/backends/ps.2ndspaces deleted file mode 100644 index 160c63b..0000000 --- a/backends/ps.2ndspaces +++ /dev/null @@ -1,49 +0,0 @@ -# Backend to convert something into PostScript -# Send any comments to Eric Bischoff -# This program is under GPL license. See LICENSE file for details. - -TEXINPUTS="$(dirname "${SGML_FILE}"):${TEXINPUTS}" -export TEXINPUTS - -# Convert to TeX -$SGML_JADE -t tex -o ${SGML_FILE_NAME}.tex $SGML_ARGUMENTS -if [ $? -ne 0 ] -then exit 1 -fi - -# Convert from TeX to DVI -jadetex ${SGML_FILE_NAME}.tex >${SGML_FILE_NAME}.tmp -if [ $? -ne 0 ] -then - cat ${SGML_FILE_NAME}.tmp - rm ${SGML_FILE_NAME}.tmp - rm ${SGML_FILE_NAME}.tex - exit 2 -fi -rm ${SGML_FILE_NAME}.tmp - -# If there are unresolved references, re-run jadetex, twice -if egrep '^LaTeX Warning: There were undefined references.$' ${SGML_FILE_NAME}.log >/dev/null 2>&1 -then - jadetex ${SGML_FILE_NAME}.tex >/dev/null - jadetex ${SGML_FILE_NAME}.tex >/dev/null -fi -rm -f ${SGML_FILE_NAME}.log ${SGML_FILE_NAME}.aux \ - ${SGML_FILE_NAME}.tex ${SGML_FILE_NAME}.out - -# Convert from DVI to PostScript -PAPERSIZE="-t letter" -if echo x$SGML_ARGUMENTS | grep -- '-V paper-type=A4' -then - PAPERSIZE="-t a4" -fi - -dvips -R -q $PAPERSIZE ${SGML_FILE_NAME}.dvi -o ${SGML_FILE_NAME}.ps -if [ $? -ne 0 ] -then - rm ${SGML_FILE_NAME}.dvi - exit 3 -fi -rm ${SGML_FILE_NAME}.dvi - -exit 0 diff --git a/backends/rtf b/backends/rtf index 3bc05ba..b96df5b 100644 --- a/backends/rtf +++ b/backends/rtf @@ -3,7 +3,7 @@ # This program is under GPL license. See LICENSE file for details. # Convert to RTF -$SGML_JADE -t rtf -o "${SGML_FILE_NAME}.rtf" $SGML_ARGUMENTS "$SGML_FILE" +$SGML_JADE -t rtf -o ${SGML_FILE_NAME}.rtf $SGML_ARGUMENTS if [ $? -ne 0 ] then exit 1 fi diff --git a/backends/rtf.2ndspaces b/backends/rtf.2ndspaces deleted file mode 100644 index b96df5b..0000000 --- a/backends/rtf.2ndspaces +++ /dev/null @@ -1,11 +0,0 @@ -# Backend to convert something into RTF -# Send any comments to Eric Bischoff -# This program is under GPL license. See LICENSE file for details. - -# Convert to RTF -$SGML_JADE -t rtf -o ${SGML_FILE_NAME}.rtf $SGML_ARGUMENTS -if [ $? -ne 0 ] -then exit 1 -fi - -exit 0 diff --git a/backends/tex b/backends/tex index 6bfbcd6..56ab924 100644 --- a/backends/tex +++ b/backends/tex @@ -3,7 +3,7 @@ # This program is under GPL license. See LICENSE file for details. # Convert to TeX -$SGML_JADE -t tex -o "${SGML_FILE_NAME}.tex" $SGML_ARGUMENTS "$SGML_FILE" +$SGML_JADE -t tex -o ${SGML_FILE_NAME}.tex $SGML_ARGUMENTS if [ $? -ne 0 ] then exit 1 fi diff --git a/backends/tex.2ndspaces b/backends/tex.2ndspaces deleted file mode 100644 index 56ab924..0000000 --- a/backends/tex.2ndspaces +++ /dev/null @@ -1,11 +0,0 @@ -# Backend to convert something into TeX -# Send any comments to Eric Bischoff -# This program is under GPL license. See LICENSE file for details. - -# Convert to TeX -$SGML_JADE -t tex -o ${SGML_FILE_NAME}.tex $SGML_ARGUMENTS -if [ $? -ne 0 ] -then exit 1 -fi - -exit 0 diff --git a/backends/texi.in b/backends/texi.in index 4c8a8b7..ab838d2 100644 --- a/backends/texi.in +++ b/backends/texi.in @@ -3,7 +3,7 @@ # This program is under GPL license. See LICENSE file for details. # Convert to texinfo -nsgmls "$SGML_FILE" | sgmlspl $SGML_BASE_DIR/docbook/utils-@VERSION@/helpers/docbook2texi-spec.pl >$SGML_FILE_NAME.texi +nsgmls $SGML_FILE | sgmlspl $SGML_BASE_DIR/docbook/utils-@VERSION@/helpers/docbook2texi-spec.pl >$SGML_FILE_NAME.texi if [ $? -ne 0 ] then exit 1 fi diff --git a/backends/texi.in.2ndspaces b/backends/texi.in.2ndspaces deleted file mode 100644 index ab838d2..0000000 --- a/backends/texi.in.2ndspaces +++ /dev/null @@ -1,11 +0,0 @@ -# Backend to convert a DocBook file into a texinfo file -# Send any comments to Jochem Huhmann -# This program is under GPL license. See LICENSE file for details. - -# Convert to texinfo -nsgmls $SGML_FILE | sgmlspl $SGML_BASE_DIR/docbook/utils-@VERSION@/helpers/docbook2texi-spec.pl >$SGML_FILE_NAME.texi -if [ $? -ne 0 ] -then exit 1 -fi - -exit 0 diff --git a/backends/txt b/backends/txt index 1404fa0..2dd43ba 100644 --- a/backends/txt +++ b/backends/txt @@ -13,7 +13,7 @@ then elif [ -x /usr/bin/w3m ] then CONVERT=/usr/bin/w3m - ARGS="-T text/html -dump" + ARGS="-dump" else echo >&2 "No way to convert HTML to text found." exit 1 @@ -23,7 +23,7 @@ HTML=$(mktemp /tmp/html-XXXXXX) || exit 1 trap 'rm -f "$HTML"; exit' 0 1 2 3 7 13 15 # Convert to HTML -$SGML_JADE -V nochunks -t sgml ${SGML_ARGUMENTS} "$SGML_FILE" >${HTML} +$SGML_JADE -V nochunks -t sgml ${SGML_ARGUMENTS} >${HTML} if [ $? -ne 0 ] then exit 1 fi diff --git a/backends/txt.2ndspaces b/backends/txt.2ndspaces deleted file mode 100644 index 2dd43ba..0000000 --- a/backends/txt.2ndspaces +++ /dev/null @@ -1,38 +0,0 @@ -# Backend to convert something into ASCII text -# Send any comments to Eric Bischoff -# This program is under GPL license. See LICENSE file for details. - -if [ -x /usr/bin/lynx ] -then - CONVERT=/usr/bin/lynx - ARGS="-force_html -dump -nolist -width=72" -elif [ -x /usr/bin/links ] -then - CONVERT=/usr/bin/links - ARGS="-dump" -elif [ -x /usr/bin/w3m ] -then - CONVERT=/usr/bin/w3m - ARGS="-dump" -else - echo >&2 "No way to convert HTML to text found." - exit 1 -fi - -HTML=$(mktemp /tmp/html-XXXXXX) || exit 1 -trap 'rm -f "$HTML"; exit' 0 1 2 3 7 13 15 - -# Convert to HTML -$SGML_JADE -V nochunks -t sgml ${SGML_ARGUMENTS} >${HTML} -if [ $? -ne 0 ] -then exit 1 -fi - -# Convert from HTML to ASCII -${CONVERT} ${ARGS} ${HTML} > "${SGML_FILE_NAME}.txt" -if [ $? -ne 0 ] -then - exit 2 -fi - -exit 0 diff --git a/backends/txt.w3mtxtconvert b/backends/txt.w3mtxtconvert deleted file mode 100644 index 1a4c734..0000000 --- a/backends/txt.w3mtxtconvert +++ /dev/null @@ -1,38 +0,0 @@ -# Backend to convert something into ASCII text -# Send any comments to Eric Bischoff -# This program is under GPL license. See LICENSE file for details. - -if [ -x /usr/bin/lynx ] -then - CONVERT=/usr/bin/lynx - ARGS="-force_html -dump -nolist -width=72" -elif [ -x /usr/bin/links ] -then - CONVERT=/usr/bin/links - ARGS="-dump" -elif [ -x /usr/bin/w3m ] -then - CONVERT=/usr/bin/w3m - ARGS="-dump" -else - echo >&2 "No way to convert HTML to text found." - exit 1 -fi - -HTML=$(mktemp /tmp/html-XXXXXX) || exit 1 -trap 'rm -f "$HTML"; exit' 0 1 2 3 7 13 15 - -# Convert to HTML -$SGML_JADE -V nochunks -t sgml ${SGML_ARGUMENTS} "$SGML_FILE" >${HTML} -if [ $? -ne 0 ] -then exit 1 -fi - -# Convert from HTML to ASCII -${CONVERT} ${ARGS} ${HTML} > "${SGML_FILE_NAME}.txt" -if [ $? -ne 0 ] -then - exit 2 -fi - -exit 0 diff --git a/bin/jw.in b/bin/jw.in index 070ec11..4bfb312 100644 --- a/bin/jw.in +++ b/bin/jw.in @@ -80,10 +80,10 @@ SGML_BASE_DIR="@prefix@/share/sgml" SGML_CATALOGS_DIR="/etc/sgml" if [ -f "$SGML_CONF" ] then - RE='^[[:space:]]*SGML_BASE_DIR[[:space:]]*=[[:space:]]*' - SGML_BASE_DIR=`grep --color=never $RE $SGML_CONF | sed "s/$RE//"` - RE='^[[:space:]]*SGML_CATALOGS_DIR[[:space:]]*=[[:space:]]*' - SGML_CATALOGS_DIR=`grep --color=never $RE $SGML_CONF | sed "s/$RE//"` + RE='^[:space:]*SGML_BASE_DIR[:space:]*=[:space:]*' + SGML_BASE_DIR=`grep $RE $SGML_CONF | sed "s/$RE//"` + RE='^[:space:]*SGML_CATALOGS_DIR[:space:]*=[:space:]*' + SGML_CATALOGS_DIR=`grep $RE $SGML_CONF | sed "s/$RE//"` fi # Set frontend to use @@ -246,7 +246,7 @@ then echo -e $SGML_HELP_MESSAGE >&2 exit 1 fi -if [ ! -s "$SGML_FRONTEND" ] +if [ ! -s $SGML_FRONTEND ] then echo "`basename $0`: There is no frontend called \"$SGML_FRONTEND\"." >&2 exit 2 @@ -270,14 +270,14 @@ then echo -e $SGML_HELP_MESSAGE >&2 exit 1 fi -if [ ! -s "$SGML_FILE" ] +if [ ! -s $SGML_FILE ] then echo "`basename $0`: Cannot open \"$SGML_FILE\"." >&2 exit 3 fi # Separate the file name and the extension (if any) -SGML_FILE_NAME=`basename "$SGML_FILE"` +SGML_FILE_NAME=`basename $SGML_FILE` SGML_FILE_NAME=${SGML_FILE_NAME%.*} # Determine if we are in an XML file @@ -312,7 +312,7 @@ case $SGML_STANDARD_CATALOGS in SGML_CATALOG_FILES=$SGML_CENTRALIZED_CATALOG else SGML_CATALOG_FILES=`find $SGML_BASE_DIR -name catalog` - SGML_CATALOG_FILES=`echo "$SGML_CATALOG_FILES" | tr [[:space:]] :` + SGML_CATALOG_FILES=`echo "$SGML_CATALOG_FILES" | tr [:space:] :` fi ;; no) SGML_CATALOG_FILES="" @@ -368,7 +368,7 @@ case "$SGML_OPTIONS" in fi if [ -n "$papersize" ] then - SGML_OPTIONS="-V %paper-type%=$papersize $SGML_OPTIONS" + SGML_OPTIONS="-V paper-type=$papersize $SGML_OPTIONS" fi ;; esac @@ -405,9 +405,9 @@ then echo -e $SGML_HELP_MESSAGE >&2 exit 1 fi -if [ ! -d "$SGML_OUTPUT_DIRECTORY" ] +if [ ! -d $SGML_OUTPUT_DIRECTORY ] then - mkdir "$SGML_OUTPUT_DIRECTORY" 2>/dev/null + mkdir $SGML_OUTPUT_DIRECTORY 2>/dev/null if [ $? -ne 0 ] then echo "`basename $0`: Could not create \"$SGML_OUTPUT_DIRECTORY\" output directory" >&2 @@ -416,29 +416,27 @@ then fi # Prepare the parser's arguments -SGML_ARGUMENTS="$SGML_INCLUDE -i $SGML_TYPE -d $SGML_STYLESHEET $SGML_OPTIONS $SGML_WARNINGS $SGML_DECL" +SGML_ARGUMENTS="$SGML_INCLUDE -i $SGML_TYPE -d $SGML_STYLESHEET $SGML_OPTIONS $SGML_WARNINGS $SGML_DECL $SGML_FILE" # Call the backend echo "Using catalogs: `echo $SGML_CATALOG_FILES | sed 's/:/, /g'`" echo "Using stylesheet: $SGML_STYLESHEET" echo "Working on: $SGML_FILE" -cd "$SGML_OUTPUT_DIRECTORY" -export SGML_JADE SGML_FILE_NAME SGML_ARGUMENTS SGML_INCLUDE +cd $SGML_OUTPUT_DIRECTORY +export SGML_JADE SGML_FILE_NAME SGML_ARGUMENTS export SGML_CATALOG_FILES SGML_BASE_DIR SGML_FILE SGML_STYLESHEET NOCHUNKS=`echo $SGML_OPTIONS | grep nochunks` if [ -z "$NOCHUNKS" ] then sh $SGML_BACKEND else - sh $SGML_BACKEND >"$SGML_FILE_NAME.html" + sh $SGML_BACKEND >$SGML_FILE_NAME.html fi SGML_RETURN=$? -cd "$SGML_CURRENT_DIRECTORY" +cd $SGML_CURRENT_DIRECTORY if [ $SGML_RETURN -gt 0 ] then exit `expr 7 + $SGML_RETURN` fi -#Final echo commented out, it causes manpage noise when generating some -#manpages with new perl(#513271, #587012) -#echo "Done." +echo "Done." exit 0 diff --git a/bin/jw.in.2ndspaces b/bin/jw.in.2ndspaces deleted file mode 100644 index acbd2f3..0000000 --- a/bin/jw.in.2ndspaces +++ /dev/null @@ -1,442 +0,0 @@ -#! /bin/sh -# Jade Wrapper -# Script to convert a SGML file into some other format -# Send any comments to Eric Bischoff -# This program is under GPL license. See LICENSE file for details. - -# Set help message -SGML_HELP_MESSAGE="Usage: `basename $0` [] \n\ -where are:\n\ -\040 -f|--frontend : \t Specify the frontend (source format)\n\ -\040 \t\t\t\t (default is docbook)\n\ -\040 -b|--backend : \t Specify the backend (destination format)\n\ -\040 \t\t\t\t (default is html)\n\ -\040 -c|--cat : \t\t Specify an extra SGML open catalog\n\ -\040 -n|--nostd: \t\t\t Do not use the standard SGML open catalogs\n\ -\040 -d|--dsl |default|none:\t Specify an alternate style sheet\n\ -\040 \t\t\t\t (default is to use the default stylesheet)\n\ -\040 -l|--dcl : \t\t Specify an alternate SGML declaration\n\ -\040 \t\t\t\t (usual ones like xml.dcl get detected automatically)\n\ -\040 -s|--sgmlbase : \t Change base directory for SGML distribution\n\ -\040 \t\t\t\t (usually @prefix@/share/sgml)\n\ -\040 -p|--parser : \t Specify the parser if several are installed\n\ -\040 \t\t\t\t (jade or openjade)\n\ -\040 -o|--output : \t Set output directory\n\ -\040 -u|--nochunks: \t\t Output only one big file\n\ -\040 \t\t\t\t (overrides the stylesheet settings)\n\ -\040 -i|--include
: \t Specify a SGML marked section to include\n\ -\040 \t\t\t\t (should be marked as \"ignore\" in the SGML text)\n\ -\040 -w|--warning |list: Control warnings or display the allowed warning types\n\ -\040 -e|--errors |list: Control errors or display the allowed error types\n\ -\040 -h|--help: \t\t\t Print this help message and exit\n\ -\040 -V : \t Set a variable\n\ -\040 -v|--version: \t\t Print the version and exit" - -# Set list of warning types -SGML_WARNINGS_LIST="\n\ -\040 xml \t\t Warn about constructs that are not allowed by XML\n\ -\040 mixed \t Warn about mixed content models that do not allow #pcdata anywhere\n\ -\040 sgmldecl \t Warn about various dubious constructions in the SGML declaration\n\ -\040 should \t Warn about various recommendations made in ISO 8879 that the document does not comply with\n\ -\040 default \t Warn about defaulted references\n\ -\040 duplicate \t Warn about duplicate entity declarations\n\ -\040 undefined \t Warn about undefined elements: elements used in the DTD but not defined\n\ -\040 unclosed \t Warn about unclosed start and end-tags\n\ -\040 empty \t Warn about empty start and end-tags\n\ -\040 net \t\t Warn about net-enabling start-tags and null end-tags\n\ -\040 min-tag \t Warn about minimized start and end-tags. Equivalent to: unclosed, empty and net\n\ -\040 unused-map \t Warn about unused short reference maps\n\ -\040 unused-param \t Warn about parameter entities that are defined but not used in a DTD\n\ -\040 notation-sysid Warn about notations for which no system identifier could be generated\n\ -\040 all \t\t Equivalent to: mixed, should, default, undefined, sgmldecl, unused-map, unused-param, empty and unclosed\n\n\ -\040 A warning can be disabled by using its name prefixed with no-. Example: -w all -w no-duplicate" - -# Set list of error types -SGML_ERRORS_LIST="\n\ -\040 no-idref \t No error for an ID reference value which no element has as its ID\n\ -\040 no-significant No errors for characters not significant in the reference concrete syntax\n\ -\040 no-valid \t Do not require the document to be type-valid" - -# Get name of main SGML configuration file -which sgmlwhich >/dev/null 2>/dev/null -if [ $? -eq 0 ] -then - SGML_CONF=`sgmlwhich` -else - SGML_CONF="/etc/sgml/sgml.conf" -fi - -# Set version message -SGML_VERSION_MESSAGE="DocBook-utils version @VERSION@ (jw version 1.1)" - -# Set option: use standard catalogs -SGML_STANDARD_CATALOGS="yes" - -# Set path to user SGML catalogs -SGML_EXTRA_CATALOGS="" - -# Set SGML base directory and centralized catalogs directory -SGML_BASE_DIR="@prefix@/share/sgml" -SGML_CATALOGS_DIR="/etc/sgml" -if [ -f "$SGML_CONF" ] -then - RE='^[:space:]*SGML_BASE_DIR[:space:]*=[:space:]*' - SGML_BASE_DIR=`grep $RE $SGML_CONF | sed "s/$RE//"` - RE='^[:space:]*SGML_CATALOGS_DIR[:space:]*=[:space:]*' - SGML_CATALOGS_DIR=`grep $RE $SGML_CONF | sed "s/$RE//"` -fi - -# Set frontend to use -SGML_FRONTEND="$SGML_BASE_DIR/docbook/utils-@VERSION@/frontends/docbook" - -# Set backend to use -SGML_BACKEND="$SGML_BASE_DIR/docbook/utils-@VERSION@/backends/html" - -# Set main stylesheet -SGML_STYLESHEET="default" - -# Set flavour of jade parser to use -SGML_JADE="" - -# Set SGML declaration and file to process -SGML_DECL="" -SGML_FILE="" - -# Set output and current directories -SGML_OUTPUT_DIRECTORY="." -SGML_CURRENT_DIRECTORY=`pwd` - -# Set of options to set -SGML_OPTIONS="" - -# Set list of "include" marked sections -SGML_INCLUDE="" - -# Set list of warning types and errors types -SGML_WARNINGS="" - -# Process options -while [ $# -gt 0 ] -do case $1 in - -f|--frontend) case "$2" in - /*) SGML_FRONTEND="$2" ;; - *) d=$SGML_BASE_DIR/docbook/utils-@VERSION@/frontends - SGML_FRONTEND="$d/$2" ;; - esac - shift 2 - ;; - -b|--backend) case "$2" in - /*) SGML_BACKEND="$2" ;; - *) d=$SGML_BASE_DIR/docbook/utils-@VERSION@/backends - SGML_BACKEND="$d/$2" ;; - esac - shift 2 - ;; - -c|--cat) case "$2" in - /*) SGML_EXTRA_CATALOGS="$SGML_EXTRA_CATALOGS:$2" ;; - *) SGML_EXTRA_CATALOGS="$SGML_EXTRA_CATALOGS:$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -d|--dsl) case "$2" in - /*|none|default) SGML_STYLESHEET="$2" ;; - *) SGML_STYLESHEET="$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -l|--dcl) case "$2" in - /*) SGML_DECL="$2" ;; - *) SGML_DECL="$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -n|--nostd) SGML_STANDARD_CATALOGS="no" - shift 1 - ;; - -s|--sgmlbase) case "$2" in - /*) SGML_BASE_DIR="$2" ;; - *) SGML_BASE_DIR="$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -p|--parser) case "$2" in - /*) SGML_JADE="$2" ;; - *) SGML_JADE="$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -o|--output) case "$2" in - /*) SGML_OUTPUT_DIRECTORY="$2" ;; - *) SGML_OUTPUT_DIRECTORY="$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -u|--nochunks) SGML_OPTIONS="$SGML_OPTIONS -V nochunks" - shift 1 - ;; - -V) SGML_OPTIONS="$SGML_OPTIONS -V $2" - shift 2 - ;; - -i|--include) case $2 in - print|html) echo "The marked section named \"$2\" is reserved for internal use by `basename $0`." >&2 - exit 1 - ;; - esac - SGML_INCLUDE="$SGML_INCLUDE -i $2" - shift 2 - ;; - -w|--warning) case $2 in - list) echo -e "List of allowed warning types (multiple -w options are allowed):\n" - echo -e $SGML_WARNINGS_LIST - exit 0 - ;; - xml|mixed|sgmldecl|should|default|duplicate|undefined|unclosed|empty|net|min-tag|unused-map|unused-param|notation-sysid|all|no-xml|no-mixed|no-sgmldecl|no-should|no-default|no-duplicate|no-undefined|no-unclosed|no-empty|no-net|no-min-tag|no-unused-map|no-unused-param|no-notation-sysid) \ - SGML_WARNINGS="$SGML_WARNINGS -w $2" - shift 2 - ;; - *) echo "Unknown warning type \"$2\". Allowed warning types are:" >&2 - echo -e $SGML_WARNINGS_LIST >&2 - exit 1 - ;; - esac - ;; - -e|--error) case $2 in - list) echo -e "List of allowed error types (multiple -e options are allowed):\n" - echo -e $SGML_ERRORS_LIST - exit 0 - ;; - no-idref|no-significant|no-valid) \ - SGML_WARNINGS="$SGML_WARNINGS -w $2" - shift 2 - ;; - *) echo "Unknown error type \"$2\". Allowed error types are:" >&2 - echo -e $SGML_ERRORS_LIST >&2 - exit 1 - ;; - esac - ;; - -h|--help) echo -e "`basename $0` - Jade Wrapper\n" - echo -e "$SGML_HELP_MESSAGE" - exit 0 - ;; - -v|--version) echo -e "$SGML_VERSION_MESSAGE" - exit 0 - ;; - -*) echo -e "$SGML_HELP_MESSAGE" >&2 - exit 1 - ;; - *) if [ -z "$SGML_FILE" ] - then - case "$1" in - /*) SGML_FILE="$1" ;; - *) SGML_FILE="$SGML_CURRENT_DIRECTORY/$1" ;; - esac - shift 1 - else - echo -e "$SGML_HELP_MESSAGE" >&2 - exit 1 - fi - ;; - esac -done - -# Check that we have a frontend -if [ -z "$SGML_FRONTEND" ] -then - echo -e $SGML_HELP_MESSAGE >&2 - exit 1 -fi -if [ ! -s $SGML_FRONTEND ] -then - echo "`basename $0`: There is no frontend called \"$SGML_FRONTEND\"." >&2 - exit 2 -fi - -# Check that we have a backend -if [ -z "$SGML_BACKEND" ] -then - echo -e $SGML_HELP_MESSAGE >&2 - exit 1 -fi -if [ ! -s $SGML_BACKEND ] -then - echo "`basename $0`: There is no backend called \"$SGML_BACKEND\"." >&2 - exit 2 -fi - -# Check that we have a file to process -if [ -z "$SGML_FILE" ] -then - echo -e $SGML_HELP_MESSAGE >&2 - exit 1 -fi -if [ ! -s $SGML_FILE ] -then - echo "`basename $0`: Cannot open \"$SGML_FILE\"." >&2 - exit 3 -fi - -# Separate the file name and the extension (if any) -SGML_FILE_NAME=`basename $SGML_FILE` -SGML_FILE_NAME=${SGML_FILE_NAME%.*} - -# Determine if we are in an XML file -SGML_XML=`head "$SGML_FILE" | grep "" | wc -l` -if [ $SGML_XML -eq 1 ]; then - SGML_XML="xml" -else - SGML_XML="sgml" -fi - -# Use SGML declaration for XML if needed -if [ "$SGML_DECL" = "" -a "$SGML_XML" = "xml" ] -then SGML_DECL=${SGML_BASE_DIR}/xml.dcl -fi - -# Try to find the SGML normalizer -if [ -z "$SGML_NORM" ] -then - SGML_NORM=`which sgmlnorm 2>/dev/null` - if [ -z "SGML_NORM" ] - then - SGML_NORM=`which osgmlnorm 2>/dev/null` - fi -fi - -# Set path to SGML catalogs (first try centralized catalog) -case $SGML_STANDARD_CATALOGS in - yes) export SGML_CATALOGS_DIR SGML_FILE SGML_XML SGML_NORM - SGML_CENTRALIZED_CATALOG=`sh $SGML_FRONTEND centralized-catalog` - if [ -s $SGML_CENTRALIZED_CATALOG ] - then - SGML_CATALOG_FILES=$SGML_CENTRALIZED_CATALOG - else - SGML_CATALOG_FILES=`find $SGML_BASE_DIR -name catalog` - SGML_CATALOG_FILES=`echo "$SGML_CATALOG_FILES" | tr [:space:] :` - fi - ;; - no) SGML_CATALOG_FILES="" - ;; -esac -SGML_CATALOG_FILES=${SGML_CATALOG_FILES}${SGML_EXTRA_CATALOGS} -SGML_CATALOG_FILES=`echo "$SGML_CATALOG_FILES" | sed 's/^://;s/:$//'` -if [ -z "$SGML_CATALOG_FILES" ] -then - echo "`basename $0`: Please specify at least one catalog" >&2 - exit 4 -fi - -# Determine the backend type -case $SGML_BACKEND in - *html|*txt) \ - SGML_TYPE=html - ;; - *) SGML_TYPE=print - ;; -esac - -# Determine which stylesheet to use -# (run the frontend to know it if the default stylesheet or no custom stylesheet is desired) -if [ "$SGML_STYLESHEET" = "default" -o "$SGML_STYLESHEET" = "none" ] -then - export SGML_BASE_DIR SGML_TYPE SGML_STYLESHEET - SGML_STYLESHEET=`sh $SGML_FRONTEND style-sheet` - SGML_RETURN=$? - if [ $SGML_RETURN -gt 0 ] - then exit `expr 7 + $SGML_RETURN` - fi -fi -if [ -z "$SGML_STYLESHEET" ] -then - echo "`basename $0`: Please specify at least one stylesheet" >&2 - exit 5 -fi - -case "$SGML_OPTIONS" in - *paper-type*) - ;; - *) - # Set the paper size to A4 if the locale suggests so - papersize= - if [ -x /usr/bin/locale ] - then - h=$(/usr/bin/locale LC_PAPER 2>/dev/null | head -n 1) - if [ "$h" = 297 ] - then - papersize=A4 - fi - fi - if [ -n "$papersize" ] - then - SGML_OPTIONS="-V paper-type=$papersize $SGML_OPTIONS" - fi - ;; -esac - -# Choose a parser -if [ -z "$SGML_JADE" ] -then - which jade >/dev/null 2>/dev/null - if [ $? -eq 0 ] - then - SGML_JADE="jade" - else - which openjade >/dev/null 2>/dev/null - if [ $? -eq 0 ] - then - SGML_JADE="openjade" - else - echo "`basename $0`: No parser available" >&2 - exit 6 - fi - fi -else - which $SGML_JADE >/dev/null 2>/dev/null - if [ $? -ne 0 ] - then - echo "`basename $0`: parser $SGML_JADE is not available" >&2 - exit 6 - fi -fi - -# Create output directory if not available -if [ -z "$SGML_OUTPUT_DIRECTORY" ] -then - echo -e $SGML_HELP_MESSAGE >&2 - exit 1 -fi -if [ ! -d "$SGML_OUTPUT_DIRECTORY" ] -then - mkdir "$SGML_OUTPUT_DIRECTORY" 2>/dev/null - if [ $? -ne 0 ] - then - echo "`basename $0`: Could not create \"$SGML_OUTPUT_DIRECTORY\" output directory" >&2 - exit 7 - fi -fi - -# Prepare the parser's arguments -SGML_ARGUMENTS="$SGML_INCLUDE -i $SGML_TYPE -d $SGML_STYLESHEET $SGML_OPTIONS $SGML_WARNINGS $SGML_DECL $SGML_FILE" - -# Call the backend -echo "Using catalogs: `echo $SGML_CATALOG_FILES | sed 's/:/, /g'`" -echo "Using stylesheet: $SGML_STYLESHEET" -echo "Working on: $SGML_FILE" -cd "$SGML_OUTPUT_DIRECTORY" -export SGML_JADE SGML_FILE_NAME SGML_ARGUMENTS -export SGML_CATALOG_FILES SGML_BASE_DIR SGML_FILE SGML_STYLESHEET -NOCHUNKS=`echo $SGML_OPTIONS | grep nochunks` -if [ -z "$NOCHUNKS" ] -then - sh $SGML_BACKEND -else - sh $SGML_BACKEND >$SGML_FILE_NAME.html -fi -SGML_RETURN=$? -cd "$SGML_CURRENT_DIRECTORY" - -if [ $SGML_RETURN -gt 0 ] -then exit `expr 7 + $SGML_RETURN` -fi -echo "Done." -exit 0 diff --git a/bin/jw.in.finalecho b/bin/jw.in.finalecho deleted file mode 100644 index adca797..0000000 --- a/bin/jw.in.finalecho +++ /dev/null @@ -1,442 +0,0 @@ -#! /bin/sh -# Jade Wrapper -# Script to convert a SGML file into some other format -# Send any comments to Eric Bischoff -# This program is under GPL license. See LICENSE file for details. - -# Set help message -SGML_HELP_MESSAGE="Usage: `basename $0` [] \n\ -where are:\n\ -\040 -f|--frontend : \t Specify the frontend (source format)\n\ -\040 \t\t\t\t (default is docbook)\n\ -\040 -b|--backend : \t Specify the backend (destination format)\n\ -\040 \t\t\t\t (default is html)\n\ -\040 -c|--cat : \t\t Specify an extra SGML open catalog\n\ -\040 -n|--nostd: \t\t\t Do not use the standard SGML open catalogs\n\ -\040 -d|--dsl |default|none:\t Specify an alternate style sheet\n\ -\040 \t\t\t\t (default is to use the default stylesheet)\n\ -\040 -l|--dcl : \t\t Specify an alternate SGML declaration\n\ -\040 \t\t\t\t (usual ones like xml.dcl get detected automatically)\n\ -\040 -s|--sgmlbase : \t Change base directory for SGML distribution\n\ -\040 \t\t\t\t (usually @prefix@/share/sgml)\n\ -\040 -p|--parser : \t Specify the parser if several are installed\n\ -\040 \t\t\t\t (jade or openjade)\n\ -\040 -o|--output : \t Set output directory\n\ -\040 -u|--nochunks: \t\t Output only one big file\n\ -\040 \t\t\t\t (overrides the stylesheet settings)\n\ -\040 -i|--include
: \t Specify a SGML marked section to include\n\ -\040 \t\t\t\t (should be marked as \"ignore\" in the SGML text)\n\ -\040 -w|--warning |list: Control warnings or display the allowed warning types\n\ -\040 -e|--errors |list: Control errors or display the allowed error types\n\ -\040 -h|--help: \t\t\t Print this help message and exit\n\ -\040 -V : \t Set a variable\n\ -\040 -v|--version: \t\t Print the version and exit" - -# Set list of warning types -SGML_WARNINGS_LIST="\n\ -\040 xml \t\t Warn about constructs that are not allowed by XML\n\ -\040 mixed \t Warn about mixed content models that do not allow #pcdata anywhere\n\ -\040 sgmldecl \t Warn about various dubious constructions in the SGML declaration\n\ -\040 should \t Warn about various recommendations made in ISO 8879 that the document does not comply with\n\ -\040 default \t Warn about defaulted references\n\ -\040 duplicate \t Warn about duplicate entity declarations\n\ -\040 undefined \t Warn about undefined elements: elements used in the DTD but not defined\n\ -\040 unclosed \t Warn about unclosed start and end-tags\n\ -\040 empty \t Warn about empty start and end-tags\n\ -\040 net \t\t Warn about net-enabling start-tags and null end-tags\n\ -\040 min-tag \t Warn about minimized start and end-tags. Equivalent to: unclosed, empty and net\n\ -\040 unused-map \t Warn about unused short reference maps\n\ -\040 unused-param \t Warn about parameter entities that are defined but not used in a DTD\n\ -\040 notation-sysid Warn about notations for which no system identifier could be generated\n\ -\040 all \t\t Equivalent to: mixed, should, default, undefined, sgmldecl, unused-map, unused-param, empty and unclosed\n\n\ -\040 A warning can be disabled by using its name prefixed with no-. Example: -w all -w no-duplicate" - -# Set list of error types -SGML_ERRORS_LIST="\n\ -\040 no-idref \t No error for an ID reference value which no element has as its ID\n\ -\040 no-significant No errors for characters not significant in the reference concrete syntax\n\ -\040 no-valid \t Do not require the document to be type-valid" - -# Get name of main SGML configuration file -which sgmlwhich >/dev/null 2>/dev/null -if [ $? -eq 0 ] -then - SGML_CONF=`sgmlwhich` -else - SGML_CONF="/etc/sgml/sgml.conf" -fi - -# Set version message -SGML_VERSION_MESSAGE="DocBook-utils version @VERSION@ (jw version 1.1)" - -# Set option: use standard catalogs -SGML_STANDARD_CATALOGS="yes" - -# Set path to user SGML catalogs -SGML_EXTRA_CATALOGS="" - -# Set SGML base directory and centralized catalogs directory -SGML_BASE_DIR="@prefix@/share/sgml" -SGML_CATALOGS_DIR="/etc/sgml" -if [ -f "$SGML_CONF" ] -then - RE='^[:space:]*SGML_BASE_DIR[:space:]*=[:space:]*' - SGML_BASE_DIR=`grep --color=never $RE $SGML_CONF | sed "s/$RE//"` - RE='^[:space:]*SGML_CATALOGS_DIR[:space:]*=[:space:]*' - SGML_CATALOGS_DIR=`grep --color=never $RE $SGML_CONF | sed "s/$RE//"` -fi - -# Set frontend to use -SGML_FRONTEND="$SGML_BASE_DIR/docbook/utils-@VERSION@/frontends/docbook" - -# Set backend to use -SGML_BACKEND="$SGML_BASE_DIR/docbook/utils-@VERSION@/backends/html" - -# Set main stylesheet -SGML_STYLESHEET="default" - -# Set flavour of jade parser to use -SGML_JADE="" - -# Set SGML declaration and file to process -SGML_DECL="" -SGML_FILE="" - -# Set output and current directories -SGML_OUTPUT_DIRECTORY="." -SGML_CURRENT_DIRECTORY=`pwd` - -# Set of options to set -SGML_OPTIONS="" - -# Set list of "include" marked sections -SGML_INCLUDE="" - -# Set list of warning types and errors types -SGML_WARNINGS="" - -# Process options -while [ $# -gt 0 ] -do case $1 in - -f|--frontend) case "$2" in - /*) SGML_FRONTEND="$2" ;; - *) d=$SGML_BASE_DIR/docbook/utils-@VERSION@/frontends - SGML_FRONTEND="$d/$2" ;; - esac - shift 2 - ;; - -b|--backend) case "$2" in - /*) SGML_BACKEND="$2" ;; - *) d=$SGML_BASE_DIR/docbook/utils-@VERSION@/backends - SGML_BACKEND="$d/$2" ;; - esac - shift 2 - ;; - -c|--cat) case "$2" in - /*) SGML_EXTRA_CATALOGS="$SGML_EXTRA_CATALOGS:$2" ;; - *) SGML_EXTRA_CATALOGS="$SGML_EXTRA_CATALOGS:$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -d|--dsl) case "$2" in - /*|none|default) SGML_STYLESHEET="$2" ;; - *) SGML_STYLESHEET="$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -l|--dcl) case "$2" in - /*) SGML_DECL="$2" ;; - *) SGML_DECL="$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -n|--nostd) SGML_STANDARD_CATALOGS="no" - shift 1 - ;; - -s|--sgmlbase) case "$2" in - /*) SGML_BASE_DIR="$2" ;; - *) SGML_BASE_DIR="$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -p|--parser) case "$2" in - /*) SGML_JADE="$2" ;; - *) SGML_JADE="$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -o|--output) case "$2" in - /*) SGML_OUTPUT_DIRECTORY="$2" ;; - *) SGML_OUTPUT_DIRECTORY="$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -u|--nochunks) SGML_OPTIONS="$SGML_OPTIONS -V nochunks" - shift 1 - ;; - -V) SGML_OPTIONS="$SGML_OPTIONS -V $2" - shift 2 - ;; - -i|--include) case $2 in - print|html) echo "The marked section named \"$2\" is reserved for internal use by `basename $0`." >&2 - exit 1 - ;; - esac - SGML_INCLUDE="$SGML_INCLUDE -i $2" - shift 2 - ;; - -w|--warning) case $2 in - list) echo -e "List of allowed warning types (multiple -w options are allowed):\n" - echo -e $SGML_WARNINGS_LIST - exit 0 - ;; - xml|mixed|sgmldecl|should|default|duplicate|undefined|unclosed|empty|net|min-tag|unused-map|unused-param|notation-sysid|all|no-xml|no-mixed|no-sgmldecl|no-should|no-default|no-duplicate|no-undefined|no-unclosed|no-empty|no-net|no-min-tag|no-unused-map|no-unused-param|no-notation-sysid) \ - SGML_WARNINGS="$SGML_WARNINGS -w $2" - shift 2 - ;; - *) echo "Unknown warning type \"$2\". Allowed warning types are:" >&2 - echo -e $SGML_WARNINGS_LIST >&2 - exit 1 - ;; - esac - ;; - -e|--error) case $2 in - list) echo -e "List of allowed error types (multiple -e options are allowed):\n" - echo -e $SGML_ERRORS_LIST - exit 0 - ;; - no-idref|no-significant|no-valid) \ - SGML_WARNINGS="$SGML_WARNINGS -w $2" - shift 2 - ;; - *) echo "Unknown error type \"$2\". Allowed error types are:" >&2 - echo -e $SGML_ERRORS_LIST >&2 - exit 1 - ;; - esac - ;; - -h|--help) echo -e "`basename $0` - Jade Wrapper\n" - echo -e "$SGML_HELP_MESSAGE" - exit 0 - ;; - -v|--version) echo -e "$SGML_VERSION_MESSAGE" - exit 0 - ;; - -*) echo -e "$SGML_HELP_MESSAGE" >&2 - exit 1 - ;; - *) if [ -z "$SGML_FILE" ] - then - case "$1" in - /*) SGML_FILE="$1" ;; - *) SGML_FILE="$SGML_CURRENT_DIRECTORY/$1" ;; - esac - shift 1 - else - echo -e "$SGML_HELP_MESSAGE" >&2 - exit 1 - fi - ;; - esac -done - -# Check that we have a frontend -if [ -z "$SGML_FRONTEND" ] -then - echo -e $SGML_HELP_MESSAGE >&2 - exit 1 -fi -if [ ! -s "$SGML_FRONTEND" ] -then - echo "`basename $0`: There is no frontend called \"$SGML_FRONTEND\"." >&2 - exit 2 -fi - -# Check that we have a backend -if [ -z "$SGML_BACKEND" ] -then - echo -e $SGML_HELP_MESSAGE >&2 - exit 1 -fi -if [ ! -s $SGML_BACKEND ] -then - echo "`basename $0`: There is no backend called \"$SGML_BACKEND\"." >&2 - exit 2 -fi - -# Check that we have a file to process -if [ -z "$SGML_FILE" ] -then - echo -e $SGML_HELP_MESSAGE >&2 - exit 1 -fi -if [ ! -s "$SGML_FILE" ] -then - echo "`basename $0`: Cannot open \"$SGML_FILE\"." >&2 - exit 3 -fi - -# Separate the file name and the extension (if any) -SGML_FILE_NAME=`basename "$SGML_FILE"` -SGML_FILE_NAME=${SGML_FILE_NAME%.*} - -# Determine if we are in an XML file -SGML_XML=`head "$SGML_FILE" | grep "" | wc -l` -if [ $SGML_XML -eq 1 ]; then - SGML_XML="xml" -else - SGML_XML="sgml" -fi - -# Use SGML declaration for XML if needed -if [ "$SGML_DECL" = "" -a "$SGML_XML" = "xml" ] -then SGML_DECL=${SGML_BASE_DIR}/xml.dcl -fi - -# Try to find the SGML normalizer -if [ -z "$SGML_NORM" ] -then - SGML_NORM=`which sgmlnorm 2>/dev/null` - if [ -z "SGML_NORM" ] - then - SGML_NORM=`which osgmlnorm 2>/dev/null` - fi -fi - -# Set path to SGML catalogs (first try centralized catalog) -case $SGML_STANDARD_CATALOGS in - yes) export SGML_CATALOGS_DIR SGML_FILE SGML_XML SGML_NORM - SGML_CENTRALIZED_CATALOG=`sh $SGML_FRONTEND centralized-catalog` - if [ -s $SGML_CENTRALIZED_CATALOG ] - then - SGML_CATALOG_FILES=$SGML_CENTRALIZED_CATALOG - else - SGML_CATALOG_FILES=`find $SGML_BASE_DIR -name catalog` - SGML_CATALOG_FILES=`echo "$SGML_CATALOG_FILES" | tr [:space:] :` - fi - ;; - no) SGML_CATALOG_FILES="" - ;; -esac -SGML_CATALOG_FILES=${SGML_CATALOG_FILES}${SGML_EXTRA_CATALOGS} -SGML_CATALOG_FILES=`echo "$SGML_CATALOG_FILES" | sed 's/^://;s/:$//'` -if [ -z "$SGML_CATALOG_FILES" ] -then - echo "`basename $0`: Please specify at least one catalog" >&2 - exit 4 -fi - -# Determine the backend type -case $SGML_BACKEND in - *html|*txt) \ - SGML_TYPE=html - ;; - *) SGML_TYPE=print - ;; -esac - -# Determine which stylesheet to use -# (run the frontend to know it if the default stylesheet or no custom stylesheet is desired) -if [ "$SGML_STYLESHEET" = "default" -o "$SGML_STYLESHEET" = "none" ] -then - export SGML_BASE_DIR SGML_TYPE SGML_STYLESHEET - SGML_STYLESHEET=`sh $SGML_FRONTEND style-sheet` - SGML_RETURN=$? - if [ $SGML_RETURN -gt 0 ] - then exit `expr 7 + $SGML_RETURN` - fi -fi -if [ -z "$SGML_STYLESHEET" ] -then - echo "`basename $0`: Please specify at least one stylesheet" >&2 - exit 5 -fi - -case "$SGML_OPTIONS" in - *paper-type*) - ;; - *) - # Set the paper size to A4 if the locale suggests so - papersize= - if [ -x /usr/bin/locale ] - then - h=$(/usr/bin/locale LC_PAPER 2>/dev/null | head -n 1) - if [ "$h" = 297 ] - then - papersize=A4 - fi - fi - if [ -n "$papersize" ] - then - SGML_OPTIONS="-V %paper-type%=$papersize $SGML_OPTIONS" - fi - ;; -esac - -# Choose a parser -if [ -z "$SGML_JADE" ] -then - which jade >/dev/null 2>/dev/null - if [ $? -eq 0 ] - then - SGML_JADE="jade" - else - which openjade >/dev/null 2>/dev/null - if [ $? -eq 0 ] - then - SGML_JADE="openjade" - else - echo "`basename $0`: No parser available" >&2 - exit 6 - fi - fi -else - which $SGML_JADE >/dev/null 2>/dev/null - if [ $? -ne 0 ] - then - echo "`basename $0`: parser $SGML_JADE is not available" >&2 - exit 6 - fi -fi - -# Create output directory if not available -if [ -z "$SGML_OUTPUT_DIRECTORY" ] -then - echo -e $SGML_HELP_MESSAGE >&2 - exit 1 -fi -if [ ! -d "$SGML_OUTPUT_DIRECTORY" ] -then - mkdir "$SGML_OUTPUT_DIRECTORY" 2>/dev/null - if [ $? -ne 0 ] - then - echo "`basename $0`: Could not create \"$SGML_OUTPUT_DIRECTORY\" output directory" >&2 - exit 7 - fi -fi - -# Prepare the parser's arguments -SGML_ARGUMENTS="$SGML_INCLUDE -i $SGML_TYPE -d $SGML_STYLESHEET $SGML_OPTIONS $SGML_WARNINGS $SGML_DECL" - -# Call the backend -echo "Using catalogs: `echo $SGML_CATALOG_FILES | sed 's/:/, /g'`" -echo "Using stylesheet: $SGML_STYLESHEET" -echo "Working on: $SGML_FILE" -cd "$SGML_OUTPUT_DIRECTORY" -export SGML_JADE SGML_FILE_NAME SGML_ARGUMENTS SGML_INCLUDE -export SGML_CATALOG_FILES SGML_BASE_DIR SGML_FILE SGML_STYLESHEET -NOCHUNKS=`echo $SGML_OPTIONS | grep nochunks` -if [ -z "$NOCHUNKS" ] -then - sh $SGML_BACKEND -else - sh $SGML_BACKEND >"$SGML_FILE_NAME.html" -fi -SGML_RETURN=$? -cd "$SGML_CURRENT_DIRECTORY" - -if [ $SGML_RETURN -gt 0 ] -then exit `expr 7 + $SGML_RETURN` -fi -echo "Done." -exit 0 diff --git a/bin/jw.in.grepnocolors b/bin/jw.in.grepnocolors deleted file mode 100644 index 4cb870f..0000000 --- a/bin/jw.in.grepnocolors +++ /dev/null @@ -1,442 +0,0 @@ -#! /bin/sh -# Jade Wrapper -# Script to convert a SGML file into some other format -# Send any comments to Eric Bischoff -# This program is under GPL license. See LICENSE file for details. - -# Set help message -SGML_HELP_MESSAGE="Usage: `basename $0` [] \n\ -where are:\n\ -\040 -f|--frontend : \t Specify the frontend (source format)\n\ -\040 \t\t\t\t (default is docbook)\n\ -\040 -b|--backend : \t Specify the backend (destination format)\n\ -\040 \t\t\t\t (default is html)\n\ -\040 -c|--cat : \t\t Specify an extra SGML open catalog\n\ -\040 -n|--nostd: \t\t\t Do not use the standard SGML open catalogs\n\ -\040 -d|--dsl |default|none:\t Specify an alternate style sheet\n\ -\040 \t\t\t\t (default is to use the default stylesheet)\n\ -\040 -l|--dcl : \t\t Specify an alternate SGML declaration\n\ -\040 \t\t\t\t (usual ones like xml.dcl get detected automatically)\n\ -\040 -s|--sgmlbase : \t Change base directory for SGML distribution\n\ -\040 \t\t\t\t (usually @prefix@/share/sgml)\n\ -\040 -p|--parser : \t Specify the parser if several are installed\n\ -\040 \t\t\t\t (jade or openjade)\n\ -\040 -o|--output : \t Set output directory\n\ -\040 -u|--nochunks: \t\t Output only one big file\n\ -\040 \t\t\t\t (overrides the stylesheet settings)\n\ -\040 -i|--include
: \t Specify a SGML marked section to include\n\ -\040 \t\t\t\t (should be marked as \"ignore\" in the SGML text)\n\ -\040 -w|--warning |list: Control warnings or display the allowed warning types\n\ -\040 -e|--errors |list: Control errors or display the allowed error types\n\ -\040 -h|--help: \t\t\t Print this help message and exit\n\ -\040 -V : \t Set a variable\n\ -\040 -v|--version: \t\t Print the version and exit" - -# Set list of warning types -SGML_WARNINGS_LIST="\n\ -\040 xml \t\t Warn about constructs that are not allowed by XML\n\ -\040 mixed \t Warn about mixed content models that do not allow #pcdata anywhere\n\ -\040 sgmldecl \t Warn about various dubious constructions in the SGML declaration\n\ -\040 should \t Warn about various recommendations made in ISO 8879 that the document does not comply with\n\ -\040 default \t Warn about defaulted references\n\ -\040 duplicate \t Warn about duplicate entity declarations\n\ -\040 undefined \t Warn about undefined elements: elements used in the DTD but not defined\n\ -\040 unclosed \t Warn about unclosed start and end-tags\n\ -\040 empty \t Warn about empty start and end-tags\n\ -\040 net \t\t Warn about net-enabling start-tags and null end-tags\n\ -\040 min-tag \t Warn about minimized start and end-tags. Equivalent to: unclosed, empty and net\n\ -\040 unused-map \t Warn about unused short reference maps\n\ -\040 unused-param \t Warn about parameter entities that are defined but not used in a DTD\n\ -\040 notation-sysid Warn about notations for which no system identifier could be generated\n\ -\040 all \t\t Equivalent to: mixed, should, default, undefined, sgmldecl, unused-map, unused-param, empty and unclosed\n\n\ -\040 A warning can be disabled by using its name prefixed with no-. Example: -w all -w no-duplicate" - -# Set list of error types -SGML_ERRORS_LIST="\n\ -\040 no-idref \t No error for an ID reference value which no element has as its ID\n\ -\040 no-significant No errors for characters not significant in the reference concrete syntax\n\ -\040 no-valid \t Do not require the document to be type-valid" - -# Get name of main SGML configuration file -which sgmlwhich >/dev/null 2>/dev/null -if [ $? -eq 0 ] -then - SGML_CONF=`sgmlwhich` -else - SGML_CONF="/etc/sgml/sgml.conf" -fi - -# Set version message -SGML_VERSION_MESSAGE="DocBook-utils version @VERSION@ (jw version 1.1)" - -# Set option: use standard catalogs -SGML_STANDARD_CATALOGS="yes" - -# Set path to user SGML catalogs -SGML_EXTRA_CATALOGS="" - -# Set SGML base directory and centralized catalogs directory -SGML_BASE_DIR="@prefix@/share/sgml" -SGML_CATALOGS_DIR="/etc/sgml" -if [ -f "$SGML_CONF" ] -then - RE='^[:space:]*SGML_BASE_DIR[:space:]*=[:space:]*' - SGML_BASE_DIR=`grep $RE $SGML_CONF | sed "s/$RE//"` - RE='^[:space:]*SGML_CATALOGS_DIR[:space:]*=[:space:]*' - SGML_CATALOGS_DIR=`grep $RE $SGML_CONF | sed "s/$RE//"` -fi - -# Set frontend to use -SGML_FRONTEND="$SGML_BASE_DIR/docbook/utils-@VERSION@/frontends/docbook" - -# Set backend to use -SGML_BACKEND="$SGML_BASE_DIR/docbook/utils-@VERSION@/backends/html" - -# Set main stylesheet -SGML_STYLESHEET="default" - -# Set flavour of jade parser to use -SGML_JADE="" - -# Set SGML declaration and file to process -SGML_DECL="" -SGML_FILE="" - -# Set output and current directories -SGML_OUTPUT_DIRECTORY="." -SGML_CURRENT_DIRECTORY=`pwd` - -# Set of options to set -SGML_OPTIONS="" - -# Set list of "include" marked sections -SGML_INCLUDE="" - -# Set list of warning types and errors types -SGML_WARNINGS="" - -# Process options -while [ $# -gt 0 ] -do case $1 in - -f|--frontend) case "$2" in - /*) SGML_FRONTEND="$2" ;; - *) d=$SGML_BASE_DIR/docbook/utils-@VERSION@/frontends - SGML_FRONTEND="$d/$2" ;; - esac - shift 2 - ;; - -b|--backend) case "$2" in - /*) SGML_BACKEND="$2" ;; - *) d=$SGML_BASE_DIR/docbook/utils-@VERSION@/backends - SGML_BACKEND="$d/$2" ;; - esac - shift 2 - ;; - -c|--cat) case "$2" in - /*) SGML_EXTRA_CATALOGS="$SGML_EXTRA_CATALOGS:$2" ;; - *) SGML_EXTRA_CATALOGS="$SGML_EXTRA_CATALOGS:$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -d|--dsl) case "$2" in - /*|none|default) SGML_STYLESHEET="$2" ;; - *) SGML_STYLESHEET="$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -l|--dcl) case "$2" in - /*) SGML_DECL="$2" ;; - *) SGML_DECL="$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -n|--nostd) SGML_STANDARD_CATALOGS="no" - shift 1 - ;; - -s|--sgmlbase) case "$2" in - /*) SGML_BASE_DIR="$2" ;; - *) SGML_BASE_DIR="$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -p|--parser) case "$2" in - /*) SGML_JADE="$2" ;; - *) SGML_JADE="$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -o|--output) case "$2" in - /*) SGML_OUTPUT_DIRECTORY="$2" ;; - *) SGML_OUTPUT_DIRECTORY="$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -u|--nochunks) SGML_OPTIONS="$SGML_OPTIONS -V nochunks" - shift 1 - ;; - -V) SGML_OPTIONS="$SGML_OPTIONS -V $2" - shift 2 - ;; - -i|--include) case $2 in - print|html) echo "The marked section named \"$2\" is reserved for internal use by `basename $0`." >&2 - exit 1 - ;; - esac - SGML_INCLUDE="$SGML_INCLUDE -i $2" - shift 2 - ;; - -w|--warning) case $2 in - list) echo -e "List of allowed warning types (multiple -w options are allowed):\n" - echo -e $SGML_WARNINGS_LIST - exit 0 - ;; - xml|mixed|sgmldecl|should|default|duplicate|undefined|unclosed|empty|net|min-tag|unused-map|unused-param|notation-sysid|all|no-xml|no-mixed|no-sgmldecl|no-should|no-default|no-duplicate|no-undefined|no-unclosed|no-empty|no-net|no-min-tag|no-unused-map|no-unused-param|no-notation-sysid) \ - SGML_WARNINGS="$SGML_WARNINGS -w $2" - shift 2 - ;; - *) echo "Unknown warning type \"$2\". Allowed warning types are:" >&2 - echo -e $SGML_WARNINGS_LIST >&2 - exit 1 - ;; - esac - ;; - -e|--error) case $2 in - list) echo -e "List of allowed error types (multiple -e options are allowed):\n" - echo -e $SGML_ERRORS_LIST - exit 0 - ;; - no-idref|no-significant|no-valid) \ - SGML_WARNINGS="$SGML_WARNINGS -w $2" - shift 2 - ;; - *) echo "Unknown error type \"$2\". Allowed error types are:" >&2 - echo -e $SGML_ERRORS_LIST >&2 - exit 1 - ;; - esac - ;; - -h|--help) echo -e "`basename $0` - Jade Wrapper\n" - echo -e "$SGML_HELP_MESSAGE" - exit 0 - ;; - -v|--version) echo -e "$SGML_VERSION_MESSAGE" - exit 0 - ;; - -*) echo -e "$SGML_HELP_MESSAGE" >&2 - exit 1 - ;; - *) if [ -z "$SGML_FILE" ] - then - case "$1" in - /*) SGML_FILE="$1" ;; - *) SGML_FILE="$SGML_CURRENT_DIRECTORY/$1" ;; - esac - shift 1 - else - echo -e "$SGML_HELP_MESSAGE" >&2 - exit 1 - fi - ;; - esac -done - -# Check that we have a frontend -if [ -z "$SGML_FRONTEND" ] -then - echo -e $SGML_HELP_MESSAGE >&2 - exit 1 -fi -if [ ! -s "$SGML_FRONTEND" ] -then - echo "`basename $0`: There is no frontend called \"$SGML_FRONTEND\"." >&2 - exit 2 -fi - -# Check that we have a backend -if [ -z "$SGML_BACKEND" ] -then - echo -e $SGML_HELP_MESSAGE >&2 - exit 1 -fi -if [ ! -s $SGML_BACKEND ] -then - echo "`basename $0`: There is no backend called \"$SGML_BACKEND\"." >&2 - exit 2 -fi - -# Check that we have a file to process -if [ -z "$SGML_FILE" ] -then - echo -e $SGML_HELP_MESSAGE >&2 - exit 1 -fi -if [ ! -s "$SGML_FILE" ] -then - echo "`basename $0`: Cannot open \"$SGML_FILE\"." >&2 - exit 3 -fi - -# Separate the file name and the extension (if any) -SGML_FILE_NAME=`basename "$SGML_FILE"` -SGML_FILE_NAME=${SGML_FILE_NAME%.*} - -# Determine if we are in an XML file -SGML_XML=`head "$SGML_FILE" | grep "" | wc -l` -if [ $SGML_XML -eq 1 ]; then - SGML_XML="xml" -else - SGML_XML="sgml" -fi - -# Use SGML declaration for XML if needed -if [ "$SGML_DECL" = "" -a "$SGML_XML" = "xml" ] -then SGML_DECL=${SGML_BASE_DIR}/xml.dcl -fi - -# Try to find the SGML normalizer -if [ -z "$SGML_NORM" ] -then - SGML_NORM=`which sgmlnorm 2>/dev/null` - if [ -z "SGML_NORM" ] - then - SGML_NORM=`which osgmlnorm 2>/dev/null` - fi -fi - -# Set path to SGML catalogs (first try centralized catalog) -case $SGML_STANDARD_CATALOGS in - yes) export SGML_CATALOGS_DIR SGML_FILE SGML_XML SGML_NORM - SGML_CENTRALIZED_CATALOG=`sh $SGML_FRONTEND centralized-catalog` - if [ -s $SGML_CENTRALIZED_CATALOG ] - then - SGML_CATALOG_FILES=$SGML_CENTRALIZED_CATALOG - else - SGML_CATALOG_FILES=`find $SGML_BASE_DIR -name catalog` - SGML_CATALOG_FILES=`echo "$SGML_CATALOG_FILES" | tr [:space:] :` - fi - ;; - no) SGML_CATALOG_FILES="" - ;; -esac -SGML_CATALOG_FILES=${SGML_CATALOG_FILES}${SGML_EXTRA_CATALOGS} -SGML_CATALOG_FILES=`echo "$SGML_CATALOG_FILES" | sed 's/^://;s/:$//'` -if [ -z "$SGML_CATALOG_FILES" ] -then - echo "`basename $0`: Please specify at least one catalog" >&2 - exit 4 -fi - -# Determine the backend type -case $SGML_BACKEND in - *html|*txt) \ - SGML_TYPE=html - ;; - *) SGML_TYPE=print - ;; -esac - -# Determine which stylesheet to use -# (run the frontend to know it if the default stylesheet or no custom stylesheet is desired) -if [ "$SGML_STYLESHEET" = "default" -o "$SGML_STYLESHEET" = "none" ] -then - export SGML_BASE_DIR SGML_TYPE SGML_STYLESHEET - SGML_STYLESHEET=`sh $SGML_FRONTEND style-sheet` - SGML_RETURN=$? - if [ $SGML_RETURN -gt 0 ] - then exit `expr 7 + $SGML_RETURN` - fi -fi -if [ -z "$SGML_STYLESHEET" ] -then - echo "`basename $0`: Please specify at least one stylesheet" >&2 - exit 5 -fi - -case "$SGML_OPTIONS" in - *paper-type*) - ;; - *) - # Set the paper size to A4 if the locale suggests so - papersize= - if [ -x /usr/bin/locale ] - then - h=$(/usr/bin/locale LC_PAPER 2>/dev/null | head -n 1) - if [ "$h" = 297 ] - then - papersize=A4 - fi - fi - if [ -n "$papersize" ] - then - SGML_OPTIONS="-V paper-type=$papersize $SGML_OPTIONS" - fi - ;; -esac - -# Choose a parser -if [ -z "$SGML_JADE" ] -then - which jade >/dev/null 2>/dev/null - if [ $? -eq 0 ] - then - SGML_JADE="jade" - else - which openjade >/dev/null 2>/dev/null - if [ $? -eq 0 ] - then - SGML_JADE="openjade" - else - echo "`basename $0`: No parser available" >&2 - exit 6 - fi - fi -else - which $SGML_JADE >/dev/null 2>/dev/null - if [ $? -ne 0 ] - then - echo "`basename $0`: parser $SGML_JADE is not available" >&2 - exit 6 - fi -fi - -# Create output directory if not available -if [ -z "$SGML_OUTPUT_DIRECTORY" ] -then - echo -e $SGML_HELP_MESSAGE >&2 - exit 1 -fi -if [ ! -d "$SGML_OUTPUT_DIRECTORY" ] -then - mkdir "$SGML_OUTPUT_DIRECTORY" 2>/dev/null - if [ $? -ne 0 ] - then - echo "`basename $0`: Could not create \"$SGML_OUTPUT_DIRECTORY\" output directory" >&2 - exit 7 - fi -fi - -# Prepare the parser's arguments -SGML_ARGUMENTS="$SGML_INCLUDE -i $SGML_TYPE -d $SGML_STYLESHEET $SGML_OPTIONS $SGML_WARNINGS $SGML_DECL" - -# Call the backend -echo "Using catalogs: `echo $SGML_CATALOG_FILES | sed 's/:/, /g'`" -echo "Using stylesheet: $SGML_STYLESHEET" -echo "Working on: $SGML_FILE" -cd "$SGML_OUTPUT_DIRECTORY" -export SGML_JADE SGML_FILE_NAME SGML_ARGUMENTS -export SGML_CATALOG_FILES SGML_BASE_DIR SGML_FILE SGML_STYLESHEET -NOCHUNKS=`echo $SGML_OPTIONS | grep nochunks` -if [ -z "$NOCHUNKS" ] -then - sh $SGML_BACKEND -else - sh $SGML_BACKEND >"$SGML_FILE_NAME.html" -fi -SGML_RETURN=$? -cd "$SGML_CURRENT_DIRECTORY" - -if [ $SGML_RETURN -gt 0 ] -then exit `expr 7 + $SGML_RETURN` -fi -echo "Done." -exit 0 diff --git a/bin/jw.in.newgrep b/bin/jw.in.newgrep deleted file mode 100644 index df3dcfd..0000000 --- a/bin/jw.in.newgrep +++ /dev/null @@ -1,444 +0,0 @@ -#! /bin/sh -# Jade Wrapper -# Script to convert a SGML file into some other format -# Send any comments to Eric Bischoff -# This program is under GPL license. See LICENSE file for details. - -# Set help message -SGML_HELP_MESSAGE="Usage: `basename $0` [] \n\ -where are:\n\ -\040 -f|--frontend : \t Specify the frontend (source format)\n\ -\040 \t\t\t\t (default is docbook)\n\ -\040 -b|--backend : \t Specify the backend (destination format)\n\ -\040 \t\t\t\t (default is html)\n\ -\040 -c|--cat : \t\t Specify an extra SGML open catalog\n\ -\040 -n|--nostd: \t\t\t Do not use the standard SGML open catalogs\n\ -\040 -d|--dsl |default|none:\t Specify an alternate style sheet\n\ -\040 \t\t\t\t (default is to use the default stylesheet)\n\ -\040 -l|--dcl : \t\t Specify an alternate SGML declaration\n\ -\040 \t\t\t\t (usual ones like xml.dcl get detected automatically)\n\ -\040 -s|--sgmlbase : \t Change base directory for SGML distribution\n\ -\040 \t\t\t\t (usually @prefix@/share/sgml)\n\ -\040 -p|--parser : \t Specify the parser if several are installed\n\ -\040 \t\t\t\t (jade or openjade)\n\ -\040 -o|--output : \t Set output directory\n\ -\040 -u|--nochunks: \t\t Output only one big file\n\ -\040 \t\t\t\t (overrides the stylesheet settings)\n\ -\040 -i|--include
: \t Specify a SGML marked section to include\n\ -\040 \t\t\t\t (should be marked as \"ignore\" in the SGML text)\n\ -\040 -w|--warning |list: Control warnings or display the allowed warning types\n\ -\040 -e|--errors |list: Control errors or display the allowed error types\n\ -\040 -h|--help: \t\t\t Print this help message and exit\n\ -\040 -V : \t Set a variable\n\ -\040 -v|--version: \t\t Print the version and exit" - -# Set list of warning types -SGML_WARNINGS_LIST="\n\ -\040 xml \t\t Warn about constructs that are not allowed by XML\n\ -\040 mixed \t Warn about mixed content models that do not allow #pcdata anywhere\n\ -\040 sgmldecl \t Warn about various dubious constructions in the SGML declaration\n\ -\040 should \t Warn about various recommendations made in ISO 8879 that the document does not comply with\n\ -\040 default \t Warn about defaulted references\n\ -\040 duplicate \t Warn about duplicate entity declarations\n\ -\040 undefined \t Warn about undefined elements: elements used in the DTD but not defined\n\ -\040 unclosed \t Warn about unclosed start and end-tags\n\ -\040 empty \t Warn about empty start and end-tags\n\ -\040 net \t\t Warn about net-enabling start-tags and null end-tags\n\ -\040 min-tag \t Warn about minimized start and end-tags. Equivalent to: unclosed, empty and net\n\ -\040 unused-map \t Warn about unused short reference maps\n\ -\040 unused-param \t Warn about parameter entities that are defined but not used in a DTD\n\ -\040 notation-sysid Warn about notations for which no system identifier could be generated\n\ -\040 all \t\t Equivalent to: mixed, should, default, undefined, sgmldecl, unused-map, unused-param, empty and unclosed\n\n\ -\040 A warning can be disabled by using its name prefixed with no-. Example: -w all -w no-duplicate" - -# Set list of error types -SGML_ERRORS_LIST="\n\ -\040 no-idref \t No error for an ID reference value which no element has as its ID\n\ -\040 no-significant No errors for characters not significant in the reference concrete syntax\n\ -\040 no-valid \t Do not require the document to be type-valid" - -# Get name of main SGML configuration file -which sgmlwhich >/dev/null 2>/dev/null -if [ $? -eq 0 ] -then - SGML_CONF=`sgmlwhich` -else - SGML_CONF="/etc/sgml/sgml.conf" -fi - -# Set version message -SGML_VERSION_MESSAGE="DocBook-utils version @VERSION@ (jw version 1.1)" - -# Set option: use standard catalogs -SGML_STANDARD_CATALOGS="yes" - -# Set path to user SGML catalogs -SGML_EXTRA_CATALOGS="" - -# Set SGML base directory and centralized catalogs directory -SGML_BASE_DIR="@prefix@/share/sgml" -SGML_CATALOGS_DIR="/etc/sgml" -if [ -f "$SGML_CONF" ] -then - RE='^[:space:]*SGML_BASE_DIR[:space:]*=[:space:]*' - SGML_BASE_DIR=`grep --color=never $RE $SGML_CONF | sed "s/$RE//"` - RE='^[:space:]*SGML_CATALOGS_DIR[:space:]*=[:space:]*' - SGML_CATALOGS_DIR=`grep --color=never $RE $SGML_CONF | sed "s/$RE//"` -fi - -# Set frontend to use -SGML_FRONTEND="$SGML_BASE_DIR/docbook/utils-@VERSION@/frontends/docbook" - -# Set backend to use -SGML_BACKEND="$SGML_BASE_DIR/docbook/utils-@VERSION@/backends/html" - -# Set main stylesheet -SGML_STYLESHEET="default" - -# Set flavour of jade parser to use -SGML_JADE="" - -# Set SGML declaration and file to process -SGML_DECL="" -SGML_FILE="" - -# Set output and current directories -SGML_OUTPUT_DIRECTORY="." -SGML_CURRENT_DIRECTORY=`pwd` - -# Set of options to set -SGML_OPTIONS="" - -# Set list of "include" marked sections -SGML_INCLUDE="" - -# Set list of warning types and errors types -SGML_WARNINGS="" - -# Process options -while [ $# -gt 0 ] -do case $1 in - -f|--frontend) case "$2" in - /*) SGML_FRONTEND="$2" ;; - *) d=$SGML_BASE_DIR/docbook/utils-@VERSION@/frontends - SGML_FRONTEND="$d/$2" ;; - esac - shift 2 - ;; - -b|--backend) case "$2" in - /*) SGML_BACKEND="$2" ;; - *) d=$SGML_BASE_DIR/docbook/utils-@VERSION@/backends - SGML_BACKEND="$d/$2" ;; - esac - shift 2 - ;; - -c|--cat) case "$2" in - /*) SGML_EXTRA_CATALOGS="$SGML_EXTRA_CATALOGS:$2" ;; - *) SGML_EXTRA_CATALOGS="$SGML_EXTRA_CATALOGS:$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -d|--dsl) case "$2" in - /*|none|default) SGML_STYLESHEET="$2" ;; - *) SGML_STYLESHEET="$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -l|--dcl) case "$2" in - /*) SGML_DECL="$2" ;; - *) SGML_DECL="$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -n|--nostd) SGML_STANDARD_CATALOGS="no" - shift 1 - ;; - -s|--sgmlbase) case "$2" in - /*) SGML_BASE_DIR="$2" ;; - *) SGML_BASE_DIR="$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -p|--parser) case "$2" in - /*) SGML_JADE="$2" ;; - *) SGML_JADE="$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -o|--output) case "$2" in - /*) SGML_OUTPUT_DIRECTORY="$2" ;; - *) SGML_OUTPUT_DIRECTORY="$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -u|--nochunks) SGML_OPTIONS="$SGML_OPTIONS -V nochunks" - shift 1 - ;; - -V) SGML_OPTIONS="$SGML_OPTIONS -V $2" - shift 2 - ;; - -i|--include) case $2 in - print|html) echo "The marked section named \"$2\" is reserved for internal use by `basename $0`." >&2 - exit 1 - ;; - esac - SGML_INCLUDE="$SGML_INCLUDE -i $2" - shift 2 - ;; - -w|--warning) case $2 in - list) echo -e "List of allowed warning types (multiple -w options are allowed):\n" - echo -e $SGML_WARNINGS_LIST - exit 0 - ;; - xml|mixed|sgmldecl|should|default|duplicate|undefined|unclosed|empty|net|min-tag|unused-map|unused-param|notation-sysid|all|no-xml|no-mixed|no-sgmldecl|no-should|no-default|no-duplicate|no-undefined|no-unclosed|no-empty|no-net|no-min-tag|no-unused-map|no-unused-param|no-notation-sysid) \ - SGML_WARNINGS="$SGML_WARNINGS -w $2" - shift 2 - ;; - *) echo "Unknown warning type \"$2\". Allowed warning types are:" >&2 - echo -e $SGML_WARNINGS_LIST >&2 - exit 1 - ;; - esac - ;; - -e|--error) case $2 in - list) echo -e "List of allowed error types (multiple -e options are allowed):\n" - echo -e $SGML_ERRORS_LIST - exit 0 - ;; - no-idref|no-significant|no-valid) \ - SGML_WARNINGS="$SGML_WARNINGS -w $2" - shift 2 - ;; - *) echo "Unknown error type \"$2\". Allowed error types are:" >&2 - echo -e $SGML_ERRORS_LIST >&2 - exit 1 - ;; - esac - ;; - -h|--help) echo -e "`basename $0` - Jade Wrapper\n" - echo -e "$SGML_HELP_MESSAGE" - exit 0 - ;; - -v|--version) echo -e "$SGML_VERSION_MESSAGE" - exit 0 - ;; - -*) echo -e "$SGML_HELP_MESSAGE" >&2 - exit 1 - ;; - *) if [ -z "$SGML_FILE" ] - then - case "$1" in - /*) SGML_FILE="$1" ;; - *) SGML_FILE="$SGML_CURRENT_DIRECTORY/$1" ;; - esac - shift 1 - else - echo -e "$SGML_HELP_MESSAGE" >&2 - exit 1 - fi - ;; - esac -done - -# Check that we have a frontend -if [ -z "$SGML_FRONTEND" ] -then - echo -e $SGML_HELP_MESSAGE >&2 - exit 1 -fi -if [ ! -s "$SGML_FRONTEND" ] -then - echo "`basename $0`: There is no frontend called \"$SGML_FRONTEND\"." >&2 - exit 2 -fi - -# Check that we have a backend -if [ -z "$SGML_BACKEND" ] -then - echo -e $SGML_HELP_MESSAGE >&2 - exit 1 -fi -if [ ! -s $SGML_BACKEND ] -then - echo "`basename $0`: There is no backend called \"$SGML_BACKEND\"." >&2 - exit 2 -fi - -# Check that we have a file to process -if [ -z "$SGML_FILE" ] -then - echo -e $SGML_HELP_MESSAGE >&2 - exit 1 -fi -if [ ! -s "$SGML_FILE" ] -then - echo "`basename $0`: Cannot open \"$SGML_FILE\"." >&2 - exit 3 -fi - -# Separate the file name and the extension (if any) -SGML_FILE_NAME=`basename "$SGML_FILE"` -SGML_FILE_NAME=${SGML_FILE_NAME%.*} - -# Determine if we are in an XML file -SGML_XML=`head "$SGML_FILE" | grep "" | wc -l` -if [ $SGML_XML -eq 1 ]; then - SGML_XML="xml" -else - SGML_XML="sgml" -fi - -# Use SGML declaration for XML if needed -if [ "$SGML_DECL" = "" -a "$SGML_XML" = "xml" ] -then SGML_DECL=${SGML_BASE_DIR}/xml.dcl -fi - -# Try to find the SGML normalizer -if [ -z "$SGML_NORM" ] -then - SGML_NORM=`which sgmlnorm 2>/dev/null` - if [ -z "SGML_NORM" ] - then - SGML_NORM=`which osgmlnorm 2>/dev/null` - fi -fi - -# Set path to SGML catalogs (first try centralized catalog) -case $SGML_STANDARD_CATALOGS in - yes) export SGML_CATALOGS_DIR SGML_FILE SGML_XML SGML_NORM - SGML_CENTRALIZED_CATALOG=`sh $SGML_FRONTEND centralized-catalog` - if [ -s $SGML_CENTRALIZED_CATALOG ] - then - SGML_CATALOG_FILES=$SGML_CENTRALIZED_CATALOG - else - SGML_CATALOG_FILES=`find $SGML_BASE_DIR -name catalog` - SGML_CATALOG_FILES=`echo "$SGML_CATALOG_FILES" | tr [:space:] :` - fi - ;; - no) SGML_CATALOG_FILES="" - ;; -esac -SGML_CATALOG_FILES=${SGML_CATALOG_FILES}${SGML_EXTRA_CATALOGS} -SGML_CATALOG_FILES=`echo "$SGML_CATALOG_FILES" | sed 's/^://;s/:$//'` -if [ -z "$SGML_CATALOG_FILES" ] -then - echo "`basename $0`: Please specify at least one catalog" >&2 - exit 4 -fi - -# Determine the backend type -case $SGML_BACKEND in - *html|*txt) \ - SGML_TYPE=html - ;; - *) SGML_TYPE=print - ;; -esac - -# Determine which stylesheet to use -# (run the frontend to know it if the default stylesheet or no custom stylesheet is desired) -if [ "$SGML_STYLESHEET" = "default" -o "$SGML_STYLESHEET" = "none" ] -then - export SGML_BASE_DIR SGML_TYPE SGML_STYLESHEET - SGML_STYLESHEET=`sh $SGML_FRONTEND style-sheet` - SGML_RETURN=$? - if [ $SGML_RETURN -gt 0 ] - then exit `expr 7 + $SGML_RETURN` - fi -fi -if [ -z "$SGML_STYLESHEET" ] -then - echo "`basename $0`: Please specify at least one stylesheet" >&2 - exit 5 -fi - -case "$SGML_OPTIONS" in - *paper-type*) - ;; - *) - # Set the paper size to A4 if the locale suggests so - papersize= - if [ -x /usr/bin/locale ] - then - h=$(/usr/bin/locale LC_PAPER 2>/dev/null | head -n 1) - if [ "$h" = 297 ] - then - papersize=A4 - fi - fi - if [ -n "$papersize" ] - then - SGML_OPTIONS="-V %paper-type%=$papersize $SGML_OPTIONS" - fi - ;; -esac - -# Choose a parser -if [ -z "$SGML_JADE" ] -then - which jade >/dev/null 2>/dev/null - if [ $? -eq 0 ] - then - SGML_JADE="jade" - else - which openjade >/dev/null 2>/dev/null - if [ $? -eq 0 ] - then - SGML_JADE="openjade" - else - echo "`basename $0`: No parser available" >&2 - exit 6 - fi - fi -else - which $SGML_JADE >/dev/null 2>/dev/null - if [ $? -ne 0 ] - then - echo "`basename $0`: parser $SGML_JADE is not available" >&2 - exit 6 - fi -fi - -# Create output directory if not available -if [ -z "$SGML_OUTPUT_DIRECTORY" ] -then - echo -e $SGML_HELP_MESSAGE >&2 - exit 1 -fi -if [ ! -d "$SGML_OUTPUT_DIRECTORY" ] -then - mkdir "$SGML_OUTPUT_DIRECTORY" 2>/dev/null - if [ $? -ne 0 ] - then - echo "`basename $0`: Could not create \"$SGML_OUTPUT_DIRECTORY\" output directory" >&2 - exit 7 - fi -fi - -# Prepare the parser's arguments -SGML_ARGUMENTS="$SGML_INCLUDE -i $SGML_TYPE -d $SGML_STYLESHEET $SGML_OPTIONS $SGML_WARNINGS $SGML_DECL" - -# Call the backend -echo "Using catalogs: `echo $SGML_CATALOG_FILES | sed 's/:/, /g'`" -echo "Using stylesheet: $SGML_STYLESHEET" -echo "Working on: $SGML_FILE" -cd "$SGML_OUTPUT_DIRECTORY" -export SGML_JADE SGML_FILE_NAME SGML_ARGUMENTS SGML_INCLUDE -export SGML_CATALOG_FILES SGML_BASE_DIR SGML_FILE SGML_STYLESHEET -NOCHUNKS=`echo $SGML_OPTIONS | grep nochunks` -if [ -z "$NOCHUNKS" ] -then - sh $SGML_BACKEND -else - sh $SGML_BACKEND >"$SGML_FILE_NAME.html" -fi -SGML_RETURN=$? -cd "$SGML_CURRENT_DIRECTORY" - -if [ $SGML_RETURN -gt 0 ] -then exit `expr 7 + $SGML_RETURN` -fi -#Final echo commented out, it causes manpage noise when generating some -#manpages with new perl(#513271, #587012) -#echo "Done." -exit 0 diff --git a/bin/jw.in.papersize b/bin/jw.in.papersize deleted file mode 100644 index 7b2a373..0000000 --- a/bin/jw.in.papersize +++ /dev/null @@ -1,442 +0,0 @@ -#! /bin/sh -# Jade Wrapper -# Script to convert a SGML file into some other format -# Send any comments to Eric Bischoff -# This program is under GPL license. See LICENSE file for details. - -# Set help message -SGML_HELP_MESSAGE="Usage: `basename $0` [] \n\ -where are:\n\ -\040 -f|--frontend : \t Specify the frontend (source format)\n\ -\040 \t\t\t\t (default is docbook)\n\ -\040 -b|--backend : \t Specify the backend (destination format)\n\ -\040 \t\t\t\t (default is html)\n\ -\040 -c|--cat : \t\t Specify an extra SGML open catalog\n\ -\040 -n|--nostd: \t\t\t Do not use the standard SGML open catalogs\n\ -\040 -d|--dsl |default|none:\t Specify an alternate style sheet\n\ -\040 \t\t\t\t (default is to use the default stylesheet)\n\ -\040 -l|--dcl : \t\t Specify an alternate SGML declaration\n\ -\040 \t\t\t\t (usual ones like xml.dcl get detected automatically)\n\ -\040 -s|--sgmlbase : \t Change base directory for SGML distribution\n\ -\040 \t\t\t\t (usually @prefix@/share/sgml)\n\ -\040 -p|--parser : \t Specify the parser if several are installed\n\ -\040 \t\t\t\t (jade or openjade)\n\ -\040 -o|--output : \t Set output directory\n\ -\040 -u|--nochunks: \t\t Output only one big file\n\ -\040 \t\t\t\t (overrides the stylesheet settings)\n\ -\040 -i|--include
: \t Specify a SGML marked section to include\n\ -\040 \t\t\t\t (should be marked as \"ignore\" in the SGML text)\n\ -\040 -w|--warning |list: Control warnings or display the allowed warning types\n\ -\040 -e|--errors |list: Control errors or display the allowed error types\n\ -\040 -h|--help: \t\t\t Print this help message and exit\n\ -\040 -V : \t Set a variable\n\ -\040 -v|--version: \t\t Print the version and exit" - -# Set list of warning types -SGML_WARNINGS_LIST="\n\ -\040 xml \t\t Warn about constructs that are not allowed by XML\n\ -\040 mixed \t Warn about mixed content models that do not allow #pcdata anywhere\n\ -\040 sgmldecl \t Warn about various dubious constructions in the SGML declaration\n\ -\040 should \t Warn about various recommendations made in ISO 8879 that the document does not comply with\n\ -\040 default \t Warn about defaulted references\n\ -\040 duplicate \t Warn about duplicate entity declarations\n\ -\040 undefined \t Warn about undefined elements: elements used in the DTD but not defined\n\ -\040 unclosed \t Warn about unclosed start and end-tags\n\ -\040 empty \t Warn about empty start and end-tags\n\ -\040 net \t\t Warn about net-enabling start-tags and null end-tags\n\ -\040 min-tag \t Warn about minimized start and end-tags. Equivalent to: unclosed, empty and net\n\ -\040 unused-map \t Warn about unused short reference maps\n\ -\040 unused-param \t Warn about parameter entities that are defined but not used in a DTD\n\ -\040 notation-sysid Warn about notations for which no system identifier could be generated\n\ -\040 all \t\t Equivalent to: mixed, should, default, undefined, sgmldecl, unused-map, unused-param, empty and unclosed\n\n\ -\040 A warning can be disabled by using its name prefixed with no-. Example: -w all -w no-duplicate" - -# Set list of error types -SGML_ERRORS_LIST="\n\ -\040 no-idref \t No error for an ID reference value which no element has as its ID\n\ -\040 no-significant No errors for characters not significant in the reference concrete syntax\n\ -\040 no-valid \t Do not require the document to be type-valid" - -# Get name of main SGML configuration file -which sgmlwhich >/dev/null 2>/dev/null -if [ $? -eq 0 ] -then - SGML_CONF=`sgmlwhich` -else - SGML_CONF="/etc/sgml/sgml.conf" -fi - -# Set version message -SGML_VERSION_MESSAGE="DocBook-utils version @VERSION@ (jw version 1.1)" - -# Set option: use standard catalogs -SGML_STANDARD_CATALOGS="yes" - -# Set path to user SGML catalogs -SGML_EXTRA_CATALOGS="" - -# Set SGML base directory and centralized catalogs directory -SGML_BASE_DIR="@prefix@/share/sgml" -SGML_CATALOGS_DIR="/etc/sgml" -if [ -f "$SGML_CONF" ] -then - RE='^[:space:]*SGML_BASE_DIR[:space:]*=[:space:]*' - SGML_BASE_DIR=`grep --color=never $RE $SGML_CONF | sed "s/$RE//"` - RE='^[:space:]*SGML_CATALOGS_DIR[:space:]*=[:space:]*' - SGML_CATALOGS_DIR=`grep --color=never $RE $SGML_CONF | sed "s/$RE//"` -fi - -# Set frontend to use -SGML_FRONTEND="$SGML_BASE_DIR/docbook/utils-@VERSION@/frontends/docbook" - -# Set backend to use -SGML_BACKEND="$SGML_BASE_DIR/docbook/utils-@VERSION@/backends/html" - -# Set main stylesheet -SGML_STYLESHEET="default" - -# Set flavour of jade parser to use -SGML_JADE="" - -# Set SGML declaration and file to process -SGML_DECL="" -SGML_FILE="" - -# Set output and current directories -SGML_OUTPUT_DIRECTORY="." -SGML_CURRENT_DIRECTORY=`pwd` - -# Set of options to set -SGML_OPTIONS="" - -# Set list of "include" marked sections -SGML_INCLUDE="" - -# Set list of warning types and errors types -SGML_WARNINGS="" - -# Process options -while [ $# -gt 0 ] -do case $1 in - -f|--frontend) case "$2" in - /*) SGML_FRONTEND="$2" ;; - *) d=$SGML_BASE_DIR/docbook/utils-@VERSION@/frontends - SGML_FRONTEND="$d/$2" ;; - esac - shift 2 - ;; - -b|--backend) case "$2" in - /*) SGML_BACKEND="$2" ;; - *) d=$SGML_BASE_DIR/docbook/utils-@VERSION@/backends - SGML_BACKEND="$d/$2" ;; - esac - shift 2 - ;; - -c|--cat) case "$2" in - /*) SGML_EXTRA_CATALOGS="$SGML_EXTRA_CATALOGS:$2" ;; - *) SGML_EXTRA_CATALOGS="$SGML_EXTRA_CATALOGS:$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -d|--dsl) case "$2" in - /*|none|default) SGML_STYLESHEET="$2" ;; - *) SGML_STYLESHEET="$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -l|--dcl) case "$2" in - /*) SGML_DECL="$2" ;; - *) SGML_DECL="$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -n|--nostd) SGML_STANDARD_CATALOGS="no" - shift 1 - ;; - -s|--sgmlbase) case "$2" in - /*) SGML_BASE_DIR="$2" ;; - *) SGML_BASE_DIR="$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -p|--parser) case "$2" in - /*) SGML_JADE="$2" ;; - *) SGML_JADE="$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -o|--output) case "$2" in - /*) SGML_OUTPUT_DIRECTORY="$2" ;; - *) SGML_OUTPUT_DIRECTORY="$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -u|--nochunks) SGML_OPTIONS="$SGML_OPTIONS -V nochunks" - shift 1 - ;; - -V) SGML_OPTIONS="$SGML_OPTIONS -V $2" - shift 2 - ;; - -i|--include) case $2 in - print|html) echo "The marked section named \"$2\" is reserved for internal use by `basename $0`." >&2 - exit 1 - ;; - esac - SGML_INCLUDE="$SGML_INCLUDE -i $2" - shift 2 - ;; - -w|--warning) case $2 in - list) echo -e "List of allowed warning types (multiple -w options are allowed):\n" - echo -e $SGML_WARNINGS_LIST - exit 0 - ;; - xml|mixed|sgmldecl|should|default|duplicate|undefined|unclosed|empty|net|min-tag|unused-map|unused-param|notation-sysid|all|no-xml|no-mixed|no-sgmldecl|no-should|no-default|no-duplicate|no-undefined|no-unclosed|no-empty|no-net|no-min-tag|no-unused-map|no-unused-param|no-notation-sysid) \ - SGML_WARNINGS="$SGML_WARNINGS -w $2" - shift 2 - ;; - *) echo "Unknown warning type \"$2\". Allowed warning types are:" >&2 - echo -e $SGML_WARNINGS_LIST >&2 - exit 1 - ;; - esac - ;; - -e|--error) case $2 in - list) echo -e "List of allowed error types (multiple -e options are allowed):\n" - echo -e $SGML_ERRORS_LIST - exit 0 - ;; - no-idref|no-significant|no-valid) \ - SGML_WARNINGS="$SGML_WARNINGS -w $2" - shift 2 - ;; - *) echo "Unknown error type \"$2\". Allowed error types are:" >&2 - echo -e $SGML_ERRORS_LIST >&2 - exit 1 - ;; - esac - ;; - -h|--help) echo -e "`basename $0` - Jade Wrapper\n" - echo -e "$SGML_HELP_MESSAGE" - exit 0 - ;; - -v|--version) echo -e "$SGML_VERSION_MESSAGE" - exit 0 - ;; - -*) echo -e "$SGML_HELP_MESSAGE" >&2 - exit 1 - ;; - *) if [ -z "$SGML_FILE" ] - then - case "$1" in - /*) SGML_FILE="$1" ;; - *) SGML_FILE="$SGML_CURRENT_DIRECTORY/$1" ;; - esac - shift 1 - else - echo -e "$SGML_HELP_MESSAGE" >&2 - exit 1 - fi - ;; - esac -done - -# Check that we have a frontend -if [ -z "$SGML_FRONTEND" ] -then - echo -e $SGML_HELP_MESSAGE >&2 - exit 1 -fi -if [ ! -s "$SGML_FRONTEND" ] -then - echo "`basename $0`: There is no frontend called \"$SGML_FRONTEND\"." >&2 - exit 2 -fi - -# Check that we have a backend -if [ -z "$SGML_BACKEND" ] -then - echo -e $SGML_HELP_MESSAGE >&2 - exit 1 -fi -if [ ! -s $SGML_BACKEND ] -then - echo "`basename $0`: There is no backend called \"$SGML_BACKEND\"." >&2 - exit 2 -fi - -# Check that we have a file to process -if [ -z "$SGML_FILE" ] -then - echo -e $SGML_HELP_MESSAGE >&2 - exit 1 -fi -if [ ! -s "$SGML_FILE" ] -then - echo "`basename $0`: Cannot open \"$SGML_FILE\"." >&2 - exit 3 -fi - -# Separate the file name and the extension (if any) -SGML_FILE_NAME=`basename "$SGML_FILE"` -SGML_FILE_NAME=${SGML_FILE_NAME%.*} - -# Determine if we are in an XML file -SGML_XML=`head "$SGML_FILE" | grep "" | wc -l` -if [ $SGML_XML -eq 1 ]; then - SGML_XML="xml" -else - SGML_XML="sgml" -fi - -# Use SGML declaration for XML if needed -if [ "$SGML_DECL" = "" -a "$SGML_XML" = "xml" ] -then SGML_DECL=${SGML_BASE_DIR}/xml.dcl -fi - -# Try to find the SGML normalizer -if [ -z "$SGML_NORM" ] -then - SGML_NORM=`which sgmlnorm 2>/dev/null` - if [ -z "SGML_NORM" ] - then - SGML_NORM=`which osgmlnorm 2>/dev/null` - fi -fi - -# Set path to SGML catalogs (first try centralized catalog) -case $SGML_STANDARD_CATALOGS in - yes) export SGML_CATALOGS_DIR SGML_FILE SGML_XML SGML_NORM - SGML_CENTRALIZED_CATALOG=`sh $SGML_FRONTEND centralized-catalog` - if [ -s $SGML_CENTRALIZED_CATALOG ] - then - SGML_CATALOG_FILES=$SGML_CENTRALIZED_CATALOG - else - SGML_CATALOG_FILES=`find $SGML_BASE_DIR -name catalog` - SGML_CATALOG_FILES=`echo "$SGML_CATALOG_FILES" | tr [:space:] :` - fi - ;; - no) SGML_CATALOG_FILES="" - ;; -esac -SGML_CATALOG_FILES=${SGML_CATALOG_FILES}${SGML_EXTRA_CATALOGS} -SGML_CATALOG_FILES=`echo "$SGML_CATALOG_FILES" | sed 's/^://;s/:$//'` -if [ -z "$SGML_CATALOG_FILES" ] -then - echo "`basename $0`: Please specify at least one catalog" >&2 - exit 4 -fi - -# Determine the backend type -case $SGML_BACKEND in - *html|*txt) \ - SGML_TYPE=html - ;; - *) SGML_TYPE=print - ;; -esac - -# Determine which stylesheet to use -# (run the frontend to know it if the default stylesheet or no custom stylesheet is desired) -if [ "$SGML_STYLESHEET" = "default" -o "$SGML_STYLESHEET" = "none" ] -then - export SGML_BASE_DIR SGML_TYPE SGML_STYLESHEET - SGML_STYLESHEET=`sh $SGML_FRONTEND style-sheet` - SGML_RETURN=$? - if [ $SGML_RETURN -gt 0 ] - then exit `expr 7 + $SGML_RETURN` - fi -fi -if [ -z "$SGML_STYLESHEET" ] -then - echo "`basename $0`: Please specify at least one stylesheet" >&2 - exit 5 -fi - -case "$SGML_OPTIONS" in - *paper-type*) - ;; - *) - # Set the paper size to A4 if the locale suggests so - papersize= - if [ -x /usr/bin/locale ] - then - h=$(/usr/bin/locale LC_PAPER 2>/dev/null | head -n 1) - if [ "$h" = 297 ] - then - papersize=A4 - fi - fi - if [ -n "$papersize" ] - then - SGML_OPTIONS="-V paper-type=$papersize $SGML_OPTIONS" - fi - ;; -esac - -# Choose a parser -if [ -z "$SGML_JADE" ] -then - which jade >/dev/null 2>/dev/null - if [ $? -eq 0 ] - then - SGML_JADE="jade" - else - which openjade >/dev/null 2>/dev/null - if [ $? -eq 0 ] - then - SGML_JADE="openjade" - else - echo "`basename $0`: No parser available" >&2 - exit 6 - fi - fi -else - which $SGML_JADE >/dev/null 2>/dev/null - if [ $? -ne 0 ] - then - echo "`basename $0`: parser $SGML_JADE is not available" >&2 - exit 6 - fi -fi - -# Create output directory if not available -if [ -z "$SGML_OUTPUT_DIRECTORY" ] -then - echo -e $SGML_HELP_MESSAGE >&2 - exit 1 -fi -if [ ! -d "$SGML_OUTPUT_DIRECTORY" ] -then - mkdir "$SGML_OUTPUT_DIRECTORY" 2>/dev/null - if [ $? -ne 0 ] - then - echo "`basename $0`: Could not create \"$SGML_OUTPUT_DIRECTORY\" output directory" >&2 - exit 7 - fi -fi - -# Prepare the parser's arguments -SGML_ARGUMENTS="$SGML_INCLUDE -i $SGML_TYPE -d $SGML_STYLESHEET $SGML_OPTIONS $SGML_WARNINGS $SGML_DECL" - -# Call the backend -echo "Using catalogs: `echo $SGML_CATALOG_FILES | sed 's/:/, /g'`" -echo "Using stylesheet: $SGML_STYLESHEET" -echo "Working on: $SGML_FILE" -cd "$SGML_OUTPUT_DIRECTORY" -export SGML_JADE SGML_FILE_NAME SGML_ARGUMENTS SGML_INCLUDE -export SGML_CATALOG_FILES SGML_BASE_DIR SGML_FILE SGML_STYLESHEET -NOCHUNKS=`echo $SGML_OPTIONS | grep nochunks` -if [ -z "$NOCHUNKS" ] -then - sh $SGML_BACKEND -else - sh $SGML_BACKEND >"$SGML_FILE_NAME.html" -fi -SGML_RETURN=$? -cd "$SGML_CURRENT_DIRECTORY" - -if [ $SGML_RETURN -gt 0 ] -then exit `expr 7 + $SGML_RETURN` -fi -echo "Done." -exit 0 diff --git a/bin/jw.in.sgmlinclude b/bin/jw.in.sgmlinclude deleted file mode 100644 index 2523d10..0000000 --- a/bin/jw.in.sgmlinclude +++ /dev/null @@ -1,442 +0,0 @@ -#! /bin/sh -# Jade Wrapper -# Script to convert a SGML file into some other format -# Send any comments to Eric Bischoff -# This program is under GPL license. See LICENSE file for details. - -# Set help message -SGML_HELP_MESSAGE="Usage: `basename $0` [] \n\ -where are:\n\ -\040 -f|--frontend : \t Specify the frontend (source format)\n\ -\040 \t\t\t\t (default is docbook)\n\ -\040 -b|--backend : \t Specify the backend (destination format)\n\ -\040 \t\t\t\t (default is html)\n\ -\040 -c|--cat : \t\t Specify an extra SGML open catalog\n\ -\040 -n|--nostd: \t\t\t Do not use the standard SGML open catalogs\n\ -\040 -d|--dsl |default|none:\t Specify an alternate style sheet\n\ -\040 \t\t\t\t (default is to use the default stylesheet)\n\ -\040 -l|--dcl : \t\t Specify an alternate SGML declaration\n\ -\040 \t\t\t\t (usual ones like xml.dcl get detected automatically)\n\ -\040 -s|--sgmlbase : \t Change base directory for SGML distribution\n\ -\040 \t\t\t\t (usually @prefix@/share/sgml)\n\ -\040 -p|--parser : \t Specify the parser if several are installed\n\ -\040 \t\t\t\t (jade or openjade)\n\ -\040 -o|--output : \t Set output directory\n\ -\040 -u|--nochunks: \t\t Output only one big file\n\ -\040 \t\t\t\t (overrides the stylesheet settings)\n\ -\040 -i|--include
: \t Specify a SGML marked section to include\n\ -\040 \t\t\t\t (should be marked as \"ignore\" in the SGML text)\n\ -\040 -w|--warning |list: Control warnings or display the allowed warning types\n\ -\040 -e|--errors |list: Control errors or display the allowed error types\n\ -\040 -h|--help: \t\t\t Print this help message and exit\n\ -\040 -V : \t Set a variable\n\ -\040 -v|--version: \t\t Print the version and exit" - -# Set list of warning types -SGML_WARNINGS_LIST="\n\ -\040 xml \t\t Warn about constructs that are not allowed by XML\n\ -\040 mixed \t Warn about mixed content models that do not allow #pcdata anywhere\n\ -\040 sgmldecl \t Warn about various dubious constructions in the SGML declaration\n\ -\040 should \t Warn about various recommendations made in ISO 8879 that the document does not comply with\n\ -\040 default \t Warn about defaulted references\n\ -\040 duplicate \t Warn about duplicate entity declarations\n\ -\040 undefined \t Warn about undefined elements: elements used in the DTD but not defined\n\ -\040 unclosed \t Warn about unclosed start and end-tags\n\ -\040 empty \t Warn about empty start and end-tags\n\ -\040 net \t\t Warn about net-enabling start-tags and null end-tags\n\ -\040 min-tag \t Warn about minimized start and end-tags. Equivalent to: unclosed, empty and net\n\ -\040 unused-map \t Warn about unused short reference maps\n\ -\040 unused-param \t Warn about parameter entities that are defined but not used in a DTD\n\ -\040 notation-sysid Warn about notations for which no system identifier could be generated\n\ -\040 all \t\t Equivalent to: mixed, should, default, undefined, sgmldecl, unused-map, unused-param, empty and unclosed\n\n\ -\040 A warning can be disabled by using its name prefixed with no-. Example: -w all -w no-duplicate" - -# Set list of error types -SGML_ERRORS_LIST="\n\ -\040 no-idref \t No error for an ID reference value which no element has as its ID\n\ -\040 no-significant No errors for characters not significant in the reference concrete syntax\n\ -\040 no-valid \t Do not require the document to be type-valid" - -# Get name of main SGML configuration file -which sgmlwhich >/dev/null 2>/dev/null -if [ $? -eq 0 ] -then - SGML_CONF=`sgmlwhich` -else - SGML_CONF="/etc/sgml/sgml.conf" -fi - -# Set version message -SGML_VERSION_MESSAGE="DocBook-utils version @VERSION@ (jw version 1.1)" - -# Set option: use standard catalogs -SGML_STANDARD_CATALOGS="yes" - -# Set path to user SGML catalogs -SGML_EXTRA_CATALOGS="" - -# Set SGML base directory and centralized catalogs directory -SGML_BASE_DIR="@prefix@/share/sgml" -SGML_CATALOGS_DIR="/etc/sgml" -if [ -f "$SGML_CONF" ] -then - RE='^[:space:]*SGML_BASE_DIR[:space:]*=[:space:]*' - SGML_BASE_DIR=`grep --color=never $RE $SGML_CONF | sed "s/$RE//"` - RE='^[:space:]*SGML_CATALOGS_DIR[:space:]*=[:space:]*' - SGML_CATALOGS_DIR=`grep --color=never $RE $SGML_CONF | sed "s/$RE//"` -fi - -# Set frontend to use -SGML_FRONTEND="$SGML_BASE_DIR/docbook/utils-@VERSION@/frontends/docbook" - -# Set backend to use -SGML_BACKEND="$SGML_BASE_DIR/docbook/utils-@VERSION@/backends/html" - -# Set main stylesheet -SGML_STYLESHEET="default" - -# Set flavour of jade parser to use -SGML_JADE="" - -# Set SGML declaration and file to process -SGML_DECL="" -SGML_FILE="" - -# Set output and current directories -SGML_OUTPUT_DIRECTORY="." -SGML_CURRENT_DIRECTORY=`pwd` - -# Set of options to set -SGML_OPTIONS="" - -# Set list of "include" marked sections -SGML_INCLUDE="" - -# Set list of warning types and errors types -SGML_WARNINGS="" - -# Process options -while [ $# -gt 0 ] -do case $1 in - -f|--frontend) case "$2" in - /*) SGML_FRONTEND="$2" ;; - *) d=$SGML_BASE_DIR/docbook/utils-@VERSION@/frontends - SGML_FRONTEND="$d/$2" ;; - esac - shift 2 - ;; - -b|--backend) case "$2" in - /*) SGML_BACKEND="$2" ;; - *) d=$SGML_BASE_DIR/docbook/utils-@VERSION@/backends - SGML_BACKEND="$d/$2" ;; - esac - shift 2 - ;; - -c|--cat) case "$2" in - /*) SGML_EXTRA_CATALOGS="$SGML_EXTRA_CATALOGS:$2" ;; - *) SGML_EXTRA_CATALOGS="$SGML_EXTRA_CATALOGS:$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -d|--dsl) case "$2" in - /*|none|default) SGML_STYLESHEET="$2" ;; - *) SGML_STYLESHEET="$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -l|--dcl) case "$2" in - /*) SGML_DECL="$2" ;; - *) SGML_DECL="$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -n|--nostd) SGML_STANDARD_CATALOGS="no" - shift 1 - ;; - -s|--sgmlbase) case "$2" in - /*) SGML_BASE_DIR="$2" ;; - *) SGML_BASE_DIR="$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -p|--parser) case "$2" in - /*) SGML_JADE="$2" ;; - *) SGML_JADE="$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -o|--output) case "$2" in - /*) SGML_OUTPUT_DIRECTORY="$2" ;; - *) SGML_OUTPUT_DIRECTORY="$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -u|--nochunks) SGML_OPTIONS="$SGML_OPTIONS -V nochunks" - shift 1 - ;; - -V) SGML_OPTIONS="$SGML_OPTIONS -V $2" - shift 2 - ;; - -i|--include) case $2 in - print|html) echo "The marked section named \"$2\" is reserved for internal use by `basename $0`." >&2 - exit 1 - ;; - esac - SGML_INCLUDE="$SGML_INCLUDE -i $2" - shift 2 - ;; - -w|--warning) case $2 in - list) echo -e "List of allowed warning types (multiple -w options are allowed):\n" - echo -e $SGML_WARNINGS_LIST - exit 0 - ;; - xml|mixed|sgmldecl|should|default|duplicate|undefined|unclosed|empty|net|min-tag|unused-map|unused-param|notation-sysid|all|no-xml|no-mixed|no-sgmldecl|no-should|no-default|no-duplicate|no-undefined|no-unclosed|no-empty|no-net|no-min-tag|no-unused-map|no-unused-param|no-notation-sysid) \ - SGML_WARNINGS="$SGML_WARNINGS -w $2" - shift 2 - ;; - *) echo "Unknown warning type \"$2\". Allowed warning types are:" >&2 - echo -e $SGML_WARNINGS_LIST >&2 - exit 1 - ;; - esac - ;; - -e|--error) case $2 in - list) echo -e "List of allowed error types (multiple -e options are allowed):\n" - echo -e $SGML_ERRORS_LIST - exit 0 - ;; - no-idref|no-significant|no-valid) \ - SGML_WARNINGS="$SGML_WARNINGS -w $2" - shift 2 - ;; - *) echo "Unknown error type \"$2\". Allowed error types are:" >&2 - echo -e $SGML_ERRORS_LIST >&2 - exit 1 - ;; - esac - ;; - -h|--help) echo -e "`basename $0` - Jade Wrapper\n" - echo -e "$SGML_HELP_MESSAGE" - exit 0 - ;; - -v|--version) echo -e "$SGML_VERSION_MESSAGE" - exit 0 - ;; - -*) echo -e "$SGML_HELP_MESSAGE" >&2 - exit 1 - ;; - *) if [ -z "$SGML_FILE" ] - then - case "$1" in - /*) SGML_FILE="$1" ;; - *) SGML_FILE="$SGML_CURRENT_DIRECTORY/$1" ;; - esac - shift 1 - else - echo -e "$SGML_HELP_MESSAGE" >&2 - exit 1 - fi - ;; - esac -done - -# Check that we have a frontend -if [ -z "$SGML_FRONTEND" ] -then - echo -e $SGML_HELP_MESSAGE >&2 - exit 1 -fi -if [ ! -s "$SGML_FRONTEND" ] -then - echo "`basename $0`: There is no frontend called \"$SGML_FRONTEND\"." >&2 - exit 2 -fi - -# Check that we have a backend -if [ -z "$SGML_BACKEND" ] -then - echo -e $SGML_HELP_MESSAGE >&2 - exit 1 -fi -if [ ! -s $SGML_BACKEND ] -then - echo "`basename $0`: There is no backend called \"$SGML_BACKEND\"." >&2 - exit 2 -fi - -# Check that we have a file to process -if [ -z "$SGML_FILE" ] -then - echo -e $SGML_HELP_MESSAGE >&2 - exit 1 -fi -if [ ! -s "$SGML_FILE" ] -then - echo "`basename $0`: Cannot open \"$SGML_FILE\"." >&2 - exit 3 -fi - -# Separate the file name and the extension (if any) -SGML_FILE_NAME=`basename "$SGML_FILE"` -SGML_FILE_NAME=${SGML_FILE_NAME%.*} - -# Determine if we are in an XML file -SGML_XML=`head "$SGML_FILE" | grep "" | wc -l` -if [ $SGML_XML -eq 1 ]; then - SGML_XML="xml" -else - SGML_XML="sgml" -fi - -# Use SGML declaration for XML if needed -if [ "$SGML_DECL" = "" -a "$SGML_XML" = "xml" ] -then SGML_DECL=${SGML_BASE_DIR}/xml.dcl -fi - -# Try to find the SGML normalizer -if [ -z "$SGML_NORM" ] -then - SGML_NORM=`which sgmlnorm 2>/dev/null` - if [ -z "SGML_NORM" ] - then - SGML_NORM=`which osgmlnorm 2>/dev/null` - fi -fi - -# Set path to SGML catalogs (first try centralized catalog) -case $SGML_STANDARD_CATALOGS in - yes) export SGML_CATALOGS_DIR SGML_FILE SGML_XML SGML_NORM - SGML_CENTRALIZED_CATALOG=`sh $SGML_FRONTEND centralized-catalog` - if [ -s $SGML_CENTRALIZED_CATALOG ] - then - SGML_CATALOG_FILES=$SGML_CENTRALIZED_CATALOG - else - SGML_CATALOG_FILES=`find $SGML_BASE_DIR -name catalog` - SGML_CATALOG_FILES=`echo "$SGML_CATALOG_FILES" | tr [:space:] :` - fi - ;; - no) SGML_CATALOG_FILES="" - ;; -esac -SGML_CATALOG_FILES=${SGML_CATALOG_FILES}${SGML_EXTRA_CATALOGS} -SGML_CATALOG_FILES=`echo "$SGML_CATALOG_FILES" | sed 's/^://;s/:$//'` -if [ -z "$SGML_CATALOG_FILES" ] -then - echo "`basename $0`: Please specify at least one catalog" >&2 - exit 4 -fi - -# Determine the backend type -case $SGML_BACKEND in - *html|*txt) \ - SGML_TYPE=html - ;; - *) SGML_TYPE=print - ;; -esac - -# Determine which stylesheet to use -# (run the frontend to know it if the default stylesheet or no custom stylesheet is desired) -if [ "$SGML_STYLESHEET" = "default" -o "$SGML_STYLESHEET" = "none" ] -then - export SGML_BASE_DIR SGML_TYPE SGML_STYLESHEET - SGML_STYLESHEET=`sh $SGML_FRONTEND style-sheet` - SGML_RETURN=$? - if [ $SGML_RETURN -gt 0 ] - then exit `expr 7 + $SGML_RETURN` - fi -fi -if [ -z "$SGML_STYLESHEET" ] -then - echo "`basename $0`: Please specify at least one stylesheet" >&2 - exit 5 -fi - -case "$SGML_OPTIONS" in - *paper-type*) - ;; - *) - # Set the paper size to A4 if the locale suggests so - papersize= - if [ -x /usr/bin/locale ] - then - h=$(/usr/bin/locale LC_PAPER 2>/dev/null | head -n 1) - if [ "$h" = 297 ] - then - papersize=A4 - fi - fi - if [ -n "$papersize" ] - then - SGML_OPTIONS="-V paper-type=$papersize $SGML_OPTIONS" - fi - ;; -esac - -# Choose a parser -if [ -z "$SGML_JADE" ] -then - which jade >/dev/null 2>/dev/null - if [ $? -eq 0 ] - then - SGML_JADE="jade" - else - which openjade >/dev/null 2>/dev/null - if [ $? -eq 0 ] - then - SGML_JADE="openjade" - else - echo "`basename $0`: No parser available" >&2 - exit 6 - fi - fi -else - which $SGML_JADE >/dev/null 2>/dev/null - if [ $? -ne 0 ] - then - echo "`basename $0`: parser $SGML_JADE is not available" >&2 - exit 6 - fi -fi - -# Create output directory if not available -if [ -z "$SGML_OUTPUT_DIRECTORY" ] -then - echo -e $SGML_HELP_MESSAGE >&2 - exit 1 -fi -if [ ! -d "$SGML_OUTPUT_DIRECTORY" ] -then - mkdir "$SGML_OUTPUT_DIRECTORY" 2>/dev/null - if [ $? -ne 0 ] - then - echo "`basename $0`: Could not create \"$SGML_OUTPUT_DIRECTORY\" output directory" >&2 - exit 7 - fi -fi - -# Prepare the parser's arguments -SGML_ARGUMENTS="$SGML_INCLUDE -i $SGML_TYPE -d $SGML_STYLESHEET $SGML_OPTIONS $SGML_WARNINGS $SGML_DECL" - -# Call the backend -echo "Using catalogs: `echo $SGML_CATALOG_FILES | sed 's/:/, /g'`" -echo "Using stylesheet: $SGML_STYLESHEET" -echo "Working on: $SGML_FILE" -cd "$SGML_OUTPUT_DIRECTORY" -export SGML_JADE SGML_FILE_NAME SGML_ARGUMENTS -export SGML_CATALOG_FILES SGML_BASE_DIR SGML_FILE SGML_STYLESHEET -NOCHUNKS=`echo $SGML_OPTIONS | grep nochunks` -if [ -z "$NOCHUNKS" ] -then - sh $SGML_BACKEND -else - sh $SGML_BACKEND >"$SGML_FILE_NAME.html" -fi -SGML_RETURN=$? -cd "$SGML_CURRENT_DIRECTORY" - -if [ $SGML_RETURN -gt 0 ] -then exit `expr 7 + $SGML_RETURN` -fi -echo "Done." -exit 0 diff --git a/bin/jw.in.spaces b/bin/jw.in.spaces deleted file mode 100644 index 4bfb312..0000000 --- a/bin/jw.in.spaces +++ /dev/null @@ -1,442 +0,0 @@ -#! /bin/sh -# Jade Wrapper -# Script to convert a SGML file into some other format -# Send any comments to Eric Bischoff -# This program is under GPL license. See LICENSE file for details. - -# Set help message -SGML_HELP_MESSAGE="Usage: `basename $0` [] \n\ -where are:\n\ -\040 -f|--frontend : \t Specify the frontend (source format)\n\ -\040 \t\t\t\t (default is docbook)\n\ -\040 -b|--backend : \t Specify the backend (destination format)\n\ -\040 \t\t\t\t (default is html)\n\ -\040 -c|--cat : \t\t Specify an extra SGML open catalog\n\ -\040 -n|--nostd: \t\t\t Do not use the standard SGML open catalogs\n\ -\040 -d|--dsl |default|none:\t Specify an alternate style sheet\n\ -\040 \t\t\t\t (default is to use the default stylesheet)\n\ -\040 -l|--dcl : \t\t Specify an alternate SGML declaration\n\ -\040 \t\t\t\t (usual ones like xml.dcl get detected automatically)\n\ -\040 -s|--sgmlbase : \t Change base directory for SGML distribution\n\ -\040 \t\t\t\t (usually @prefix@/share/sgml)\n\ -\040 -p|--parser : \t Specify the parser if several are installed\n\ -\040 \t\t\t\t (jade or openjade)\n\ -\040 -o|--output : \t Set output directory\n\ -\040 -u|--nochunks: \t\t Output only one big file\n\ -\040 \t\t\t\t (overrides the stylesheet settings)\n\ -\040 -i|--include
: \t Specify a SGML marked section to include\n\ -\040 \t\t\t\t (should be marked as \"ignore\" in the SGML text)\n\ -\040 -w|--warning |list: Control warnings or display the allowed warning types\n\ -\040 -e|--errors |list: Control errors or display the allowed error types\n\ -\040 -h|--help: \t\t\t Print this help message and exit\n\ -\040 -V : \t Set a variable\n\ -\040 -v|--version: \t\t Print the version and exit" - -# Set list of warning types -SGML_WARNINGS_LIST="\n\ -\040 xml \t\t Warn about constructs that are not allowed by XML\n\ -\040 mixed \t Warn about mixed content models that do not allow #pcdata anywhere\n\ -\040 sgmldecl \t Warn about various dubious constructions in the SGML declaration\n\ -\040 should \t Warn about various recommendations made in ISO 8879 that the document does not comply with\n\ -\040 default \t Warn about defaulted references\n\ -\040 duplicate \t Warn about duplicate entity declarations\n\ -\040 undefined \t Warn about undefined elements: elements used in the DTD but not defined\n\ -\040 unclosed \t Warn about unclosed start and end-tags\n\ -\040 empty \t Warn about empty start and end-tags\n\ -\040 net \t\t Warn about net-enabling start-tags and null end-tags\n\ -\040 min-tag \t Warn about minimized start and end-tags. Equivalent to: unclosed, empty and net\n\ -\040 unused-map \t Warn about unused short reference maps\n\ -\040 unused-param \t Warn about parameter entities that are defined but not used in a DTD\n\ -\040 notation-sysid Warn about notations for which no system identifier could be generated\n\ -\040 all \t\t Equivalent to: mixed, should, default, undefined, sgmldecl, unused-map, unused-param, empty and unclosed\n\n\ -\040 A warning can be disabled by using its name prefixed with no-. Example: -w all -w no-duplicate" - -# Set list of error types -SGML_ERRORS_LIST="\n\ -\040 no-idref \t No error for an ID reference value which no element has as its ID\n\ -\040 no-significant No errors for characters not significant in the reference concrete syntax\n\ -\040 no-valid \t Do not require the document to be type-valid" - -# Get name of main SGML configuration file -which sgmlwhich >/dev/null 2>/dev/null -if [ $? -eq 0 ] -then - SGML_CONF=`sgmlwhich` -else - SGML_CONF="/etc/sgml/sgml.conf" -fi - -# Set version message -SGML_VERSION_MESSAGE="DocBook-utils version @VERSION@ (jw version 1.1)" - -# Set option: use standard catalogs -SGML_STANDARD_CATALOGS="yes" - -# Set path to user SGML catalogs -SGML_EXTRA_CATALOGS="" - -# Set SGML base directory and centralized catalogs directory -SGML_BASE_DIR="@prefix@/share/sgml" -SGML_CATALOGS_DIR="/etc/sgml" -if [ -f "$SGML_CONF" ] -then - RE='^[:space:]*SGML_BASE_DIR[:space:]*=[:space:]*' - SGML_BASE_DIR=`grep $RE $SGML_CONF | sed "s/$RE//"` - RE='^[:space:]*SGML_CATALOGS_DIR[:space:]*=[:space:]*' - SGML_CATALOGS_DIR=`grep $RE $SGML_CONF | sed "s/$RE//"` -fi - -# Set frontend to use -SGML_FRONTEND="$SGML_BASE_DIR/docbook/utils-@VERSION@/frontends/docbook" - -# Set backend to use -SGML_BACKEND="$SGML_BASE_DIR/docbook/utils-@VERSION@/backends/html" - -# Set main stylesheet -SGML_STYLESHEET="default" - -# Set flavour of jade parser to use -SGML_JADE="" - -# Set SGML declaration and file to process -SGML_DECL="" -SGML_FILE="" - -# Set output and current directories -SGML_OUTPUT_DIRECTORY="." -SGML_CURRENT_DIRECTORY=`pwd` - -# Set of options to set -SGML_OPTIONS="" - -# Set list of "include" marked sections -SGML_INCLUDE="" - -# Set list of warning types and errors types -SGML_WARNINGS="" - -# Process options -while [ $# -gt 0 ] -do case $1 in - -f|--frontend) case "$2" in - /*) SGML_FRONTEND="$2" ;; - *) d=$SGML_BASE_DIR/docbook/utils-@VERSION@/frontends - SGML_FRONTEND="$d/$2" ;; - esac - shift 2 - ;; - -b|--backend) case "$2" in - /*) SGML_BACKEND="$2" ;; - *) d=$SGML_BASE_DIR/docbook/utils-@VERSION@/backends - SGML_BACKEND="$d/$2" ;; - esac - shift 2 - ;; - -c|--cat) case "$2" in - /*) SGML_EXTRA_CATALOGS="$SGML_EXTRA_CATALOGS:$2" ;; - *) SGML_EXTRA_CATALOGS="$SGML_EXTRA_CATALOGS:$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -d|--dsl) case "$2" in - /*|none|default) SGML_STYLESHEET="$2" ;; - *) SGML_STYLESHEET="$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -l|--dcl) case "$2" in - /*) SGML_DECL="$2" ;; - *) SGML_DECL="$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -n|--nostd) SGML_STANDARD_CATALOGS="no" - shift 1 - ;; - -s|--sgmlbase) case "$2" in - /*) SGML_BASE_DIR="$2" ;; - *) SGML_BASE_DIR="$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -p|--parser) case "$2" in - /*) SGML_JADE="$2" ;; - *) SGML_JADE="$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -o|--output) case "$2" in - /*) SGML_OUTPUT_DIRECTORY="$2" ;; - *) SGML_OUTPUT_DIRECTORY="$SGML_CURRENT_DIRECTORY/$2" ;; - esac - shift 2 - ;; - -u|--nochunks) SGML_OPTIONS="$SGML_OPTIONS -V nochunks" - shift 1 - ;; - -V) SGML_OPTIONS="$SGML_OPTIONS -V $2" - shift 2 - ;; - -i|--include) case $2 in - print|html) echo "The marked section named \"$2\" is reserved for internal use by `basename $0`." >&2 - exit 1 - ;; - esac - SGML_INCLUDE="$SGML_INCLUDE -i $2" - shift 2 - ;; - -w|--warning) case $2 in - list) echo -e "List of allowed warning types (multiple -w options are allowed):\n" - echo -e $SGML_WARNINGS_LIST - exit 0 - ;; - xml|mixed|sgmldecl|should|default|duplicate|undefined|unclosed|empty|net|min-tag|unused-map|unused-param|notation-sysid|all|no-xml|no-mixed|no-sgmldecl|no-should|no-default|no-duplicate|no-undefined|no-unclosed|no-empty|no-net|no-min-tag|no-unused-map|no-unused-param|no-notation-sysid) \ - SGML_WARNINGS="$SGML_WARNINGS -w $2" - shift 2 - ;; - *) echo "Unknown warning type \"$2\". Allowed warning types are:" >&2 - echo -e $SGML_WARNINGS_LIST >&2 - exit 1 - ;; - esac - ;; - -e|--error) case $2 in - list) echo -e "List of allowed error types (multiple -e options are allowed):\n" - echo -e $SGML_ERRORS_LIST - exit 0 - ;; - no-idref|no-significant|no-valid) \ - SGML_WARNINGS="$SGML_WARNINGS -w $2" - shift 2 - ;; - *) echo "Unknown error type \"$2\". Allowed error types are:" >&2 - echo -e $SGML_ERRORS_LIST >&2 - exit 1 - ;; - esac - ;; - -h|--help) echo -e "`basename $0` - Jade Wrapper\n" - echo -e "$SGML_HELP_MESSAGE" - exit 0 - ;; - -v|--version) echo -e "$SGML_VERSION_MESSAGE" - exit 0 - ;; - -*) echo -e "$SGML_HELP_MESSAGE" >&2 - exit 1 - ;; - *) if [ -z "$SGML_FILE" ] - then - case "$1" in - /*) SGML_FILE="$1" ;; - *) SGML_FILE="$SGML_CURRENT_DIRECTORY/$1" ;; - esac - shift 1 - else - echo -e "$SGML_HELP_MESSAGE" >&2 - exit 1 - fi - ;; - esac -done - -# Check that we have a frontend -if [ -z "$SGML_FRONTEND" ] -then - echo -e $SGML_HELP_MESSAGE >&2 - exit 1 -fi -if [ ! -s $SGML_FRONTEND ] -then - echo "`basename $0`: There is no frontend called \"$SGML_FRONTEND\"." >&2 - exit 2 -fi - -# Check that we have a backend -if [ -z "$SGML_BACKEND" ] -then - echo -e $SGML_HELP_MESSAGE >&2 - exit 1 -fi -if [ ! -s $SGML_BACKEND ] -then - echo "`basename $0`: There is no backend called \"$SGML_BACKEND\"." >&2 - exit 2 -fi - -# Check that we have a file to process -if [ -z "$SGML_FILE" ] -then - echo -e $SGML_HELP_MESSAGE >&2 - exit 1 -fi -if [ ! -s $SGML_FILE ] -then - echo "`basename $0`: Cannot open \"$SGML_FILE\"." >&2 - exit 3 -fi - -# Separate the file name and the extension (if any) -SGML_FILE_NAME=`basename $SGML_FILE` -SGML_FILE_NAME=${SGML_FILE_NAME%.*} - -# Determine if we are in an XML file -SGML_XML=`head "$SGML_FILE" | grep "" | wc -l` -if [ $SGML_XML -eq 1 ]; then - SGML_XML="xml" -else - SGML_XML="sgml" -fi - -# Use SGML declaration for XML if needed -if [ "$SGML_DECL" = "" -a "$SGML_XML" = "xml" ] -then SGML_DECL=${SGML_BASE_DIR}/xml.dcl -fi - -# Try to find the SGML normalizer -if [ -z "$SGML_NORM" ] -then - SGML_NORM=`which sgmlnorm 2>/dev/null` - if [ -z "SGML_NORM" ] - then - SGML_NORM=`which osgmlnorm 2>/dev/null` - fi -fi - -# Set path to SGML catalogs (first try centralized catalog) -case $SGML_STANDARD_CATALOGS in - yes) export SGML_CATALOGS_DIR SGML_FILE SGML_XML SGML_NORM - SGML_CENTRALIZED_CATALOG=`sh $SGML_FRONTEND centralized-catalog` - if [ -s $SGML_CENTRALIZED_CATALOG ] - then - SGML_CATALOG_FILES=$SGML_CENTRALIZED_CATALOG - else - SGML_CATALOG_FILES=`find $SGML_BASE_DIR -name catalog` - SGML_CATALOG_FILES=`echo "$SGML_CATALOG_FILES" | tr [:space:] :` - fi - ;; - no) SGML_CATALOG_FILES="" - ;; -esac -SGML_CATALOG_FILES=${SGML_CATALOG_FILES}${SGML_EXTRA_CATALOGS} -SGML_CATALOG_FILES=`echo "$SGML_CATALOG_FILES" | sed 's/^://;s/:$//'` -if [ -z "$SGML_CATALOG_FILES" ] -then - echo "`basename $0`: Please specify at least one catalog" >&2 - exit 4 -fi - -# Determine the backend type -case $SGML_BACKEND in - *html|*txt) \ - SGML_TYPE=html - ;; - *) SGML_TYPE=print - ;; -esac - -# Determine which stylesheet to use -# (run the frontend to know it if the default stylesheet or no custom stylesheet is desired) -if [ "$SGML_STYLESHEET" = "default" -o "$SGML_STYLESHEET" = "none" ] -then - export SGML_BASE_DIR SGML_TYPE SGML_STYLESHEET - SGML_STYLESHEET=`sh $SGML_FRONTEND style-sheet` - SGML_RETURN=$? - if [ $SGML_RETURN -gt 0 ] - then exit `expr 7 + $SGML_RETURN` - fi -fi -if [ -z "$SGML_STYLESHEET" ] -then - echo "`basename $0`: Please specify at least one stylesheet" >&2 - exit 5 -fi - -case "$SGML_OPTIONS" in - *paper-type*) - ;; - *) - # Set the paper size to A4 if the locale suggests so - papersize= - if [ -x /usr/bin/locale ] - then - h=$(/usr/bin/locale LC_PAPER 2>/dev/null | head -n 1) - if [ "$h" = 297 ] - then - papersize=A4 - fi - fi - if [ -n "$papersize" ] - then - SGML_OPTIONS="-V paper-type=$papersize $SGML_OPTIONS" - fi - ;; -esac - -# Choose a parser -if [ -z "$SGML_JADE" ] -then - which jade >/dev/null 2>/dev/null - if [ $? -eq 0 ] - then - SGML_JADE="jade" - else - which openjade >/dev/null 2>/dev/null - if [ $? -eq 0 ] - then - SGML_JADE="openjade" - else - echo "`basename $0`: No parser available" >&2 - exit 6 - fi - fi -else - which $SGML_JADE >/dev/null 2>/dev/null - if [ $? -ne 0 ] - then - echo "`basename $0`: parser $SGML_JADE is not available" >&2 - exit 6 - fi -fi - -# Create output directory if not available -if [ -z "$SGML_OUTPUT_DIRECTORY" ] -then - echo -e $SGML_HELP_MESSAGE >&2 - exit 1 -fi -if [ ! -d $SGML_OUTPUT_DIRECTORY ] -then - mkdir $SGML_OUTPUT_DIRECTORY 2>/dev/null - if [ $? -ne 0 ] - then - echo "`basename $0`: Could not create \"$SGML_OUTPUT_DIRECTORY\" output directory" >&2 - exit 7 - fi -fi - -# Prepare the parser's arguments -SGML_ARGUMENTS="$SGML_INCLUDE -i $SGML_TYPE -d $SGML_STYLESHEET $SGML_OPTIONS $SGML_WARNINGS $SGML_DECL $SGML_FILE" - -# Call the backend -echo "Using catalogs: `echo $SGML_CATALOG_FILES | sed 's/:/, /g'`" -echo "Using stylesheet: $SGML_STYLESHEET" -echo "Working on: $SGML_FILE" -cd $SGML_OUTPUT_DIRECTORY -export SGML_JADE SGML_FILE_NAME SGML_ARGUMENTS -export SGML_CATALOG_FILES SGML_BASE_DIR SGML_FILE SGML_STYLESHEET -NOCHUNKS=`echo $SGML_OPTIONS | grep nochunks` -if [ -z "$NOCHUNKS" ] -then - sh $SGML_BACKEND -else - sh $SGML_BACKEND >$SGML_FILE_NAME.html -fi -SGML_RETURN=$? -cd $SGML_CURRENT_DIRECTORY - -if [ $SGML_RETURN -gt 0 ] -then exit `expr 7 + $SGML_RETURN` -fi -echo "Done." -exit 0 diff --git a/doc/man/jw.1 b/doc/man/jw.1 index f3314b7..415fa5d 100644 --- a/doc/man/jw.1 +++ b/doc/man/jw.1 @@ -192,11 +192,6 @@ by calling \fBJade\fR or \fBOpenJade\fR\&. The resulting file can then be inported into \fBMS Word\fR or one of its Linux replacement programs. - -\fBNote\fR - The original picture must be -present when RTF document is viewed, because -the RTF documents created by \fBOpenJade\fR -includes pictures by reference. .TP \fB\fItex\fB\fR Converts to TeX by calling \fBJade\fR or diff --git a/doc/man/jw.1.rtfman b/doc/man/jw.1.rtfman deleted file mode 100644 index 415fa5d..0000000 --- a/doc/man/jw.1.rtfman +++ /dev/null @@ -1,377 +0,0 @@ -.\" This manpage has been automatically generated by docbook2man -.\" from a DocBook document. This tool can be found at: -.\" -.\" Please send any bug reports, improvements, comments, patches, -.\" etc. to Steve Cheng . -.TH "JW" "1" "11 February 2004" "" "" - -.SH NAME -jw, docbook2dvi, docbook2html, docbook2man, docbook2pdf, docbook2ps, docbook2rtf, docbook2tex, docbook2texi, docbook2txt \- (Jade Wrapper) converts SGML files to other formats -.SH SYNOPSIS - -\fBjw\fR [ \fB-f -\fIfrontend\fB\fR | \fB--frontend -\fIfrontend\fB\fR ] - [ \fB-b -\fIbackend\fB\fR | \fB--backend \fIbackend\fB\fR ] - [ \fB-c \fIfile\fB\fR | \fB--cat \fIfile\fB\fR ] - [ \fB-n\fR | \fB--nostd\fR ] - [ \fB-d -\fIfile\fB|default|none\fR | \fB--dsl -\fIfile\fB|default|none\fR ] - [ \fB-l \fIfile\fB\fR | \fB--dcl \fIfile\fB\fR ] - [ \fB-s \fIpath\fB\fR | \fB--sgmlbase \fIpath\fB\fR ] - [ \fB-p \fIprogram\fB\fR | \fB--parser \fIprogram\fB\fR ] - [ \fB-o \fIdirectory\fB\fR | \fB--output \fIdirectory\fB\fR ] - [ \fB-V -\fIvariable\fB[=\fIvalue\fB]\fR ] - [ \fB-u\fR | \fB--nochunks\fR ] [ \fB-i \fIsection\fB\fR | \fB--include \fIsection\fB\fR ] - [ \fB-w \fItype\fB|list\fR | \fB--warning \fItype\fB|list\fR ] - [ \fB-e \fItype\fB|list\fR | \fB--error \fItype\fB|list\fR ] - [ \fB-h\fR | \fB--help\fR ] [ \fB-v\fR | \fB--version\fR ] - \fB\fISGML-file\fB\fR - - -\fBdocbook2dvi\fR \fB\fISGML-file\fB\fR - - -\fBdocbook2html\fR \fB\fISGML-file\fB\fR - - -\fBdocbook2man\fR \fB\fISGML-file\fB\fR - - -\fBdocbook2pdf\fR \fB\fISGML-file\fB\fR - - -\fBdocbook2ps\fR \fB\fISGML-file\fB\fR - - -\fBdocbook2rtf\fR \fB\fISGML-file\fB\fR - - -\fBdocbook2tex\fR \fB\fISGML-file\fB\fR - - -\fBdocbook2texi\fR \fB\fISGML-file\fB\fR - - -\fBdocbook2txt\fR \fB\fISGML-file\fB\fR - -.SH "DESCRIPTION" -.PP -The \fBjw\fR shell script allows to -convert a DocBook file (or some other SGML-based format) to -other formats (including HTML, RTF, PS and PDF) with -an easy-to-understand syntax. It hides most of Jade's -or OpenJade complexity and adds comfortable features. -.PP -Other scripts like \fBdocbook2html\fR, -\fBdocbook2rtf\fR or -\fBdocbook2ps\fR provide different ways of -calling \fBjw\fR that might be easier to -remember. -.PP -For the moment, jw does not handle XML, but only SGML. -.PP -This utility assumes that several other components are -installed. The list includes: -.TP 0.2i -\(bu -the ISO character entities for SGML -.TP 0.2i -\(bu -James Clark's DSSSL engine, jade, or an equivalent parser -like OpenJade -.TP 0.2i -\(bu -the DocBook DTD from the OASIS consortium -.TP 0.2i -\(bu -Norman Walsh's DocBook modular style sheets (or some other -set of DSSSL style sheets) -.TP 0.2i -\(bu -Sebastian Rahtz's jadetex set of TeX macros for jade -(for backends intended to "printing" formats like PDF, RTF or -PostScript) -.TP 0.2i -\(bu -A perl interpreter (for backends that use perl) -.TP 0.2i -\(bu -SGMLSpm from CPAN (for backends that use sgmls) -.TP 0.2i -\(bu -Lynx HTML browser (for the \fItxt\fR -backend) -.PP -The jw script is basically called like this: - -.nf -jw mydoc.sgml -.fi -.PP -where \fImydoc.sgml\fR is a SGML file. -.PP -The command line above uses default options: it converts -from DocBook (the default frontend) to HTML (the default backend), -does not put the result in a subdirectory (unless specified -otherwise in the style sheets), etc. -.PP -In this example, the "mydoc" file name as well as the ".sgml" -extension can be replaced by anything else. Current extensions -for SGML DocBook files include ".sgml", ".sgm", ".docbook", and -".db". The processed file \fImydoc.sgml\fR can -be in any other directory than the current one. -.PP -Here we have chosen to generate HTML output. In fact we can -use any of the backends stored in the \fIbackends/\fR -subdirectory of the DocBook-utils distribution directory (usually -\fI/usr/share/sgml/docbook/utils-0.6.14\fR). -Similarly, you can use any frontend defined in the -\fIfrontends/\fR subdirectory to convert from another -input format. -.PP -This sample command creates one or many HTML files with -arbitrary file names in the current directory. This default behavior -can be changed through command line options and/or customization -style sheets. -.SH "OPTIONS" -.PP -The following options apply to the conversion script: -.TP -\fB -f \fIfrontend\fB | --frontend \fIfrontend\fB \fR -Allows to specify another frontend than default \fIdocbook\fR\&. -The list of currently available frontends is: -.RS -.TP -\fB\fIdocbook\fB\fR -Converts docbook with Norman Walsh's -style sheets. This frontend searches in the -subdirectories of the base SGML directory for a -file named \fIhtml/docbook.dsl\fR or -\fIprint/docbook.dsl\fR (depending on the -backend's type: html or print). -.RE -.TP -\fB -b \fIbackend\fB | --backend \fIbackend\fB \fR -Allows to specify another backend than default -\fIHTML\fR\&. The list of currently available -backends is: -.RS -.TP -\fB\fIdvi\fB\fR -Converts to DVI (DeVice Independant -files) by calling \fBJade\fR or -\fBOpenJade\fR\&. -.TP -\fB\fIhtml\fB\fR -Converts to HTML (HyperText Markup -Language) by calling \fBJade\fR -or \fBOpenJade\fR\&. -.TP -\fB\fIman\fB\fR -Converts a refentry to a Unix manual page -by calling docbook2man. Does not work with other SGML -document types than DocBook. -.TP -\fB\fIpdf\fB\fR -Converts to PDF (Portable Document -Format) by calling \fBJade\fR or -\fBOpenJade\fR\&. -.TP -\fB\fIps\fB\fR -Converts to PostScript by -calling \fBJade\fR or -\fBOpenJade\fR\&. -.TP -\fB\fIrtf\fB\fR -Converts to RTF (Rich Text Format) -by calling \fBJade\fR or -\fBOpenJade\fR\&. The resulting file can -then be inported into \fBMS Word\fR -or one of its Linux replacement programs. -.TP -\fB\fItex\fB\fR -Converts to TeX by calling \fBJade\fR or -\fBOpenJade\fR\&. -.TP -\fB\fItexi\fB\fR -Converts to GNU TeXinfo pages by calling -docbook2texi. Does not work with other SGML document types -than DocBook. -.TP -\fB\fItxt\fB\fR -Converts to a bare text file -by calling \fBJade\fR -or \fBOpenJade\fR, then -\fBLynx\fR\&. -.RE -.TP -\fB -c \fIfile\fB | --cat \fIfile\fB \fR -Allows to use an extra SGML Open Catalog that will list -other files like customization style sheets, adaptations to the -DocBook Document Type Definition, special character entities, -etc. This catalog is added to the list of catalogs determined -by the script (see option \fB--nostd\fR below) -.TP -\fB -n | --nostd \fR -Do not use the standard SGML Open Catalogs. Normally, -the standard catalogs list is determined like this: -.RS -.TP 0.2i -\(bu -if the centralized catalog exists, then -use it. The centralized catalog is a list of all -catalogs that might be necessary that usually -resides in \fI/etc/sgml\fR\&. Its -name is provided by the frontend, for example -the \fIdocbook\fR frontend returns -\fI/etc/sgml/sgml-docbook.cat\fR\&. -.TP 0.2i -\(bu -Otherwise, take all the files -named \fIcatalog\fR from the -subdirectories of the SGML base directory (usually -\fI/usr/share/sgml\fR). -.RE -This option is useful in conjunction with the -\fB--cat\fR option to use only the catalogs that -are specified on the command line. -.TP -\fB -d \fIfile\fB|default|none | --dsl \fIfile\fB|default|none \fR -Allows to use a customized style sheet instead -of the default one. - -A "target" starting with a hash mark "#" can be appended -to the file name. As a result, only the corresponding part -of the style sheet is executed (the "style specification" whose -"identificator" is equal to the target's name). A common use of this -mechanism is to define "#html" and "#print" targets to trigger -the corresponding part of a replacement style sheet which is -common for both HTML and printout conversion. - -By replacing the file name with "default", the default -style sheet provided with the frontend is used. For example, the -\fIdocbook\fR frontend returns -\fI\&./docbook.dsl#html\fR (or -\fI\&./docbook.dsl#print\fR) in the SGML base -directory. - -By replacing the file name with "none", no replacement -style sheet is used, not even the default style sheet. The style -sheet which is used is also determined by the frontend. For -example, the \fIdocbook\fR frontend returns -Norman Walsh's \fIhtml/docbook.dsl\fR (or -\fIprint/docbook.dsl\fR) found somewhere below -the SGML base directory. - -If no --dsl option is specified, then "--dsl default" is -used. -.TP -\fB -l \fIfile\fB | --dcl \fIfile\fB \fR -Allows to use a customized SGML declaration instead -of the default one. The file name of the default SGML -declaration is not set for SGML files, and is set to -\fIxml.dcl\fR in the SGML base directory -for XML files. -.TP -\fB -s \fIpath\fB | --sgmlbase \fIpath\fB \fR -Allows to use another location for the SGML base -directory. This is the directory below which all SGML DTDs, -style sheets, entities, etc are installed. The default value -is \fI/usr/share/sgml\fR\&. -.TP -\fB -p \fIprogram\fB | --parser \fIprogram\fB \fR -Specify the parser to use (\fBJade\fR -or \fBOpenJade\fR) if several -are installed. If this option is not specified, -the script first tries to use Jade, then it tries -\fBOpenJade\fR\&. -.TP -\fB -o \fIdirectory\fB | --output \fIdirectory\fB \fR -Set output directory where all the resulting files will -be stored. If the style sheets define a subdirectory where to -store the resulting files too, the subdirectory defined by the -style sheets will be placed below the subdirectory defined by -this option. -.TP -\fB -V \fIvariable\fB=[\fIvalue\fB] \fR -Set a variable (to a value, if one is specified). -.TP -\fB -u | --nochunks \fR -Output only one big file. This option is useful only -when generating HTML, because the output can be split into -several files. This option overrides the setting that may be -done in the style sheets. -.TP -\fB -i \fIsection\fB | --include \fIsection\fB \fR -Declare a SGML marked section as "include". A SGML marked -section is a kind of conditional part of a document. If it is -declared "ignore", it will be left ignored, otherwise it will -be processed. An example of such a marked section would be: -.PP -.PP - -.nf - - ]> - - ... - - ... - - -.fi -.TP -\fB -w \fItype\fB|list | --warning \fItype\fB|list \fR -Enables or disables the display of given types of warnings. -Several -w options might be entered on the command line. -Warning types that start with "no-" disable the corresponding -warnings, the other types enable them. - -If the warning type is replaced with "list", then -a list of allowed warning types is displayed. -.TP -\fB -e \fItype\fB|list | --error \fItype\fB|list \fR -Disables given types of errors. -Several -e options might be entered on the command line. -All error types start with "no-". - -If the error type is replaced with "list", then -a list of allowed error types is displayed. -.TP -\fB -h | --help \fR -Print a short help message and exit -.TP -\fB -v | --version \fR -Print the version identifier and exit -.SH "FILES" -.TP -\fB\fI/etc/sgml/sgml-docbook.cat\fB\fR -Centralized SGML open catalog. This file name might -vary if another frontend than \fIdocbook\fR -is used. -.TP -\fB\fI/usr/share/sgml/docbook/utils-0.6.14/backends\fB\fR -The various backends -.TP -\fB\fI/usr/share/sgml/docbook/utils-0.6.14/frontends\fB\fR -The various frontends -.TP -\fB\fI/usr/share/sgml/docbook/utils-0.6.14/helpers\fB\fR -The various helper scripts like docbook2man or docbook2texi -.SH "AUTHORS" -.PP -Eric Bischoff (jw shell script and a few backends), -Jochem Huhmann (the \fIman\fR and -\fItexi\fR backends) -.SH "SEE ALSO" -.PP -\fBdocbook2man-spec.pl\fR(1), -\fBdocbook2texi-spec.pl\fR(1), -\fBinstall-catalog\fR(8), -\fBnsgmls\fR(1), docbook-utils -homepage \&.