diff options
author | CoprDistGit <infra@openeuler.org> | 2024-08-05 01:49:41 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2024-08-05 01:49:41 +0000 |
commit | 89b0c8aa91110625d4527760aea6625ab6b07c78 (patch) | |
tree | 9b8f17c4f7799054a82112fe3c88aba13649c438 | |
parent | 40968e5e162216782a1a0585c51d5b2c19937cc2 (diff) |
automatic import of docbook-utilsopeneuler24.03_LTS
-rw-r--r-- | .gitignore | 1 | ||||
-rwxr-xr-x | db2html | 59 | ||||
-rw-r--r-- | docbook-utils-2ndspaces.patch | 260 | ||||
-rw-r--r-- | docbook-utils-grepnocolors.patch | 15 | ||||
-rw-r--r-- | docbook-utils-newgrep.patch | 24 | ||||
-rw-r--r-- | docbook-utils-nofinalecho.patch | 12 | ||||
-rw-r--r-- | docbook-utils-papersize.patch | 12 | ||||
-rw-r--r-- | docbook-utils-rtfmanpage.patch | 15 | ||||
-rw-r--r-- | docbook-utils-sgmlinclude.patch | 24 | ||||
-rw-r--r-- | docbook-utils-spaces.patch | 32 | ||||
-rw-r--r-- | docbook-utils-w3mtxtconvert.patch | 12 | ||||
-rw-r--r-- | docbook-utils.spec | 547 | ||||
-rwxr-xr-x | docbook2man-spec.pl | 1564 | ||||
-rw-r--r-- | gdp-both.dsl | 1061 | ||||
-rw-r--r-- | sources | 1 |
15 files changed, 3639 insertions, 0 deletions
@@ -0,0 +1 @@ +/docbook-utils-0.6.14.tar.gz @@ -0,0 +1,59 @@ +#! /bin/sh + +ADMON_GRAPHICS=/usr/share/sgml/docbook/dsssl-stylesheets/images/*.gif + +output=docbook2html-dir +skip=0 +dbdircleanup=1 +outputdone=0 +for arg in "$@" +do + if [ $skip -gt 0 ] + then + skip=$(($skip - 1)) + continue + fi + case $arg in + -h|--help|-v|--version) break + ;; + -n|--nostd|-u|--nochunks) ;; + -o|--output) outputdone=1 + ;; + + -*) skip=1 + ;; + *) dbdircleanup=0 + if [ ${outputdone} -eq 1 ]; + then + output="$(echo $arg | sed 's,\.sgml$,,;s,\.sgm$,,;s,\.xml,,')" + outputfile="$basename "$output"" + outputdone=2 + elif [ ${outputdone} -eq 2 ]; + then + outputfile="$(echo $arg | sed 's,\.sgml$,,;s,\.sgm$,,;s,\.xml,,' | \ + rev | cut -d'/' -f1 | rev)" + else + output="$(echo $arg | sed 's,\.sgml$,,;s,\.sgm$,,;s,\.xml,,')" + outputfile=$(basename "$output") + fi + ;; + esac +done + +if [ ${dbdircleanup} -eq 0 ]; +then + echo "Output is $output/$outputfile.html" +fi +if [ -d ${output} ] +then + rm -rf ${output}.junk + mv ${output} ${output}.junk +fi +mkdir ${output} +mkdir ${output}/stylesheet-images +cp ${ADMON_GRAPHICS} ${output}/stylesheet-images +jw -f docbook -b html -o ${output} "$@" +if [ ${dbdircleanup} -eq 1 ]; +then + rm -rf ${output} +fi diff --git a/docbook-utils-2ndspaces.patch b/docbook-utils-2ndspaces.patch new file mode 100644 index 0000000..eb4d6c6 --- /dev/null +++ b/docbook-utils-2ndspaces.patch @@ -0,0 +1,260 @@ +--- Original/backends/dvi 2003-01-13 18:14:10.000000000 +0100 ++++ Changes/backends/dvi 2007-05-21 14:10:42.000000000 +0200 +@@ -6,31 +6,31 @@ + export TEXINPUTS + + # Convert to TeX +-$SGML_JADE -t tex -o ${SGML_FILE_NAME}.tex $SGML_ARGUMENTS ++$SGML_JADE -t tex -o "${SGML_FILE_NAME}.tex" $SGML_ARGUMENTS "$SGML_FILE" + 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 +--- Original/backends/html 2000-07-21 20:15:22.000000000 +0200 ++++ Changes/backends/html 2007-05-21 14:11:32.000000000 +0200 +@@ -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_JADE -t sgml $SGML_ARGUMENTS "$SGML_FILE" + if [ $? -ne 0 ] + then exit 1 + fi +--- Original/backends/pdf 2003-03-17 18:47:11.000000000 +0100 ++++ Changes/backends/pdf 2007-05-21 14:13:58.000000000 +0200 +@@ -6,26 +6,26 @@ + export TEXINPUTS + + # Convert to TeX +-$SGML_JADE -t tex -o ${SGML_FILE_NAME}.tex $SGML_ARGUMENTS ++$SGML_JADE -t tex -o "${SGML_FILE_NAME}.tex" $SGML_ARGUMENTS "$SGML_FILE" + 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 +--- Original/backends/ps 2003-03-17 18:51:48.000000000 +0100 ++++ Changes/backends/ps 2007-05-21 14:16:51.000000000 +0200 +@@ -6,30 +6,30 @@ + export TEXINPUTS + + # Convert to TeX +-$SGML_JADE -t tex -o ${SGML_FILE_NAME}.tex $SGML_ARGUMENTS ++$SGML_JADE -t tex -o "${SGML_FILE_NAME}.tex" $SGML_ARGUMENTS "$SGML_FILE" + 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 @@ + 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 +--- Original/backends/rtf 2000-07-21 20:15:22.000000000 +0200 ++++ Changes/backends/rtf 2007-05-21 14:18:37.000000000 +0200 +@@ -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_JADE -t rtf -o "${SGML_FILE_NAME}.rtf" $SGML_ARGUMENTS "$SGML_FILE" + if [ $? -ne 0 ] + then exit 1 + fi +--- Original/backends/tex 2000-07-21 20:15:22.000000000 +0200 ++++ Changes/backends/tex 2007-05-21 14:21:12.000000000 +0200 +@@ -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_JADE -t tex -o "${SGML_FILE_NAME}.tex" $SGML_ARGUMENTS "$SGML_FILE" + if [ $? -ne 0 ] + then exit 1 + fi +--- Original/backends/txt 2004-02-11 14:58:03.000000000 +0100 ++++ Changes/backends/txt 2007-05-21 14:22:33.000000000 +0200 +@@ -23,7 +23,7 @@ + trap 'rm -f "$HTML"; exit' 0 1 2 3 7 13 15 + + # Convert to HTML +-$SGML_JADE -V nochunks -t sgml ${SGML_ARGUMENTS} >${HTML} ++$SGML_JADE -V nochunks -t sgml ${SGML_ARGUMENTS} "$SGML_FILE" >${HTML} + if [ $? -ne 0 ] + then exit 1 + fi +--- Original/bin/jw.in 2003-04-30 18:21:49.000000000 +0200 ++++ Changes/bin/jw.in 2007-05-21 14:28:58.000000000 +0200 +@@ -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 @@ + 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 +@@ -416,7 +416,7 @@ + fi + + # Prepare the parser's arguments +-SGML_ARGUMENTS="$SGML_INCLUDE -i $SGML_TYPE -d $SGML_STYLESHEET $SGML_OPTIONS $SGML_WARNINGS $SGML_DECL $SGML_FILE" ++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'`" +@@ -430,7 +430,7 @@ + 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" +diff -urNp docbook-utils-0.6.14-orig/backends/man.in docbook-utils-0.6.14/backends/man.in +--- docbook-utils-0.6.14-orig/backends/man.in 2003-02-11 13:56:23.000000000 +0100 ++++ docbook-utils-0.6.14/backends/man.in 2009-07-24 15:07:04.000000000 +0200 +@@ -7,7 +7,7 @@ HELPER=$SGML_BASE_DIR/docbook/utils-@VER + 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" ++nsgmls "$SGML_FILE" > "${TMPDIR}/nsgmls.tmp" + sgmlspl $HELPER <"${TMPDIR}/nsgmls.tmp" 2>"${TMPDIR}/errs" + if [ $? -ne 0 ] + then +diff -urNp docbook-utils-0.6.14-orig/backends/texi.in docbook-utils-0.6.14/backends/texi.in +--- docbook-utils-0.6.14-orig/backends/texi.in 2002-08-05 23:20:56.000000000 +0200 ++++ docbook-utils-0.6.14/backends/texi.in 2009-07-24 15:08:02.000000000 +0200 +@@ -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/docbook-utils-grepnocolors.patch b/docbook-utils-grepnocolors.patch new file mode 100644 index 0000000..3cce39e --- /dev/null +++ b/docbook-utils-grepnocolors.patch @@ -0,0 +1,15 @@ +diff -urNp docbook-utils-0.6.14-orig/bin/jw.in docbook-utils-0.6.14/bin/jw.in +--- docbook-utils-0.6.14-orig/bin/jw.in 2008-11-28 10:53:09.000000000 +0100 ++++ docbook-utils-0.6.14/bin/jw.in 2008-11-28 11:22:28.000000000 +0100 +@@ -81,9 +81,9 @@ 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//"` ++ SGML_BASE_DIR=`grep --color=never $RE $SGML_CONF | sed "s/$RE//"` + RE='^[:space:]*SGML_CATALOGS_DIR[:space:]*=[:space:]*' +- SGML_CATALOGS_DIR=`grep $RE $SGML_CONF | sed "s/$RE//"` ++ SGML_CATALOGS_DIR=`grep --color=never $RE $SGML_CONF | sed "s/$RE//"` + fi + + # Set frontend to use diff --git a/docbook-utils-newgrep.patch b/docbook-utils-newgrep.patch new file mode 100644 index 0000000..a2c3591 --- /dev/null +++ b/docbook-utils-newgrep.patch @@ -0,0 +1,24 @@ +diff -urNp docbook-utils-0.6.14-orig/bin/jw.in docbook-utils-0.6.14/bin/jw.in +--- docbook-utils-0.6.14-orig/bin/jw.in 2010-09-28 18:18:39.567895321 +0200 ++++ docbook-utils-0.6.14/bin/jw.in 2010-09-28 18:23:25.849756994 +0200 +@@ -80,9 +80,9 @@ SGML_BASE_DIR="@prefix@/share/sgml" + SGML_CATALOGS_DIR="/etc/sgml" + if [ -f "$SGML_CONF" ] + then +- RE='^[:space:]*SGML_BASE_DIR[:space:]*=[:space:]*' ++ 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:]*' ++ RE='^[[:space:]]*SGML_CATALOGS_DIR[[:space:]]*=[[:space:]]*' + SGML_CATALOGS_DIR=`grep --color=never $RE $SGML_CONF | sed "s/$RE//"` + fi + +@@ -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="" diff --git a/docbook-utils-nofinalecho.patch b/docbook-utils-nofinalecho.patch new file mode 100644 index 0000000..5787b97 --- /dev/null +++ b/docbook-utils-nofinalecho.patch @@ -0,0 +1,12 @@ +diff -urNp docbook-utils-0.6.14-orig/bin/jw.in docbook-utils-0.6.14/bin/jw.in +--- docbook-utils-0.6.14-orig/bin/jw.in 2010-05-31 16:21:46.379401250 +0200 ++++ docbook-utils-0.6.14/bin/jw.in 2010-05-31 16:23:55.348413466 +0200 +@@ -438,5 +438,7 @@ cd "$SGML_CURRENT_DIRECTORY" + if [ $SGML_RETURN -gt 0 ] + then exit `expr 7 + $SGML_RETURN` + fi +-echo "Done." ++#Final echo commented out, it causes manpage noise when generating some ++#manpages with new perl(#513271, #587012) ++#echo "Done." + exit 0 diff --git a/docbook-utils-papersize.patch b/docbook-utils-papersize.patch new file mode 100644 index 0000000..74e5007 --- /dev/null +++ b/docbook-utils-papersize.patch @@ -0,0 +1,12 @@ +diff -urNp docbook-utils-0.6.14-orig/bin/jw.in docbook-utils-0.6.14/bin/jw.in +--- docbook-utils-0.6.14-orig/bin/jw.in 2009-10-07 14:41:19.000000000 +0200 ++++ docbook-utils-0.6.14/bin/jw.in 2009-10-07 14:45:22.000000000 +0200 +@@ -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 diff --git a/docbook-utils-rtfmanpage.patch b/docbook-utils-rtfmanpage.patch new file mode 100644 index 0000000..f37873b --- /dev/null +++ b/docbook-utils-rtfmanpage.patch @@ -0,0 +1,15 @@ +diff -urNp docbook-utils-0.6.14-orig/doc/man/jw.1 docbook-utils-0.6.14/doc/man/jw.1 +--- docbook-utils-0.6.14-orig/doc/man/jw.1 2004-02-11 15:16:21.000000000 +0100 ++++ docbook-utils-0.6.14/doc/man/jw.1 2009-08-13 10:44:03.000000000 +0200 +@@ -192,6 +192,11 @@ 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/docbook-utils-sgmlinclude.patch b/docbook-utils-sgmlinclude.patch new file mode 100644 index 0000000..4275b6b --- /dev/null +++ b/docbook-utils-sgmlinclude.patch @@ -0,0 +1,24 @@ +diff -urNp docbook-utils-0.6.14-orig/backends/man.in docbook-utils-0.6.14/backends/man.in +--- docbook-utils-0.6.14-orig/backends/man.in 2009-07-24 15:17:42.000000000 +0200 ++++ docbook-utils-0.6.14/backends/man.in 2009-07-24 15:20:57.000000000 +0200 +@@ -7,7 +7,7 @@ HELPER=$SGML_BASE_DIR/docbook/utils-@VER + 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" ++nsgmls ${SGML_INCLUDE} "$SGML_FILE" > "${TMPDIR}/nsgmls.tmp" + sgmlspl $HELPER <"${TMPDIR}/nsgmls.tmp" 2>"${TMPDIR}/errs" + if [ $? -ne 0 ] + then +diff -urNp docbook-utils-0.6.14-orig/bin/jw.in docbook-utils-0.6.14/bin/jw.in +--- docbook-utils-0.6.14-orig/bin/jw.in 2009-07-24 15:17:42.000000000 +0200 ++++ docbook-utils-0.6.14/bin/jw.in 2009-07-24 15:18:51.000000000 +0200 +@@ -423,7 +423,7 @@ echo "Using catalogs: `echo $SGML_CATALO + echo "Using stylesheet: $SGML_STYLESHEET" + echo "Working on: $SGML_FILE" + cd "$SGML_OUTPUT_DIRECTORY" +-export SGML_JADE SGML_FILE_NAME SGML_ARGUMENTS ++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" ] diff --git a/docbook-utils-spaces.patch b/docbook-utils-spaces.patch new file mode 100644 index 0000000..4c18b1d --- /dev/null +++ b/docbook-utils-spaces.patch @@ -0,0 +1,32 @@ +--- docbook-utils-0.6.14/bin/jw.in.spaces 2003-04-30 17:21:49.000000000 +0100 ++++ docbook-utils-0.6.14/bin/jw.in 2004-08-19 09:33:34.989426640 +0100 +@@ -405,9 +405,9 @@ + 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 +@@ -422,7 +422,7 @@ + echo "Using catalogs: `echo $SGML_CATALOG_FILES | sed 's/:/, /g'`" + echo "Using stylesheet: $SGML_STYLESHEET" + echo "Working on: $SGML_FILE" +-cd $SGML_OUTPUT_DIRECTORY ++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` +@@ -433,7 +433,7 @@ + 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` diff --git a/docbook-utils-w3mtxtconvert.patch b/docbook-utils-w3mtxtconvert.patch new file mode 100644 index 0000000..249af8e --- /dev/null +++ b/docbook-utils-w3mtxtconvert.patch @@ -0,0 +1,12 @@ +diff -urNp original/txt new/txt +--- original/backends/txt 2007-11-05 18:44:52.000000000 +0100 ++++ new/backends/txt 2007-11-22 15:21:36.000000000 +0100 +@@ -13,7 +13,7 @@ then + elif [ -x /usr/bin/w3m ] + then + CONVERT=/usr/bin/w3m +- ARGS="-dump" ++ ARGS="-T text/html -dump" + else + echo >&2 "No way to convert HTML to text found." + exit 1 diff --git a/docbook-utils.spec b/docbook-utils.spec new file mode 100644 index 0000000..72e489d --- /dev/null +++ b/docbook-utils.spec @@ -0,0 +1,547 @@ +Name: docbook-utils +Version: 0.6.14 +Release: 54%{?dist} + +Summary: Shell scripts for managing DocBook documents +URL: http://sources.redhat.com/docbook-tools/ + +License: GPLv2+ + +Requires: docbook-style-dsssl >= 1.72 +Requires: docbook-dtds +Requires: perl-SGMLSpm >= 1.03ii +Requires: which grep gawk +Requires: text-www-browser + +# In the absence of an already-installed text-www-browser, prefer lynx +Suggests: lynx + +BuildRequires: perl-generators +BuildRequires: perl-SGMLSpm, openjade, docbook-style-dsssl +BuildRequires: make + +BuildArch: noarch +Source0: ftp://sources.redhat.com/pub/docbook-tools/new-trials/SOURCES/%{name}-%{version}.tar.gz +Source1: db2html +Source2: gdp-both.dsl +#We will ship newer version of docbook2man-spec.pl for better handling of docbook2man conversion +#You could check it at http://sourceforge.net/projects/docbook2x/ +Source3: docbook2man-spec.pl + +Obsoletes: stylesheets < %{version}-%{release} +Provides: stylesheets = %{version}-%{release} + +Patch0: docbook-utils-spaces.patch +Patch1: docbook-utils-2ndspaces.patch +Patch2: docbook-utils-w3mtxtconvert.patch +Patch3: docbook-utils-grepnocolors.patch +Patch4: docbook-utils-sgmlinclude.patch +Patch5: docbook-utils-rtfmanpage.patch +Patch6: docbook-utils-papersize.patch +Patch7: docbook-utils-nofinalecho.patch +Patch8: docbook-utils-newgrep.patch + +%description +This package contains scripts are for easy conversion from DocBook +files to other formats (for example, HTML, RTF, and PostScript), and +for comparing SGML files. + +%package pdf +Requires: texlive-jadetex >= 7 +Requires: docbook-utils = %{version} +Requires: tex(dvips) +Requires: texlive-collection-fontsrecommended +Requires: texlive-collection-htmlxml +License: GPL+ +Obsoletes: stylesheets-db2pdf <= %{version}-%{release} +Provides: stylesheets-db2pdf = %{version}-%{release} +Summary: A script for converting DocBook documents to PDF format +URL: http://sources.redhat.com/docbook-tools/ + +%description pdf +This package contains a script for converting DocBook documents to +PDF format. + +%prep +%setup -q +%patch0 -p1 -b .spaces +%patch1 -p1 -b .2ndspaces +%patch2 -p1 -b .w3mtxtconvert +%patch3 -p1 -b .grepnocolors +%patch4 -p1 -b .sgmlinclude +%patch5 -p1 -b .rtfman +%patch6 -p1 -b .papersize +%patch7 -p1 -b .finalecho +%patch8 -p1 -b .newgrep + +%build +./configure --prefix=%{_prefix} --mandir=%{_mandir} --libdir=%{_libdir} +make %{?_smp_mflags} + +%install +export DESTDIR=$RPM_BUILD_ROOT +make install prefix=%{_prefix} mandir=%{_mandir} docdir=/tmp +for util in dvi html pdf ps rtf +do + ln -s docbook2$util $RPM_BUILD_ROOT%{_bindir}/db2$util + ln -s jw.1.gz $RPM_BUILD_ROOT/%{_mandir}/man1/db2$util.1 +done +ln -s jw.1.gz $RPM_BUILD_ROOT/%{_mandir}/man1/docbook2txt.1 +# db2html is not just a symlink, as it has to create the output directory +rm -f $RPM_BUILD_ROOT%{_bindir}/db2html +install -p -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/db2html +install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/sgml/docbook/utils-%{version}/docbook-utils.dsl +install -p -m 755 %{SOURCE3} $RPM_BUILD_ROOT%{_datadir}/sgml/docbook/utils-%{version}/helpers/docbook2man-spec.pl + +rm -rf $RPM_BUILD_ROOT/tmp + +%files +%doc README COPYING TODO +%{_bindir}/jw +%{_bindir}/docbook2html +%{_bindir}/docbook2man +%{_bindir}/docbook2rtf +%{_bindir}/docbook2tex +%{_bindir}/docbook2texi +%{_bindir}/docbook2txt +%attr(0755,root,root) %{_bindir}/db2html +%{_bindir}/db2rtf +%{_bindir}/sgmldiff +%{_datadir}/sgml/docbook/utils-%{version} +%{_mandir}/*/db2dvi.* +%{_mandir}/*/db2html.* +%{_mandir}/*/db2ps.* +%{_mandir}/*/db2rtf.* +%{_mandir}/*/docbook2html.* +%{_mandir}/*/docbook2rtf.* +%{_mandir}/*/docbook2man.* +%{_mandir}/*/docbook2tex.* +%{_mandir}/*/docbook2texi.* +%{_mandir}/*/docbook2txt.* +%{_mandir}/*/jw.* +%{_mandir}/*/sgmldiff.* +%{_mandir}/*/*-spec.* + +%files pdf +%{_bindir}/docbook2pdf +%{_bindir}/docbook2dvi +%{_bindir}/docbook2ps +%{_bindir}/db2dvi +%{_bindir}/db2pdf +%{_bindir}/db2ps +%{_mandir}/*/db2pdf.* +%{_mandir}/*/docbook2pdf.* +%{_mandir}/*/docbook2dvi.* +%{_mandir}/*/docbook2ps.* + +%changelog +* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 0.6.14-54 +- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags + Related: rhbz#1991688 + +* Thu Apr 15 2021 Mohan Boddu <mboddu@redhat.com> - 0.6.14-53 +- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937 + +* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.14-52 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Mon Jan 18 2021 Kamil Dudka <kdudka@redhat.com> - 0.6.14-51 +- suggest lynx rather than elinks to satisfy text-www-browser + +* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.14-50 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.14-49 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.14-48 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.14-47 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.14-46 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Mon Mar 12 2018 Ondrej Mosnáček <omosnace@redhat.com> - 0.6.14-45 +- Fix jadetex dependency + +* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.14-44 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.14-43 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.14-42 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Fri Jul 01 2016 Stephen Gallagher <sgallagh@redhat.com> - 0.6.14-41 +- Add "Suggests: elinks" to satisfy text-www-browser +- Resolves: rhbz#1310897 + +* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.14-40 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.14-39 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.14-38 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.14-37 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Wed Jul 17 2013 Petr Pisar <ppisar@redhat.com> - 0.6.14-36 +- Perl 5.18 rebuild + +* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.14-35 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Tue Dec 11 2012 Ondrej Vasik <ovasik@redhat.com> 0.6.14-34 +- fix the sgmlinclude patch (#797120) + +* Mon Nov 12 2012 Ondrej Vasik <ovasik@redhat.com> 0.6.14-33 +- add missing requires in pdf subpackage added due to texlive + update (#875344) + +* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.14-32 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Wed May 30 2012 Ondrej Vasik <ovasik@redhat.com> 0.6.14-31 +- fix escaping of double-quotes in docbook2man (#826139) +- fix the wrong format of C-style functions in docbook2man (#662869) +- fix stray .fi at the end of funcsynopsis section (#662869) + +* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.14-30 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Fri Nov 25 2011 Ondrej Vasik <ovasik@redhat.com> 0.6.14-29 +- improve handling of jw options in db2html,respect + --output (#756928) + +* Fri Nov 25 2011 Ondrej Vasik <ovasik@redhat.com> 0.6.14-28 +- cleanup output dir for empty db2html input (#756930) + +* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.14-27 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Mon Oct 04 2010 Ondrej Vasik <ovasik@redhat.com> 0.6.14-26 +- fix autogenerated manpage header format(#639347) + +* Tue Sep 28 2010 Ondrej Vasik <ovasik@redhat.com> 0.6.14-25 +- make [[:space:]] class syntax compatible with new grep(#637594) + +* Mon May 31 2010 Ondrej Vasik <ovasik@redhat.com> 0.6.14-24 +- do not produce final echo, it causes some manpage noise + with new perl(#513271, #587012) + +* Tue Oct 27 2009 Ondrej Vasik <ovasik@redhat.com> 0.6.14-23 +- do not obsolete self + +* Mon Oct 12 2009 Ondrej Vasik <ovasik@redhat.com> 0.6.14-22 +- fix url in pdf subpackage + +* Wed Oct 07 2009 Ondrej Vasik <ovasik@redhat.com> 0.6.14-21 +- fix locale-based papersize selection (#527395) + +* Thu Aug 27 2009 Ondrej Vasik <ovasik@redhat.com> 0.6.14-20 +- provide symlink manpage for docbook2txt + +* Thu Aug 13 2009 Ondrej Vasik <ovasik@redhat.com> 0.6.14-19 +- add note about openjade limitation in rtf section of jw + manpage(#516942) + +* Fri Jul 24 2009 Ondrej Vasik <ovasik@redhat.com> 0.6.14-18 +- another quoted variable fixes for spaces in filenames +- use SGML_INCLUDE in man backend(upstream) +- change upstream URL to something useful +- escape dots and single quotes in column 1 in docbook2man-spec.pl + +* Mon Jun 29 2009 Ondrej Vasik <ovasik@redhat.com> 0.6.14-17 +- fix pdf subpackage requires(to match TeXLive2008 provides) + +* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.14-16 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Fri Nov 28 2008 Ondrej Vasik <ovasik@redhat.com> 0.6.14-15 +- require grep,gawk, fix jw script to find SGML_BASE_DIR even + with grep with colors(#473278), finish funcsynopsis patch + drop + +* Mon Sep 08 2008 Ondrej Vasik <ovasik@redhat.com> 0.6-14-14 +- ship new version of docbook2man-spec.pl to avoid issues + with the old one +- dropped funcsynopsis patch - docbook2man-spec.pl from + tarball used no longer + +* Thu Nov 22 2007 Ondrej Vasik <ovasik@redhat.com> 0.6.14-13 +- fix of w3m params while converting to txt + +* Tue Nov 05 2007 Ondrej Vasik <ovasik@redhat.com> 0.6.14-12 +- Merge Review(#225705) +- corrected some other packaging guidelines issues + +* Thu Nov 01 2007 Ondrej Vasik <ovasik@redhat.com> 0.6.14-11 +- rpmlint check +- fixed: dist tag, summary ended with dot, license tag, + versioned provides/obsoletes + some cosmetic changes + +* Fri Oct 12 2007 Ondrej Vasik <ovasik@redhat.com> 0.6.14-10 +- generalized text browser requirement(#174566) + +* Tue Sep 18 2007 Ondrej Vasik <ovasik@redhat.com> 0.6.14-9 +- fixed typo in Source URL + +* Mon May 21 2007 Ondrej Vasik <ovasik@redhat.com> 0.6.14-8 +- Added more fixes for handling spaces in directory name +- SGML_FILE variable is factored out of SGML_ARGUMENTS +- (changes taken from upstream) + +* Tue Apr 24 2007 Petr Mejzlik <pmejzlik@redhat.com> 0.6.14-7 +- add missing dist tag, bump release + +* Tue Apr 24 2007 Petr Mejzlik <pmejzlik@redhat.com> 0.6.14-6 +- Fixed a minor bug in processing of <funcsynopsisinfo> (bug #217649) + +* Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - 0.6.14-5.1 +- rebuild + +* Thu Mar 09 2006 Florian La Roche <laroche@redhat.com> +- use 755 instead of 775 for /usr/bin/db2html + +* Thu Jan 5 2006 Tim Waugh <twaugh@redhat.com> 0.6.14-5 +- Move dvi and ps tools into pdf sub-package (bug #174897). + +* Fri Dec 09 2005 Jesse Keating <jkeating@redhat.com> +- rebuilt + +* Thu Aug 19 2004 Tim Waugh <twaugh@redhat.com> 0.6.14-4 +- Apply CVS patch to protect spaces in jw (bug #130329). + +* Tue Jun 15 2004 Elliot Lee <sopwith@redhat.com> +- rebuilt + +* Fri Feb 13 2004 Elliot Lee <sopwith@redhat.com> +- rebuilt + +* Wed Feb 11 2004 Tim Waugh <twaugh@redhat.com> 0.6.14-1 +- 0.6.14. +- All patches integrated. + +* Thu Nov 27 2003 Tim Waugh <twaugh@redhat.com> 0.6.13-9 +- Requires jadetex (bug #110755). + +* Thu Nov 27 2003 Tim Waugh <twaugh@redhat.com> 0.6.13-8 +- Build requires docbook-style-dsssl (bug #110754). + +* Tue Jun 10 2003 Tim Waugh <twaugh@redhat.com> 0.6.13-7 +- Fix manpage output: escape dots in column 1 (bug #97087). + +* Tue May 27 2003 Tim Waugh <twaugh@redhat.com> 0.6.13-6 +- Rebuild. + +* Fri May 23 2003 Tim Waugh <twaugh@redhat.com> 0.6.13-5 +- Build requires openjade. + +* Thu May 22 2003 Tim Waugh <twaugh@redhat.com> 0.6.13-4 +- Require elinks (bug #91472). + +* Thu May 1 2003 Tim Waugh <twaugh@redhat.com> 0.6.13-3 +- Move docbook2pdf man pages to pdf subpackage (bug #90041). + +* Wed Apr 30 2003 Elliot Lee <sopwith@redhat.com> 0.6.13-2 +- Add s/head -1/head -n 1/ patch to make ppc64 happy (among other things) + +* Mon Mar 17 2003 Tim Waugh <twaugh@redhat.com> 0.6.13-1 +- 0.6.13, fixing bug #86152. + +* Fri Feb 14 2003 Elliot Lee <sopwith@redhat.com> 0.6.12-6 +- tetex-dvips requirement should go on main package (not just pdf + subpackage) because docbook2ps requires dvips too. + +* Wed Feb 5 2003 Tim Waugh <twaugh@redhat.com> 0.6.12-5 +- Build requires perl-SGMLSpm (bug #83474). + +* Wed Jan 22 2003 Tim Powers <timp@redhat.com> 0.6.12-4 +- rebuilt + +* Mon Jan 13 2003 Tim Waugh <twaugh@redhat.com> 0.6.12-3 +- Fixes from CVS. + +* Tue Oct 22 2002 Tim Waugh <twaugh@redhat.com> 0.6.12-2 +- No longer need separate stylesheet for A4. +- Don't install files not packaged. + +* Wed Oct 16 2002 Tim Waugh <twaugh@redhat.com> 0.6.12-1 +- 0.6.12. + +* Thu Jun 27 2002 Tim Waugh <twaugh@redhat.com> 0.6.11-2 +- 0.6.11. + +* Fri Jun 21 2002 Tim Powers <timp@redhat.com> 0.6.10-5 +- automated rebuild + +* Sun May 26 2002 Tim Powers <timp@redhat.com> 0.6.10-4 +- automated rebuild + +* Mon May 20 2002 Tim Waugh <twaugh@redhat.com> 0.6.10-3 +- Improvements for man page output. + +* Fri May 3 2002 Tim Waugh <twaugh@redhat.com> 0.6.10-2 +- Don't define graphic-default-extension in the stylesheet---it messes + up PS+PDF output from the same source. + +* Wed May 1 2002 Tim Waugh <twaugh@redhat.com> 0.6.10-1 +- 0.6.10. +- No longer need automake files. +- No longer need '.', jw-custom, '@', pdf, nochunks, txt, '-o', manpage, + sdata, help, ol, '-V', sgml_xml, excl, link, pagesize, or texinputs + patches. + +* Fri Apr 12 2002 Tim Waugh <twaugh@redhat.com> 0.6.9-25 +- Turned off use-id-as-filename in gdp-both.dsl. + +* Fri Mar 22 2002 Tim Waugh <twaugh@redhat.com> 0.6.9-24 +- Pick up images from the right place (bug #61652). + +* Wed Mar 6 2002 Tim Waugh <twaugh@redhat.com> 0.6.9-23 +- Add URL tags, and provide: stylesheets and stylesheets-pdf (bug #60226). + +* Thu Feb 21 2002 Tim Waugh <twaugh@redhat.com> 0.6.9-22 +- Rebuild in new environment. + +* Tue Feb 5 2002 Tim Waugh <twaugh@redhat.com> 0.6.9-21 +- Edited the wrong file when making the patch.. fix breakage introduced + by trying to fix bug #58375. + +* Tue Feb 5 2002 Tim Waugh <twaugh@redhat.com> 0.6.9-20 +- Fix docbook frontend (bug #51478). +- Make the old db2html script understand the .xml filename extension + (bug #59194). +- Determine page size to use automatically from LC_PAPER (bug #58375). + +* Fri Jan 25 2002 Tim Waugh <twaugh@redhat.com> 0.6.9-19 +- Require the DocBook DTDs. + +* Tue Jan 22 2002 Tim Waugh <twaugh@redhat.com> 0.6.9-18 +- Fix bug #46913 again, since the last change broke it. + +* Sun Jan 20 2002 Tim Waugh <twaugh@redhat.com> 0.6.9-16 +- Several more fixes that will be in the next upstream version. + +* Sat Jan 19 2002 Tim Waugh <twaugh@redhat.com> 0.6.9-15 +- Support -V (bug #31518). + +* Wed Jan 09 2002 Tim Powers <timp@redhat.com> 0.6.9-14 +- automated rebuild + +* Wed Jan 9 2002 Tim Waugh <twaugh@redhat.com> 0.6.9-13 +- Fix generated man output for orderedlists. + +* Mon Dec 3 2001 Tim Waugh <twaugh@redhat.com> 0.6.9-12 +- Fix generated man output for funcprototypes with more than one + paramdef. + +* Wed Nov 28 2001 Tim Waugh <twaugh@redhat.com> 0.6.9-11 +- Rebuild to fix man pages (bug #56449). + +* Thu Nov 22 2001 Tim Waugh <twaugh@redhat.com> 0.6.9-10 +- Fix jw behaviour when executed with no parameter. +- Fix 'jw --help'. + +* Wed Nov 14 2001 Tim Waugh <twaugh@redhat.com> 0.6.9-9 +- Actually apply the patch that makes man backend understand −. +- Also don't redefine <comment> and <remark> for HTML output either. + +* Tue Nov 13 2001 Tim Waugh <twaugh@redhat.com> 0.6.9-8 +- Default stylesheet: <comment> and <remark> as rationale markers + probably isn't really appropriate for general use. +- Default stylesheet: larger top margin to make some RTF readers + happy (bug #56011). +- Make man backend understand −. +- Specfile cleanups (%%{_bindir}, %%{_docdir}). + +* Mon Nov 12 2001 Tim Waugh <twaugh@redhat.com> 0.6.9-7 +- The fix for bug #53546 broke '--dsl none'. Fix it. + +* Fri Nov 2 2001 Tim Waugh <twaugh@redhat.com> 0.6.9-6 +- Explicit synopsis for each docbook2[xxx] command in the jw man page. +- Clean up all temporary files in pdf backend. + +* Mon Oct 1 2001 Tim Waugh <twaugh@redhat.com> 0.6.9-5 +- Fix ADDRESS element output (bug #50605). + +* Fri Sep 28 2001 Tim Waugh <twaugh@redhat.com> 0.6.9-4 +- Adjust stylesheet so that it works with docbook-dsssl 1.72. +- Fix jw so that -o and -d can be used together (bug #53546). + +* Thu Sep 6 2001 Tim Waugh <twaugh@redhat.com> 0.6.9-3 +- Fix txt backend so that it works. +- Fix jw so that it uses the HTML stylesheet for text backends. +- Use links if lynx isn't available, in txt backend. + +* Mon Aug 13 2001 Tim Waugh <twaugh@redhat.com> 0.6.9-2 +- Larger bottom margin in gdp-both.dsl to fix RTF output (bug #49677). + +* Tue Jul 3 2001 Tim Waugh <twaugh@redhat.com> 0.6.9-1 +- 0.6.9. +- With --nochunks, send output to a file instead of stdout (bug #46913). + +* Mon Jun 4 2001 Tim Waugh <twaugh@redhat.com> 0.6.8-2 +- Make sure COPYING isn't installed as a symlink. + +* Mon May 21 2001 Tim Waugh <twaugh@redhat.com> 0.6.8-1 +- 0.6.8. + +* Mon May 21 2001 Tim Waugh <twaugh@redhat.com> 0.6-14 +- db2html: copy admon graphics to output directory (bug #40143). +- Require docbook-style-dsssl 1.64-2 for symbolic link used by db2html. +- db2html: handle arguments with spaces better. + +* Sat Mar 24 2001 Tim Waugh <twaugh@redhat.com> 0.6-13 +- Fix man pages (bug #32820). + +* Mon Mar 12 2001 Tim Waugh <twaugh@redhat.com> +- Fix argument parsing in docbook2xxx (bug #31518). +- Fix argument passing in db2html (bug #31520). +- Fix pdf generation (bug #31524). + +* Fri Feb 23 2001 Tim Waugh <twaugh@redhat.com> +- Allow the use of custom backends and frontends (bug #29067). + +* Fri Feb 16 2001 Tim Waugh <twaugh@redhat.com> +- Use gdp-both.dsl as the default stylesheet. + +* Mon Feb 12 2001 Tim Waugh <twaugh@redhat.com> +- REALLY only create output directory for db2html (duh). +- Handle filenames with dots in properly. + +* Sun Feb 11 2001 Tim Waugh <twaugh@redhat.com> +- Only create output directory for db2html (bug #27092). (docbook2html + does not create an output directory in the upstream version, but + the compatibility script has been made to do so.) + +* Mon Jan 22 2001 Tim Waugh <twaugh@redhat.com> +- Move the jadetex requirement to the -pdf subpackage. + +* Tue Jan 16 2001 Tim Waugh <twaugh@redhat.com> +- Put output files in new directory instead of current directory. + +* Mon Jan 15 2001 Tim Waugh <twaugh@redhat.com> +- Don't play so many macro games. +- Be sure to own utils directory. + +* Fri Jan 12 2001 Tim Waugh <twaugh@redhat.com> +- Split off docbook2pdf into subpackage for dependency reasons. + +* Mon Jan 08 2001 Tim Waugh <twaugh@redhat.com> +- Change group. +- Use %%{_mandir} and %%{_prefix}. +- db2* symlinks. +- Obsolete stylesheets (and -db2pdf). +- Change Copyright: to License:. +- Remove Packager: line. +- Reword description. + +* Mon Jan 08 2001 Tim Waugh <twaugh@redhat.com> +- Based on Eric Bischoff's new-trials packages. diff --git a/docbook2man-spec.pl b/docbook2man-spec.pl new file mode 100755 index 0000000..58939cb --- /dev/null +++ b/docbook2man-spec.pl @@ -0,0 +1,1564 @@ +=head1 NAME + +docbook2man-spec.pl - convert DocBook RefEntries to Unix manpages + +=head1 SYNOPSIS + +The sgmlspl script from the SGMLSpm Perl module must be used to run +this script. Use it like this: + +nsgmls some-docbook-document.sgml | sgmlspl docbook2man-spec.pl + +See man page or included DocBook documentation for details. + +=head1 DESCRIPTION + +This is a sgmlspl spec file that produces Unix-style +man pages from DocBook RefEntry markup. + +=head1 COPYRIGHT + +Copyright (C) 1998-2001 Steve Cheng <stevecheng@users.sourceforge.net> + +Copyright (C) 1999 Thomas Lockhart <lockhart@alumni.caltech.edu> + +This program is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +You should have received a copy of the GNU General Public License along with +this program; see the file COPYING. If not, please write to the Free +Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + +=cut + +# $Id: docbook2man-spec.pl,v 1.11 2010/10/04 10:23:31 ovasik Exp $ + +use SGMLS; # Use the SGMLS package. +use SGMLS::Output; # Use stack-based output. +use SGMLS::Refs; + + +######################################################################## +# SGMLSPL script produced automatically by the script sgmlspl.pl +# +# Document Type: any, but processes only RefEntries +# Edited by: me :) +######################################################################## + + +$write_manpages = 0; +$blank_xrefs = 0; + +$default_sect = "1"; +$default_date = `date "+%d %B %Y"`; +$cite_numeral_only = 1; + +while (@ARGV) { + my $arg = shift @ARGV; + if ($arg eq "--section") { + $default_sect = shift @ARGV || die "$arg requires an argument\n"; + } elsif ($arg eq "--date") { + $default_date = shift @ARGV || die "$arg requires an argument\n"; + } elsif ($arg eq "--lowercase") { + $lowercase_names = 1; + } elsif ($arg eq "--preserve-case") { + $lowercase_names = 0; + } elsif ($arg eq "--cite-numeral-only") { + $cite_numeral_only = 1; + } elsif ($arg eq "--nocite-numeral-only") { + $cite_numeral_only = 0; + } elsif ($arg eq "--help") { + print "Usage: $0", + " [ --section <label> ]", + " [ --date <string> ]", + " [ --lowercase | --preserve-case ]", + " [ --cite-numeral-only | --nocite-numeral-only ]", + "\n"; + exit; + } else { + die "unrecognized switch $arg; try $0 --help\n"; + } +} + +sgml('start', sub { + push_output('nul'); + $raw_cdata = 1; # Makes it a bit faster. + + # Links file + open(LINKSFILE, ">manpage.links"); + + $Refs = new SGMLS::Refs("manpage.refs", "manpage.log"); +}); +sgml('end', sub { + close(LINKSFILE); + + # Explicitly invoke destructor, + # otherwise cache file may not get written! + # Thomas Lockhart, 1999-08-03, perl-5.004, RedHat5.2 + undef $Refs; + + if($blank_xrefs) { + warn "Warning: output contains unresolved XRefs\n"; + } +}); + + +######################################################################## +# +# Output helpers +# +######################################################################## + +# Remove leading and trailing blanks. + +sub StripString +{ + my $str = shift; + + $str = $1 if ($str =~ m#^\s*(\S.*)#); + $str = $1 if ($str =~ m#^(.*\S)\s*$#); + + return $str; +} + +# Generate a good file name, for given manpage title and manvolnum +# (cdata content). +# Cleanup whitespace and convert to lower case if required. + +sub FileInfo +{ + my $title = StripString(shift); + my $volnum = StripString(shift); + + $title = lc $title if $lowercase_names; + + $title =~ tr/ /_/; + $volnum =~ tr/ /_/; + + my $sectcite = $volnum; + # The 'package name' part of the section should + # not be used when citing it. + if ($cite_numeral_only) { + $sectcite = $1 if ($volnum =~ /^([0-9]+)/); + } + + return ("$title.$volnum", "$title($sectcite)"); +} + +# Our own version of sgml() and output() to allow simple string output +# to play well with roff's stupid whitespace rules. + +sub man_sgml +{ + if(ref($_[1]) eq 'CODE') { + return &sgml; + } + + my $s = $_[1]; + $s =~ s/\\/\\\\/g; + $s =~ s/'/\\'/g; + + sgml($_[0], eval("sub { man_output '$s' }")); +} + +sub man_output +{ + if($separator eq 'full') { + output "\n" unless $newline_last++; + output ".PP\n"; + $separator = ''; + } + + $_ = shift; + if(s/^\n//) { + output "\n" unless $newline_last++; + } + return if $_ eq ''; + + output $_; + + if(@_) { + output @_; + $newline_last = (pop(@_) =~ /\n$/); + } else { + $newline_last = ($_ =~ /\n$/) + } +} + +# Fold lines into one, quote some characters +sub fold_string +{ + $_ = shift; + + s/\\/\\\\/g; + s/"/""/g; + + # Change tabs and newlines to spaces + # The newlines will be swallowed later while trimming + tr/[\t\n]/ /; + + # Trim whitespace from beginning and end. + s/^ +//; + s/ +$//; + + return $_; +} + +sub save_cdata() +{ + $raw_cdata++; + push_output('string'); +} + +sub bold_on() +{ + # If the last font is also bold, don't change anything. + # Basically this is to just get more readable man output. + if($fontstack[$#fontstack] ne 'bold') { + if(!$raw_cdata) { + output '\fB'; + #$newline_last = 0; + } + } + push(@fontstack, 'bold'); +} + +sub italic_on() +{ + # If the last font is also italic, don't change anything. + if($fontstack[$#fontstack] ne 'italic') { + if(!$raw_cdata) { + output '\fI'; + #$newline_last = 0; + } + } + push(@fontstack, 'italic'); +} + +sub font_off() +{ + my $thisfont = pop(@fontstack); + my $lastfont = $fontstack[$#fontstack]; + + # Only output font change if it is different + if($thisfont ne $lastfont) { + if($raw_cdata) { return; } + elsif($lastfont eq 'bold') { output '\fB'; } + elsif($lastfont eq 'italic') { output '\fI'; } + else { output '\fR'; } + + #$newline_last = 0; + } +} + + +######################################################################## +# +# Manpage management +# +######################################################################## + +sgml('<REFENTRY>', sub { + # This will be overwritten at end of REFMETA, when we know the name of the page. + pop_output(); + + $write_manpages = 1; # Currently writing manpage. + + $nocollapse_whitespace = 0; # Current whitespace collapse counter. + $newline_last = 1; # At beginning of line? + # Just a bit of warning, you will see this variable manipulated + # manually a lot. It makes the code harder to follow but it + # saves you from having to worry about collapsing at the end of + # parse, stopping at verbatims, etc. + $raw_cdata = 0; # Instructs certain output functions to + # leave CDATA alone, so we can assign + # it to a string and process it, etc. + @fontstack = (); # Fonts being activated. + + $list_nestlevel = 0; # Indent certain nested content. + + # Separator to use between 'elements' in the content of a + # paragraph (usually). This makes sure that PCDATA after a list + # in a PARA gets a break in between and not become part of the + # last listitem. Note that we can't do it after the list ends, + # because often the list ends the paragraph and we'll get an + # extra break. Anything that changes the separator status from + # the default should also save its last state in the parent + # element's ext, but I'm not going to explain further. It's a + # gross hack and almost guaranteed to fail in unforseen cases. + # The only way to avoid all this is to use a tree/grove model, which + # we're _not_ doing. + $separator = ''; + + $manpage_title = ''; # Needed for indexing. + $manpage_sect = ''; + @manpage_names = (); + + $manpage_misc = ''; + + # check refentry's language + if(defined($_[0]->attribute('LANG')->value)) { + $manpage_lang = $_[0]->attribute('LANG')->value; + } + else { + $manpage_lang = ''; + } +}); +sgml('</REFENTRY>', sub { + if(!$newline_last) { + output "\n"; + } + + $raw_cdata = 1; + push_output('nul'); + + $write_manpages = 0; +}); + +sgml('</REFMETA>', sub { + my ($filename, $citation) = + FileInfo($manpage_title, $manpage_sect || $default_sect); + + push_output('file', $filename); + + output <<'_END_BANNER'; +.\" auto-generated by docbook2man-spec from docbook-utils package +_END_BANNER + + my $manpage_date = $_[0]->parent->ext->{'date'} || $default_date; + + output '.TH "'; + + # If the title is not mixed-case, convention says to + # uppercase the whole title. (The canonical title is + # lowercase.) + if($manpage_title =~ /[A-Z]/) { + output fold_string($manpage_title); + } else { + output uc(fold_string($manpage_title)); + } + + output '" "', fold_string($manpage_sect), + '" "', fold_string($manpage_date), + '" "', $manpage_misc, + '" "', $manpage_manual, + "\"\n"; + + $newline_last = 1; + + # References to this RefEntry. + if(defined($_[0]->parent->attribute('ID')->value)) { + my $id = $_[0]->parent->attribute('ID')->value; + + # Append XREFLABEL content to citations. + if(defined($_[0]->parent->attribute('XREFLABEL')->value)) { + $citation = $_[0]->parent->attribute('XREFLABEL')->value . + ' [' . $citation . ']'; + } + + $Refs->put("refentry:$id", $citation); + } +}); + +sgml('<REFENTRYTITLE>', sub { + if($_[0]->in('REFMETA')) { + save_cdata(); + } else { + # Manpage citations are in bold. + bold_on(); + } +}); +sgml('</REFENTRYTITLE>', sub { + if($_[0]->in('REFMETA')) { + $raw_cdata--; + $manpage_title = pop_output(); + } + else { font_off(); } + + if (defined($_[0]->attribute('ID')->value)) { + my $id = $_[0]->attribute('ID')->value; + $Refs->put("refentrytitle:$id", $manpage_title); + } +}); + +sgml('<MANVOLNUM>', sub { + if($_[0]->in('REFMETA')) { + save_cdata(); + } else { + # Manpage citations use (). + output '('; + } +}); +sgml('</MANVOLNUM>', sub { + if($_[0]->in('REFMETA')) { + $raw_cdata--; + $manpage_sect = pop_output(); + } + else { output ')' } +}); + +sgml('<REFMISCINFO>', \&save_cdata); +sgml('</REFMISCINFO>', sub { + $raw_cdata--; + $manpage_misc = fold_string(pop_output()); +}); + + +# NAME section +#man_sgml('<REFNAMEDIV>', "\n.SH NAME\n"); +man_sgml('<REFNAMEDIV>', sub { + my %text = { fr=>'NOM', es=>'NOMBRE', pl=>'NAZWA' }; + + if(defined $text{lc($manpage_lang)}) + { + man_output "\n.SH " . $text{lc($manpage_lang)} . "\n"; + } elsif(defined $_[0]->attribute('LANG') and + defined $text{lc($_[0]->attribute('LANG')->value)}) + { + man_output "\n.SH " . $text{lc($_[0]->attribute('LANG'))} . "\n"; + } else { + man_output "\n.SH NAME\n"; + } +}); + +sgml('<REFNAME>', \&save_cdata); +sgml('</REFNAME>', sub { + $raw_cdata--; + push(@manpage_names, pop_output()); +}); + +sgml('<REFPURPOSE>', \&save_cdata); +sgml('</REFPURPOSE>', sub { + $raw_cdata--; + my $manpage_purpose = fold_string(pop_output()); + + for(my $i = 0; $i < $#manpage_names; $i++) { + output fold_string($manpage_names[$i]), ', '; + } + + output fold_string($manpage_names[$#manpage_names]); + output " \\- $manpage_purpose\n"; + + $newline_last = 1; + + foreach(@manpage_names) { + # Don't link to itself + if($_ ne $manpage_title) { + print LINKSFILE "$manpage_title.$manpage_sect $_.$manpage_sect\n"; + } + } +}); + +man_sgml('<REFCLASS>', "\n.sp\n"); + +#RefDescriptor + + +######################################################################## +# +# SYNOPSIS section and synopses +# +######################################################################## + +#man_sgml('<REFSYNOPSISDIV>', "\n.SH SYNOPSIS\n"); +man_sgml('<REFSYNOPSISDIV>', sub { + if ($manpage_lang eq "pl") { man_output "\n.SH SKADNIA\n"; } + # waits for another languages + #elsif ($manpage_lang eq "xx") { man_output "\n.SH xxxxxxx\n"; } + else { man_output "\n.SH SYNOPSIS\n"; } +}); + +man_sgml('</REFSYNOPSISDIV>', "\n"); + +## FIXME! Must be made into block elements!! +#sgml('<FUNCSYNOPSIS>', \&bold_on); +#sgml('</FUNCSYNOPSIS>', \&font_off); +#sgml('<CMDSYNOPSIS>', \&bold_on); +#sgml('</CMDSYNOPSIS>', \&font_off); + +man_sgml('<FUNCSYNOPSIS>', sub { + man_output("\n.nf\n"); + bold_on(); +}); +man_sgml('</FUNCSYNOPSIS>', sub { + man_output("\n.fi"); + font_off(); +}); + +man_sgml('<CMDSYNOPSIS>', "\n.sp\n"); +man_sgml('</CMDSYNOPSIS>', "\n"); + +man_sgml('<FUNCPROTOTYPE>', "\n.sp\n"); + +# Arguments to functions. This is C convention. +#man_sgml('<PARAMDEF>', '('); +#man_sgml('</PARAMDEF>', ");\n"); +#man_sgml('<VOID>', "(void);\n"); +sub paramdef +{ + if($_[0]->parent->ext->{'inparams'}) { + output ', '; + } else { + output ' ('; + $_[0]->parent->ext->{'inparams'} = 1; + } +} +man_sgml('<PARAMDEF>', \¶mdef); +man_sgml('</FUNCPROTOTYPE>', ");\n"); +man_sgml('<VOID>', "(void"); +man_sgml('<VARARGS>', "(..."); + + +sub arg_start +{ + # my $choice = $_[0]->attribute('CHOICE')->value; + + # The content model for CmdSynopsis doesn't include #PCDATA, + # so we won't see any of the whitespace in the source file, + # so we have to add it after each component. + man_output ' '; + + if($_[0]->attribute('CHOICE')->value =~ /opt/i) { + man_output '[ '; + } + bold_on(); +} +sub arg_end +{ + font_off(); + if($_[0]->attribute('REP')->value =~ /^Repeat/i) { + italic_on(); + man_output '...'; + font_off(); + } + if($_[0]->attribute('CHOICE')->value =~ /opt/i) { + man_output ' ] '; + } +} + +sgml('<ARG>', \&arg_start); +sgml('</ARG>', \&arg_end); +sgml('<GROUP>', \&arg_start); +sgml('</GROUP>', \&arg_end); + +sgml('<OPTION>', \&bold_on); +sgml('</OPTION>', \&font_off); + +# FIXME: This is one _blank_ line. +man_sgml('<SBR>', "\n\n"); + + +######################################################################## +# +# General sections +# +######################################################################## + +# The name of the section is handled by TITLE. This just sets +# up the roff markup. +man_sgml('<REFSECT1>', sub { $separator = ''; man_output "\n.SH "}); +man_sgml('<REFSECT2>', sub { $separator = ''; man_output "\n.SS "}); +man_sgml('<REFSECT3>', sub { $separator = ''; man_output "\n.SS "}); + + +######################################################################## +# +# Titles, metadata. +# +######################################################################## + +sgml('<TITLE>', sub { + if($_[0]->in('REFERENCE') or $_[0]->in('BOOK')) { + $write_manpages = 1; + } + save_cdata(); +}); +sgml('</TITLE>', sub { + my ($element, $event) = @_; + my $title = fold_string(pop_output()); + $raw_cdata--; + + if($element->in('REFERENCE') or $element->in('BOOK')) { + # We use TITLE of enclosing Reference or Book as manual name + $manpage_manual = $title; + $write_manpages = 0; + } + elsif(exists $element->parent->ext->{'title'}) { + # By far the easiest case. Just fold the string as + # above, and then set the parent element's variable. + $_[0]->parent->ext->{'title'} = $title; + } + else { + # If the parent element's handlers are lazy, + # output the folded string for them :) + # We assume they want uppercase and a newline. + man_output '"', uc($title), "\"\n"; + } + + if (defined($element->attribute('ID')->value)) { + my $id = $_[0]->attribute('ID')->value; + $Refs->put("title:$id", $title); + } + + my ($filename, $citation) = + FileInfo($manpage_title, $manpage_sect || $default_sect); + my $parentid = $element->parent->attribute('ID')->value; + if ($parentid and ($element->in('REFSECT1') or $element->in('REFSECT2') or $element->in('REFSECT3'))) { + $Refs->put("refsect:$parentid", "$citation"); + } +}); + +sgml('<ATTRIBUTION>', sub { + if($_[0]->in('BLOCKQUOTE')) { + push_output('string'); + } +}); +sgml('</ATTRIBUTION>', sub { + if($_[0]->in('BLOCKQUOTE')) { + $_[0]->parent->ext->{'attribution'} = pop_output(); + } else { + # For an Epigraph. + man_output "\n\n"; + } +}); + +sgml('<DATE>', sub { + save_cdata(); +}); +sgml('</DATE>', sub { + $_[0]->parent->parent->ext->{'date'} = fold_string(pop_output()); + $raw_cdata--; +}); + +sub ignore_content { push_output 'nul'; } +sub restore_content { pop_output(); } + +sgml('<DOCINFO>', \&ignore_content); +sgml('</DOCINFO>', \&restore_content); +sgml('<REFSYNOPSISDIVINFO>', \&ignore_content); +sgml('</REFSYNOPSISDIVINFO>', \&restore_content); +sgml('<REFSECT1INFO>', \&ignore_content); +sgml('</REFSECT1INFO>', \&restore_content); +sgml('<REFSECT2INFO>', \&ignore_content); +sgml('</REFSECT2INFO>', \&restore_content); +sgml('<REFSECT3INFO>', \&ignore_content); +sgml('</REFSECT3INFO>', \&restore_content); + +sgml('<INDEXTERM>', \&ignore_content); +sgml('</INDEXTERM>', \&restore_content); + +sgml('<AUTHORBLURB>', \&ignore_content); +sgml('</AUTHORBLURB>', \&restore_content); + + +######################################################################## +# +# Set bold on enclosed content +# +######################################################################## + +sgml('<APPLICATION>', \&bold_on); +sgml('</APPLICATION>', \&font_off); + +sgml('<CLASSNAME>', \&bold_on); sgml('</CLASSNAME>', \&font_off); +sgml('<STRUCTNAME>', \&bold_on); sgml('</STRUCTNAME>', \&font_off); +sgml('<STRUCTFIELD>', \&bold_on); sgml('</STRUCTFIELD>', \&font_off); +sgml('<SYMBOL>', \&bold_on); sgml('</SYMBOL>', \&font_off); +sgml('<TYPE>', \&bold_on); sgml('</TYPE>', \&font_off); + +sgml('<ENVAR>', \&bold_on); sgml('</ENVAR>', \&font_off); + +sgml('<FUNCTION>', \&bold_on); sgml('</FUNCTION>', \&font_off); + +sgml('<EMPHASIS>', \&bold_on); sgml('</EMPHASIS>', \&font_off); + +sgml('<ERRORNAME>', \&bold_on); sgml('</ERRORNAME>', \&font_off); +# ERRORTYPE + +sgml('<COMMAND>', \&bold_on); sgml('</COMMAND>', \&font_off); + +sgml('<GUIBUTTON>', \&bold_on); sgml('</GUIBUTTON>', \&font_off); +sgml('<GUIICON>', \&bold_on); sgml('</GUIICON>', \&font_off); +# GUILABEL +# GUIMENU +# GUIMENUITEM +# GUISUBMENU +# MENUCHOICE + +sgml('<ACCEL>', \&bold_on); sgml('</ACCEL>', \&font_off); +# KEYCODE +# SHORTCUT + + +sgml('<KEYCOMBO>', sub { + $separator = 'none'; + $_[0]->ext->{'separator'} = 'none'; +}); +sgml('</KEYCOMBO>', sub { $separator = $_[0]->parent->ext->{'separator'}; }); + +sub _keycombo { + if($_[0]->in('KEYCOMBO')) { + if($separator eq 'none') { $separator = '' } + else { man_output "+"; } + } + bold_on(); +} +sgml('<KEYCAP>', \&_keycombo); sgml('</KEYCAP>', \&font_off); +sgml('<KEYSYM>', \&_keycombo); sgml('</KEYSYM>', \&font_off); +sgml('<MOUSEBUTTON>', \&_keycombo); sgml('</MOUSEBUTTON>', \&font_off); + + +sgml('<USERINPUT>', \&bold_on); sgml('</USERINPUT>', \&font_off); + +sgml('<INTERFACEDEFINITION>', \&bold_on); +sgml('</INTERFACEDEFINITION>', \&font_off); + +# May need to look at the CLASS +sgml('<SYSTEMITEM>', \&bold_on); +sgml('</SYSTEMITEM>', \&font_off); + + +######################################################################## +# +# Set italic on enclosed content +# +######################################################################## + +sgml('<FIRSTTERM>', \&italic_on); sgml('</FIRSTTERM>', \&font_off); + +sgml('<FILENAME>', \&italic_on); sgml('</FILENAME>', \&font_off); +sgml('<PARAMETER>', \&italic_on); sgml('</PARAMETER>', \&font_off); +sgml('<PROPERTY>', \&italic_on); sgml('</PROPERTY>', \&font_off); + +sgml('<REPLACEABLE>', sub { + italic_on(); + if($_[0]->in('TOKEN')) { + # When tokenizing, follow more 'intuitive' convention + output "<"; + } +}); +sgml('</REPLACEABLE>', sub { + if($_[0]->in('TOKEN')) { + output ">"; + } + font_off(); +}); + +sgml('<CITETITLE>', \&italic_on); sgml('</CITETITLE>', \&font_off); +sgml('<FOREIGNPHRASE>', \&italic_on); sgml('</FOREIGNPHRASE>', \&font_off); + +sgml('<LINEANNOTATION>', \&italic_on); sgml('</LINEANNOTATION>', \&font_off); + + +######################################################################## +# +# Other 'inline' elements +# +######################################################################## + +man_sgml('<EMAIL>', '<'); +man_sgml('</EMAIL>', '>'); +man_sgml('<OPTIONAL>', '['); +man_sgml('</OPTIONAL>', ']'); + +man_sgml('</TRADEMARK>', "\\u\\s-2TM\\s+2\\d"); + +man_sgml('<COMMENT>', "[Comment: "); +man_sgml('</COMMENT>', "]"); + +man_sgml('<QUOTE>', "``"); +man_sgml('</QUOTE>', "''"); + +#man_sgml('<LITERAL>', '"'); +#man_sgml('</LITERAL>', '"'); +# There doesn't seem to be a good way to represent LITERAL in -man +# ComputerOutput, SGMLTag, Markup are the same thing. + +# These create spaces between content in special elements +# without PCDATA content. +man_sgml('</HONORIFIC>', " "); +man_sgml('</FIRSTNAME>', " "); +man_sgml('</SURNAME>', " "); +man_sgml('</LINEAGE>', " "); +man_sgml('</OTHERNAME>', " "); + +man_sgml('<AFFILIATION>', "("); +man_sgml('</AFFILIATION>', ") "); +man_sgml('<CONTRIB>', "("); +man_sgml('</CONTRIB>', ") "); + +man_sgml('</STREET>', " "); +man_sgml('</POB>', " "); +man_sgml('</POSTCODE>', " "); +man_sgml('</CITY>', " "); +man_sgml('</STATE>', " "); +man_sgml('</COUNTRY>', " "); +man_sgml('</PHONE>', " "); +man_sgml('</FAX>', " "); +man_sgml('</OTHERADDRESS>', " "); + +man_sgml('</ALT>', ": "); +man_sgml('<GRAPHIC>', " [GRAPHIC] "); + +# No special presentation: + +# AUTHORINITIALS + +# ABBREV +# ACTION +# ACRONYM +# CITATION +# PHRASE +# QUOTE +# WORDASWORD + +# PROMPT +# RETURNVALUE +# TOKEN + +# DATABASE +# HARDWARE +# INTERFACE +# MEDIALABEL + + +######################################################################## +# +# Paragraph and paragraph-like elements +# +######################################################################## + +sub para_start { + if($separator eq '' or $separator eq 'full') { + $separator = ''; + man_output "\n.PP\n"; + } elsif($separator eq 'blank') { + man_output "\n\n"; + } elsif($separator eq 'none' ) { + $_[0]->parent->ext->{'separator'} = 'blank'; + $separator = 'blank'; + } +} +# Actually applies to a few other block elements as well +sub para_end { + $separator = $_[0]->parent->ext->{'separator'}; + man_output "\n"; +} + +sgml('<PARA>', \¶_start); +sgml('</PARA>', \¶_end); +sgml('<SIMPARA>', \¶_start); +sgml('</SIMPARA>', \¶_end); + +# Nothing special, except maybe FIXME set nobreak. +sgml('<INFORMALEXAMPLE>', \¶_start); +sgml('</INFORMALEXAMPLE>', \¶_end); + + +######################################################################## +# +# Blocks using SS sections +# +######################################################################## + +# FIXME: We need to consider the effects of SS +# in a hanging tag :( + +# Complete with the optional-title dilemma (again). +sgml('<ABSTRACT>', sub { + $_[0]->ext->{'title'} = 'ABSTRACT'; + output "\n" unless $newline_last++; + push_output('string'); +}); +sgml('</ABSTRACT>', sub { + my $content = pop_output(); + + # As ABSTRACT is never on the same level as RefSect1, + # this leaves us with only .SS in terms of -man macros. + output ".SS \"", uc($_[0]->ext->{'title'}), "\"\n"; + + output $content; + output "\n" unless $newline_last++; +}); + + + +# Ah, I needed a break. Example always has a title. +sgml('<EXAMPLE>', sub { $separator = ''; man_output "\n.SS "}); +sgml('</EXAMPLE>', \¶_end); + +# Same with sidebar. +sgml('<SIDEBAR>', sub { $separator = ''; man_output "\n.SS "}); +sgml('</SIDEBAR>', \¶_end); + +sgml('<FORMALPARA>', sub { $separator = ''; man_output "\n.SS "}); +sgml('</FORMALPARA>', \¶_end); + +sgml('<FIGURE>', sub { $separator = ''; man_output "\n.SS "}); +sgml('</FIGURE>', \¶_end); + + + +# NO title. +sgml('<HIGHLIGHTS>', sub { $separator = ''; man_output "\n.SS HIGHLIGHTS\n"}); +sgml('</HIGHLIGHTS>', \¶_end); + + +######################################################################## +# +# Indented 'Block' elements +# +######################################################################## + +sub indent_block_start +{ + $separator = ''; + man_output "\n.sp\n.RS\n"; +} +sub indent_block_end +{ + $separator = $_[0]->parent->ext->{'separator'}; + man_output "\n.RE\n.sp\n"; +} + +sgml('<ADDRESS>', sub { + &indent_block_start; + if($_[0]->attribute('FORMAT')->type eq 'NOTATION' + and $_[0]->attribute('FORMAT')->value->name eq 'LINESPECIFIC') { + &verbatim_start; + } +}); +sgml('</ADDRESS>', sub { + if($_[0]->attribute('FORMAT')->type eq 'NOTATION' + and $_[0]->attribute('FORMAT')->value->name eq 'LINESPECIFIC') { + &verbatim_end; + } + &indent_block_end; +}); + +# This element is almost like an admonition (below), +# only the default title is blank :) + +sgml('<BLOCKQUOTE>', sub { + $_[0]->ext->{'title'} = ''; + &indent_block_start; + push_output('string'); +}); +sgml('</BLOCKQUOTE>', sub { + my $content = pop_output(); + + if($_[0]->ext->{'title'}) { + output ".B \"", $_[0]->ext->{'title'}, ":\"\n"; + } + + output $content; + + if($_[0]->ext->{'attribution'}) { + man_output "\n\n -- ", + $_[0]->ext->{'attribution'}, "\n"; + } + + &indent_block_end; +}); + +# Set off admonitions from the rest of the text by indenting. +# FIXME: Need to check if this works inside paragraphs, not enclosing them. +sub admonition_end { + my $content = pop_output(); + + # When the admonition is only one paragraph, + # it looks nicer if the title was inline. + my $num_para; + while ($content =~ /^\.PP/gm) { $num_para++ } + if($num_para==1) { + $content =~ s/^\.PP\n//; + } + + output ".B \"" . $_[0]->ext->{'title'} . ":\"\n"; + output $content; + + &indent_block_end; +} + +sgml('<NOTE>', sub { + # We can't see right now whether or not there is a TITLE + # element, so we have to save the output now and add it back + # at the end of this admonition. + $_[0]->ext->{'title'} = 'Note'; + + &indent_block_start; + + push_output('string'); +}); +sgml('</NOTE>', \&admonition_end); + +# Same as above. +sgml('<WARNING>', sub { + $_[0]->ext->{'title'} = 'Warning'; + &indent_block_start; + push_output('string'); +}); +sgml('</WARNING>', \&admonition_end); + +sgml('<TIP>', sub { + $_[0]->ext->{'title'} = 'Tip'; + &indent_block_start; + push_output('string'); +}); +sgml('</TIP>', \&admonition_end); +sgml('<CAUTION>', sub { + $_[0]->ext->{'title'} = 'Caution'; + &indent_block_start; + push_output('string'); +}); +sgml('</CAUTION>', \&admonition_end); + +sgml('<IMPORTANT>', sub { + $_[0]->ext->{'title'} = 'Important'; + &indent_block_start; + push_output('string'); +}); +sgml('</IMPORTANT>', \&admonition_end); + + +######################################################################## +# +# Verbatim displays. +# +######################################################################## + +sub verbatim_start { + $separator = ''; + man_output "\n.sp\n"; + man_output "\n.nf\n" unless $nocollapse_whitespace++; +} + +sub verbatim_end { + man_output "\n.sp\n"; + man_output "\n.fi\n" unless --$nocollapse_whitespace; + $separator = $_[0]->parent->ext->{'separator'}; +} + +sgml('<PROGRAMLISTING>', \&verbatim_start); +sgml('</PROGRAMLISTING>', \&verbatim_end); + +sgml('<SCREEN>', \&verbatim_start); +sgml('</SCREEN>', \&verbatim_end); + +sgml('<LITERALLAYOUT>', \&verbatim_start); +sgml('</LITERALLAYOUT>', \&verbatim_end); + +sgml('<SYNOPSIS>', sub { + my $format = $_[0]->attribute('FORMAT'); + + if($format->type eq 'NOTATION' + and $format->value->name eq 'LINESPECIFIC') + { + &verbatim_start; + } else { + $separator = ''; + man_output "\n.sp\n"; + } +}); + +sgml('</SYNOPSIS>', sub { + my $format = $_[0]->attribute('FORMAT'); + + if($format->type eq 'NOTATION' + and $format->value->name eq 'LINESPECIFIC') + { + &verbatim_end; + } else { + man_output "\n"; + $_[0]->parent->ext->{'separator'} = 'full'; + $separator = 'full'; + } +}); + + +######################################################################## +# +# Lists +# +######################################################################## + +# Indent nested lists. +sub list_start { + man_output "\n.RS\n" if $list_nestlevel++; +} +sub list_end { + man_output "\n.RE\n" if --$list_nestlevel; + $_[0]->parent->ext->{'separator'} = 'full'; + $separator = 'full'; +} + +sgml('<VARIABLELIST>', \&list_start); +sgml('</VARIABLELIST>', \&list_end); +sgml('<ITEMIZEDLIST>', \&list_start); +sgml('</ITEMIZEDLIST>', \&list_end); +sgml('<ORDEREDLIST>', sub { + &list_start; + $_[0]->ext->{'count'} = 1; +}); +sgml('</ORDEREDLIST>', \&list_end); + +# Output content on one line, bolded. +sgml('<TERM>', sub { + man_output "\n.TP\n"; + bold_on(); + push_output('string'); +}); +sgml('</TERM>', sub { + my $term = StripString(pop_output()); + $term =~ tr/\n/ /; + output $term; + font_off(); + output "\n"; + $newline_last = 1; +}); + +sgml('<LISTITEM>', sub { + # A bulleted list. + if($_[0]->in('ITEMIZEDLIST')) { + man_output "\n.TP 0.2i\n\\(bu\n"; + } + + # Need numbers. + # Assume Arabic numeration for now. + elsif($_[0]->in('ORDEREDLIST')) { + man_output "\n.IP ", $_[0]->parent->ext->{'count'}++, ". \n"; + } + + $_[0]->ext->{'separator'} = 'none'; + $separator = 'none'; +}); + +sgml('<SIMPLELIST>', sub { + $_[0]->ext->{'first_member'} = 1; +}); +sgml('<MEMBER>', sub { + my $parent = $_[0]->parent; + + if($parent->attribute('TYPE')->value =~ /Inline/i) { + if($parent->ext->{'first_member'}) { + # If this is the first member don't put any commas + $parent->ext->{'first_member'} = 0; + } else { + man_output ", "; + } + + # We don't really have Horiz rendering, so it's the same + # as Vert. + } else { + man_output "\n\n"; + } +}); + +# We implement Procedures as indent and lists + +sgml('<PROCEDURE>', sub { + $_[0]->ext->{'count'} = 1; + &indent_block_start; +}); +sgml('</PROCEDURE>', sub { + &indent_block_end; + $_[0]->parent->ext->{'separator'} = 'full'; + $separator = 'full'; +}); + +sgml('<STEP>', sub { + man_output "\n.IP ", $_[0]->parent->ext->{'count'}++, ". \n"; + $_[0]->ext->{'separator'} = 'none'; + $separator = 'none'; +}); + + +######################################################################## +# +# Linkage, cross references +# +######################################################################## + +# Print the URL +sgml('</ULINK>', sub { + man_output ' <URL:', $_[0]->attribute('URL')->value, '>'; +}); + +# If cross reference target is a RefEntry, +# output CiteRefEntry-style references. +sgml('<XREF>', sub { + my $id = $_[0]->attribute('LINKEND')->value; + + my $manref = $Refs->get("refentry:$id") || $Refs->get("refsect:$id"); + if(!defined $manref) { + $blank_xrefs++ if $write_manpages; + man_output "[XRef to $id]"; + return; + } + + # Limited ENDTERM support. + if(defined $_[0]->attribute('ENDTERM')->value) { + my $endterm = $_[0]->attribute('ENDTERM')->value; + my $content = $Refs->get("title:$endterm") || + $Refs->get("refentrytitle:$endterm"); + man_output $content, ' ['; + } + + # This also displays the XREFLABEL (as bold)... + # It's not worth the bother to fix it though, there + # are better tools for this. + my ($title, $sect) = ($manref =~ /(.*)(\(.*\))/); + bold_on(); + man_output $title; + font_off(); + man_output $sect; + + if(defined $_[0]->attribute('ENDTERM')->value) { + man_output ']'; + } +}); + +# Anchor + +######################################################################## +# +# SDATA +# +######################################################################## + +man_sgml('|[lt ]|', '<'); +man_sgml('|[equals]|', '='); +man_sgml('|[gt ]|', '>'); +man_sgml('|[plus ]|', '\(pl'); +man_sgml('|[dollar]|', '$'); +man_sgml('|[num ]|', '#'); +man_sgml('|[percnt]|', '%'); +man_sgml('|[amp ]|', '&'); +man_sgml('|[commat]|', '@'); +man_sgml('|[lsqb ]|', '['); +man_sgml('|[bsol ]|', '\e'); +man_sgml('|[rsqb ]|', ']'); +man_sgml('|[lcub ]|', '{'); +man_sgml('|[verbar]|', '\(or'); +man_sgml('|[rcub ]|', '}'); +man_sgml('|[excl ]|', '!'); +man_sgml('|[quot ]|', '"'); +man_sgml('|[apos ]|', '\\&\''); +man_sgml('|[lpar ]|', '('); +man_sgml('|[rpar ]|', ')'); +man_sgml('|[comma ]|', ','); +man_sgml('|[lowbar]|', '_'); +man_sgml('|[period]|', '.'); +man_sgml('|[sol ]|', '/'); +man_sgml('|[colon ]|', ':'); +man_sgml('|[semi ]|', ';'); +man_sgml('|[quest ]|', '?'); +man_sgml('|[grave ]|', '`'); +man_sgml('|[tilde ]|', '~'); +man_sgml('|[half ]|', '\(12'); +man_sgml('|[frac12]|', '\(12'); +man_sgml('|[frac14]|', '\(14'); +man_sgml('|[frac34]|', '\(34'); +man_sgml('|[frac18]|', '1/8'); +man_sgml('|[frac38]|', '3/8'); +man_sgml('|[frac58]|', '5/8'); +man_sgml('|[frac78]|', '7/8'); +man_sgml('|[sup1 ]|', '\u1\l'); +man_sgml('|[sup2 ]|', '\u2\l'); +man_sgml('|[sup3 ]|', '\u3\l'); +man_sgml('|[plusmn]|', '\(+-'); +man_sgml('|[divide]|', '\(di'); +man_sgml('|[times ]|', '\(ti'); +man_sgml('|[pound ]|', '#'); +man_sgml('|[cent ]|', '\(ct'); +man_sgml('|[yen ]|', 'yen'); +man_sgml('|[ast ]|', '*'); +man_sgml('|[horbar]|', '_'); +man_sgml('|[micro ]|', '\(*m'); +man_sgml('|[ohm ]|', '\(*W'); +man_sgml('|[deg ]|', '\(de'); +man_sgml('|[sect ]|', '\(sc'); +man_sgml('|[larr ]|', '\(<-'); +man_sgml('|[rarr ]|', '\(->'); +man_sgml('|[uarr ]|', '\(ua'); +man_sgml('|[darr ]|', '\(da'); +man_sgml('|[copy ]|', '\(co'); +man_sgml('|[reg ]|', '\(rg'); +man_sgml('|[trade ]|', '\(tm'); +man_sgml('|[brvbar]|', '|'); +man_sgml('|[not ]|', '\(no'); +man_sgml('|[hyphen]|', '\-'); +man_sgml('|[laquo ]|', '<<'); +man_sgml('|[raquo ]|', '>>'); +man_sgml('|[lsquo ]|', '`'); +man_sgml('|[rsquo ]|', '\&\''); +man_sgml('|[ldquo ]|', '"'); +man_sgml('|[rdquo ]|', '"'); +man_sgml('|[nbsp ]|', '\ '); +man_sgml('|[shy ]|', '\%'); +man_sgml('|[emsp ]|', '\ \ '); +man_sgml('|[ensp ]|', '\ '); +man_sgml('|[emsp3 ]|', '\ '); +man_sgml('|[emsp4 ]|', '\ '); +man_sgml('|[numsp ]|', '\0'); +man_sgml('|[puncsp]|', '\|'); +man_sgml('|[thinsp]|', '\!'); +man_sgml('|[hairsp]|', '\\^'); +man_sgml('|[mdash ]|', '\(em'); +man_sgml('|[ndash ]|', '-'); +man_sgml('|[dash ]|', '-'); +man_sgml('|[blank ]|', '\ '); +man_sgml('|[hellip]|', '\&...'); +man_sgml('|[nldr ]|', '\&..'); +man_sgml('|[frac13]|', '1/3'); +man_sgml('|[frac23]|', '2/3'); +man_sgml('|[frac15]|', '1/5'); +man_sgml('|[frac25]|', '2/5'); +man_sgml('|[frac35]|', '3/5'); +man_sgml('|[frac45]|', '4/5'); +man_sgml('|[frac16]|', '1/6'); +man_sgml('|[frac56]|', '5/6'); +man_sgml('|[cir ]|', '\(ci'); +man_sgml('|[squ ]|', '\(sq'); +man_sgml('|[star ]|', '\(**'); +man_sgml('|[bull ]|', '\(bu'); +man_sgml('|[dagger]|', '\(dg'); +man_sgml('|[Dagger]|', '\(dd'); +man_sgml('|[caret ]|', '\^'); +man_sgml('|[lsquor]|', '`'); +man_sgml('|[ldquor]|', '``'); +man_sgml('|[fflig ]|', '\(ff'); +man_sgml('|[filig ]|', '\(fi'); +man_sgml('|[ffilig]|', '\(Fi'); +man_sgml('|[ffllig]|', '\(Fl'); +man_sgml('|[fllig ]|', '\(fl'); +man_sgml('|[rdquor]|', '\&\'\''); +man_sgml('|[rsquor]|', '\&\''); +man_sgml('|[vellip]|', '\&...'); +man_sgml('|[aacute]|', '\(a\''); +man_sgml('|[Aacute]|', '\(A\''); +man_sgml('|[acirc ]|', '\(a^'); +man_sgml('|[Acirc ]|', '\(A^'); +man_sgml('|[agrave]|', '\(a`'); +man_sgml('|[Agrave]|', '\(A`'); +man_sgml('|[auml ]|', '\(a:'); +man_sgml('|[aelig ]|', '\(ae'); +man_sgml('|[AElig ]|', '\(AE'); +man_sgml('|[eacute]|', '\(e\''); +man_sgml('|[Eacute]|', '\(E\''); +man_sgml('|[egrave]|', '\(e`'); +man_sgml('|[Egrave]|', '\(E`'); +man_sgml('|[iacute]|', '\(i\''); +man_sgml('|[Iacute]|', '\(I\''); +man_sgml('|[igrave]|', '\(i`'); +man_sgml('|[Igrave]|', '\(I`'); +man_sgml('|[ntilde]|', '\(n~'); +man_sgml('|[Ntilde]|', '\(N~'); +man_sgml('|[oacute]|', '\(o\''); +man_sgml('|[Oacute]|', '\(O\''); +man_sgml('|[ograve]|', '\(o`'); +man_sgml('|[Ograve]|', '\(O`'); +man_sgml('|[oslash]|', '\(o/'); +man_sgml('|[Oslash]|', '\(O/'); +man_sgml('|[szlig ]|', '\(ss'); +man_sgml('|[thorn ]|', '\(th'); +man_sgml('|[uacute]|', '\(u\''); +man_sgml('|[Uacute]|', '\(U\''); +man_sgml('|[ugrave]|', '\(u`'); +man_sgml('|[Ugrave]|', '\(U`'); +man_sgml('|[aogon ]|', '\(ao'); +man_sgml('|[agr ]|', '\(*a'); +man_sgml('|[Agr ]|', '\(*A'); +man_sgml('|[bgr ]|', '\(*b'); +man_sgml('|[Bgr ]|', '\(*B'); +man_sgml('|[ggr ]|', '\(*g'); +man_sgml('|[Ggr ]|', '\(*G'); +man_sgml('|[dgr ]|', '\(*d'); +man_sgml('|[Dgr ]|', '\(*D'); +man_sgml('|[egr ]|', '\(*e'); +man_sgml('|[Egr ]|', '\(*E'); +man_sgml('|[zgr ]|', '\(*z'); +man_sgml('|[Zgr ]|', '\(*Z'); +man_sgml('|[eegr ]|', '\(*y'); +man_sgml('|[EEgr ]|', '\(*Y'); +man_sgml('|[thgr ]|', '\(*h'); +man_sgml('|[THgr ]|', '\(*H'); +man_sgml('|[igr ]|', '\(*i'); +man_sgml('|[Igr ]|', '\(*I'); +man_sgml('|[kgr ]|', '\(*k'); +man_sgml('|[Kgr ]|', '\(*K'); +man_sgml('|[lgr ]|', '\(*l'); +man_sgml('|[Lgr ]|', '\(*L'); +man_sgml('|[mgr ]|', '\(*m'); +man_sgml('|[Mgr ]|', '\(*M'); +man_sgml('|[ngr ]|', '\(*n'); +man_sgml('|[Ngr ]|', '\(*N'); +man_sgml('|[xgr ]|', '\(*c'); +man_sgml('|[Xgr ]|', '\(*C'); +man_sgml('|[ogr ]|', '\(*o'); +man_sgml('|[Ogr ]|', '\(*O'); +man_sgml('|[pgr ]|', '\(*p'); +man_sgml('|[Pgr ]|', '\(*P'); +man_sgml('|[rgr ]|', '\(*r'); +man_sgml('|[Rgr ]|', '\(*R'); +man_sgml('|[sgr ]|', '\(*s'); +man_sgml('|[Sgr ]|', '\(*S'); +man_sgml('|[sfgr ]|', '\(ts'); +man_sgml('|[tgr ]|', '\(*t'); +man_sgml('|[Tgr ]|', '\(*T'); +man_sgml('|[ugr ]|', '\(*u'); +man_sgml('|[Ugr ]|', '\(*U'); +man_sgml('|[phgr ]|', '\(*f'); +man_sgml('|[PHgr ]|', '\(*F'); +man_sgml('|[khgr ]|', '\(*x'); +man_sgml('|[KHgr ]|', '\(*X'); +man_sgml('|[psgr ]|', '\(*q'); +man_sgml('|[PSgr ]|', '\(*Q'); +man_sgml('|[ohgr ]|', '\(*w'); +man_sgml('|[OHgr ]|', '\(*W'); +man_sgml('|[alpha ]|', '\(*a'); +man_sgml('|[beta ]|', '\(*b'); +man_sgml('|[gamma ]|', '\(*g'); +man_sgml('|[Gamma ]|', '\(*G'); +man_sgml('|[delta ]|', '\(*d'); +man_sgml('|[Delta ]|', '\(*D'); +man_sgml('|[epsi ]|', '\(*e'); +man_sgml('|[epsis ]|', '\(*e'); +man_sgml('|[zeta ]|', '\(*z'); +man_sgml('|[eta ]|', '\(*y'); +man_sgml('|[thetas]|', '\(*h'); +man_sgml('|[Theta ]|', '\(*H'); +man_sgml('|[iota ]|', '\(*i'); +man_sgml('|[kappa ]|', '\(*k'); +man_sgml('|[lambda]|', '\(*l'); +man_sgml('|[Lambda]|', '\(*L'); +man_sgml('|[mu ]|', '\(*m'); +man_sgml('|[nu ]|', '\(*n'); +man_sgml('|[xi ]|', '\(*c'); +man_sgml('|[Xi ]|', '\(*C'); +man_sgml('|[pi ]|', '\(*p'); +man_sgml('|[Pi ]|', '\(*P'); +man_sgml('|[rho ]|', '\(*r'); +man_sgml('|[sigma ]|', '\(*s'); +man_sgml('|[Sigma ]|', '\(*S'); +man_sgml('|[tau ]|', '\(*t'); +man_sgml('|[upsi ]|', '\(*u'); +man_sgml('|[Upsi ]|', '\(*U'); +man_sgml('|[phis ]|', '\(*f'); +man_sgml('|[Phi ]|', '\(*F'); +man_sgml('|[chi ]|', '\(*x'); +man_sgml('|[psi ]|', '\(*q'); +man_sgml('|[Psi ]|', '\(*X'); +man_sgml('|[omega ]|', '\(*w'); +man_sgml('|[Omega ]|', '\(*W'); +man_sgml('|[ap ]|', '\(ap'); +man_sgml('|[equiv ]|', '\(=='); +man_sgml('|[ge ]|', '\(>='); +man_sgml('|[infin ]|', '\(if'); +man_sgml('|[isin ]|', '\(sb'); +man_sgml('|[le ]|', '\(<='); +man_sgml('|[minus ]|', '\(mi'); +man_sgml('|[ne ]|', '\(!='); +man_sgml('|[prop ]|', '\(pt'); +man_sgml('|[square]|', '\(sq'); +man_sgml('|[sub ]|', '\(sb'); +man_sgml('|[sube ]|', '\(ib'); +man_sgml('|[sup ]|', '\(sp'); +man_sgml('|[supe ]|', '\(ip'); +man_sgml('|[acute ]|', '\&\''); +man_sgml('|[breve ]|', '\(be'); +man_sgml('|[caron ]|', '\(hc'); +man_sgml('|[cedil ]|', '\(cd'); +man_sgml('|[dot ]|', '\(dt'); +man_sgml('|[macr ]|', '\(ma'); +man_sgml('|[ogon ]|', '\(og'); +man_sgml('|[ring ]|', '\(ri'); +man_sgml('|[uml ]|', '\(..'); + +sgml('sdata',sub { + my ($element, $event) = @_; + my ($file, $line) = ($event->file, $event->line); + man_output "|[", $_[0], "]|"; + warn "Warning: unrecognized SDATA '$_[0]'" + . ($file && $line ? " in $file on line $line" : "") + . ": please add definition to docbook2man-spec.pl\n"; +}); + +# +# Default handlers (uncomment these if needed). Right now, these are set +# up to gag on any unrecognised elements, sdata, processing-instructions, +# or entities. +# +# sgml('start_element',sub { die "Unknown element: " . $_[0]->name; }); +# sgml('end_element',''); + +# This is for weeding out and escaping certain characters. +# This looks like it's inefficient since it's done on every line, but +# in reality, SGMLSpm and sgmlspl parsing ESIS takes _much_ longer. + +sgml('cdata', sub +{ + if(!$write_manpages) { return; } + elsif($raw_cdata) { output $_[0]; return; } + + if($separator eq 'full') { + output "\n" unless $newline_last++; + output ".PP\n"; + $separator = ''; + } + + # Escape backslashes + $_[0] =~ s/\\/\\\\/g; + + # Escape dots and single quotes in column 1 + $_[0] =~ s/^[ \t]*\./\\\&\./; + $_[0] =~ s/^[ \t]*\'/\\\&\'/; + + + # In non-'pre'-type elements: + if(!$nocollapse_whitespace) { + # Change tabs to spaces + $_[0] =~ tr/\t / /s; + + # Do not allow indents at beginning of line + # groff chokes on that. + if($newline_last) { + $_[0] =~ s/^ //; + + # If the line is all blank, don't do anything. + if($_[0] eq '') { return; } + + $_[0] =~ s/^\./\\\&\./; + + # Argh... roff doesn't like ' for some unknown reason + $_[0] =~ s/^\'/\\\&\'/; + } + } + + $newline_last = 0; + + output $_[0]; +}); + + +# When in whitespace-collapsing mode, we disallow consecutive newlines. + +sgml('re', sub +{ + if($nocollapse_whitespace || !$newline_last) { + output "\n"; + } + + $newline_last = 1; +}); + +sgml('pi', sub {}); +sgml('entity',sub { die "Unknown external entity: " . $_[0]->name; }); +sgml('start_subdoc',sub { die "Unknown subdoc entity: " . $_[0]->name; }); +sgml('end_subdoc',sub{}); +sgml('conforming',sub{}); + +1; + diff --git a/gdp-both.dsl b/gdp-both.dsl new file mode 100644 index 0000000..2303673 --- /dev/null +++ b/gdp-both.dsl @@ -0,0 +1,1061 @@ +<!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [ +<!ENTITY % html "IGNORE"> +<![%html;[ +<!ENTITY % print "IGNORE"> +<!ENTITY docbook.dsl PUBLIC "-//Norman Walsh//DOCUMENT DocBook HTML Stylesheet//EN" CDATA dsssl> +]]> +<!ENTITY % print "INCLUDE"> +<![%print;[ +<!ENTITY docbook.dsl PUBLIC "-//Norman Walsh//DOCUMENT DocBook Print Stylesheet//EN" CDATA dsssl> +]]> +]> + +<!-- +;;####################################################################### +;;# # +;;# The GNOME Documentation Project's # +;;# Custion DocBook Stylesheet Layer # +;;# by Dave Mason dcm@redhat.com # +;;# Based on Norman Walsh's Modular Stylesheets # +;;# # +;;# This is intended as a drop-in replacement for # +;;# the cygnus-both.dsl file in DocBook Tools. # +;;# Just copy it to the location dbtools created # +;;# and rename it cygnus-both.dsl # +;;# # +;;# This is Version 1.0-4 # +;;# patched to fix RTF output (#49677) # +;;# patched to work with docbook-dsssl-1.72 # +;;# patched for ADDRESS output (#50605) # +;;# removed comment and remark # +;;# disabled use-id-as-filename # +;;# don't define %graphic-default-extension% # +;;####################################################################### +--> + +<style-sheet> + + +<style-specification id="print" use="docbook"> +<style-specification-body> + +;;========================================================================== +;; PRINT +;;========================================================================== + +;;====================================== +;;General Options +;;====================================== + +;;Do you want to print on both sides of the paper? +(define %two-side% + #t) + +;;Do you want enumerated sections? (E.g, 1.1, 1.1.1, 1.2, etc.) +(define %section-autolabel% + #f) + +;;Show URL links? If the text of the link and the URL are identical, +;;the parenthetical URL is suppressed. +(define %show-ulinks% + #t) + +;Make Ulinks footnotes to stop bleeding in the edges - this increases +;'jade --> print' time tremendously keep this in mind before +;complaining! +(define %footnote-ulinks% + #t) + +;;Tex Backend on +(define tex-backend + #t) + +;;Define Line Spacing +(define %line-spacing-factor% 1.1) + +;;Define the Paragraph Style +(define para-style + (style + font-size: %bf-size% + font-weight: 'medium + font-posture: 'upright + font-family-name: %body-font-family% + line-spacing: (* %bf-size% %line-spacing-factor%))) + +(define ($object-titles-after$) + (list (normalize "figure"))) + +;;====================================== +;;Book Options +;;====================================== + + +;;Do you want a title page for a Book? +(define %generate-book-titlepage% + #t) + +;;Do you want a separate page for the title? +(define %generate-book-titlepage-on-separate-page% + #t) + +;;Generate Book TOC? +(define %generate-book-toc% + #t) + +;;What depth should the TOC generate? +;;!Only top level of appendixes! +(define (toc-depth nd) + (if (string=? (gi nd) (normalize "book")) + 3 + (if (string=? (gi nd) (normalize "appendix")) + 0 + 1))) + +;;Do you want a TOC for the element part? +(define %generate-part-toc% + #f) + +;;Do you want the part toc on the part titlepage or separate? +(define %generate-part-toc-on-titlepage% + #t) + +;;Generate Part Title Page? +(define %generate-part-titlepage% + #f) + +;;Do you want the Part intro on the part title page? +(define %generate-partintro-on-titlepage% + #t) + +;;What elements should have a LOT? +(define ($generate-book-lot-list$) + (list (normalize "equation"))) + +;;Do you want chapters enumerated? +(define %chapter-autolabel% + #t) + +;;Do you want Chapter's and Appendix's +;;to have automatic labels? +(define %chap-app-running-head-autolabel% + #t) + + +;;====================================== +;;Article Options +;;====================================== + +;;Do you want a title page for an Article? +(define %generate-article-titlepage% + #t) + +;;Generate Article TOC? +(define %generate-article-toc% + #t) + +;;Do you want a separate page for the title? +(define %generate-article-titlepage-on-separate-page% + #t) + +;;Do you want the article toc on the titlepage or separate? +(define %generate-article-toc-on-titlepage% + #t) + +;;Do you want to start new page numbers with each article? +(define %article-page-number-restart% + #f) + +;;Titlepage Separate? +(define (chunk-skip-first-element-list) + '()) + +;;Titlepage Not Separate +;(define (chunk-skip-first-element-list) +; (list (normalize "sect1") +; (normalize "section"))) + +;;====================================== +;;Columns +;;====================================== + +;;How many columns do you want? +(define %page-n-columns% + 1) + +;;How much space between columns? +(define %page-column-sep% + 0.2in) + +;;How many Columns on the titlepage? +(define %titlepage-n-columns% + 1) + +;;Balance columns? +(define %page-balance-colums% +#t) + +;;====================================== +;;Fonts +;;====================================== + +;;Defines the general size of the text in the document. normal(10), +;;presbyopic(12), and large-type(24). +(define %visual-acuity% + "normal") + +;;What font would you like for titles? +(define %title-font-family% + "Helvetica") + +;;What font would you like for the body? +(define %body-font-family% + "Palatino") + +;;What font would you like for mono-seq? +(define %mono-font-family% + "Courier New") + +;;If the base fontsize is 10pt, and '%hsize-bump-factor%' is +;; 1.2, hsize 1 is 12pt, hsize 2 is 14.4pt, hsize 3 is 17.28pt, etc +(define %hsize-bump-factor% + 1.1) + +;;What size do you want the body fonts? +(define %bf-size% + (case %visual-acuity% + (("tiny") 8pt) + (("normal") 10pt) + (("presbyopic") 12pt) + (("large-type") 24pt))) + +(define-unit em %bf-size%) + +;;====================================== +;;Margins +;;====================================== + +(define %left-right-margin% 6pi) + +;;How much indentation for the body? +(define %body-start-indent% + 4pi) + +;;How big is the left margin? (relative to physical page) +(define %left-margin% + 8pi) ;white-paper-column + +;;How big is the right margin? (relative to physical page) +(define %right-margin% + 8pi) ;white-paper-column + +;;How big do you want the margin at the top? +(define %top-margin% +(if (equal? %visual-acuity% "large-type") + 7.5pi + 6pi)) + +;;How big do you want the margin at the bottom? +(define %bottom-margin% + (if (equal? %visual-acuity% "large-type") + 7.5pi + 5pi)) + +;;Define the text width. (Change the elements in the formula rather +;;than the formula itself) +;(define %text-width% (- %page-width% (* %left-right-margin% 2))) +(define %text-width% (- %page-width% (+ %left-margin% %right-margin%))) + +;;Define the body width. (Change the elements in the formula rather +;;than the formula itself) +(define %body-width% + (- %text-width% %body-start-indent%)) + +;;Define distance between paragraphs +(define %para-sep% + (/ %bf-size% 2.0)) + +;;Define distance between block elements (figures, tables, etc.). +(define %block-sep% + (* %para-sep% 2.0)) + +;;Indent block elements? +(define %block-start-indent% + 0pt) +;0pt + +;;====================================== +;;Admon Graphics +;;====================================== + +;;Do you want admon graohics on? +(define %admon-graphics% + #f) + +;;Where are the admon graphics? +(define %admon-graphics-path% + "../images/") + +;;====================================== +;;Quadding +;;====================================== + +;;What quadding do you want by default; start, center, justify, or end? +(define %default-quadding% + 'justify) + +;;What quadding for component titles(Chapter, Appendix, etc)? +(define %component-title-quadding% + 'start) + +;;What quadding for section titles? +(define %section-title-quadding% + 'start) + +;;What quadding for section sub-titles? +(define %section-subtitle-quadding% + 'start) + +;;What quadding for article title? +(define %article-title-quadding% + 'center) + +;;What quadding for article sub-titles? +(define %article-subtitle-quadding% + 'center) + +;;What quadding for division subtitles? +(define %division-subtitle-quadding% + 'start) + +;;What quadding for component subtitles? +(define %component-subtitle-quadding% + 'start) + + + + +;;====================================== +;;Paper Options +;;====================================== + +;;What size paper do you need? A4, USletter, USlandscape, or RedHat? +(define %paper-type% + "USletter") + +;;Now define those paper types' width +(define %page-width% + (case %paper-type% + (("A4") 210mm) + (("USletter") 8.5in) + (("USlandscape") 11in))) + +;;Now define those paper types' height +(define %page-height% + (case %paper-type% + (("A4") 297mm) + (("USletter") 11in) + (("USlandscape") 8.5in))) + +;;====================================== +;;Functions +;;====================================== + +(define (OLSTEP) + (case + (modulo (length (hierarchical-number-recursive "ORDEREDLIST")) 4) + ((1) 1.2em) + ((2) 1.2em) + ((3) 1.6em) + ((0) 1.4em))) + +(define (ILSTEP) 1.0em) + +(define (PROCSTEP ilvl) + (if (> ilvl 1) 1.8em 1.4em)) + +(define (PROCWID ilvl) + (if (> ilvl 1) 1.8em 1.4em)) + + +(define ($comptitle$) + (make paragraph + font-family-name: %title-font-family% + font-weight: 'bold + font-size: (HSIZE 2) + line-spacing: (* (HSIZE 2) %line-spacing-factor%) + space-before: (* (HSIZE 2) %head-before-factor%) + space-after: (* (HSIZE 2) %head-after-factor%) + start-indent: 0pt + first-line-start-indent: 0pt + quadding: 'start + keep-with-next?: #t + (process-children-trim))) + +;;Callouts are confusing in Postscript... fix them. +(define %callout-fancy-bug% + #f) + + +;;By default perils are centered and dropped into a box with a really +;;big border - I have simply decreased the border thickness - +;;unfortunately it takes all this to do it - sigh. +(define ($peril$) + (let* ((title (select-elements + (children (current-node)) (normalize "title"))) + (has-title (not (node-list-empty? title))) + (adm-title (if has-title + (make sequence + (with-mode title-sosofo-mode + (process-node-list (node-list-first title)))) + (literal + (gentext-element-name + (current-node))))) + (hs (HSIZE 2))) + (if %admon-graphics% + ($graphical-admonition$) + (make display-group + space-before: %block-sep% + space-after: %block-sep% + font-family-name: %admon-font-family% + font-size: (- %bf-size% 1pt) + font-weight: 'medium + font-posture: 'upright + line-spacing: (* (- %bf-size% 1pt) %line-spacing-factor%) + (make box + display?: #t + box-type: 'border + line-thickness: .5pt + start-indent: (+ (inherited-start-indent) (* 2 (ILSTEP)) 2pt) + end-indent: (inherited-end-indent) + (make paragraph + space-before: %para-sep% + space-after: %para-sep% + start-indent: 1em + end-indent: 1em + font-family-name: %title-font-family% + font-weight: 'bold + font-size: hs + line-spacing: (* hs %line-spacing-factor%) + quadding: 'center + keep-with-next?: #t + adm-title) + (process-children)))))) + + +;;====================================== +;;Non-printing Elements +;;====================================== +(element TITLEABBREV (empty-sosofo)) +(element SUBTITLE (empty-sosofo)) +(element SETINFO (empty-sosofo)) +(element BOOKINFO (empty-sosofo)) +(element BIBLIOENTRY (empty-sosofo)) +(element BIBLIOMISC (empty-sosofo)) +(element BOOKBIBLIO (empty-sosofo)) +(element SERIESINFO (empty-sosofo)) +(element DOCINFO (empty-sosofo)) +(element ARTHEADER (empty-sosofo)) +;;(element ADDRESS (empty-sosofo)) + +;;Show comment element? +(define %show-comments% + #t) + +;;====================================== +;;Formalpara titles +;;====================================== + + +;;Change the way Formal Paragraph titles are displayed. The commented +;;out section will run the titles in the paragraphs. +(element (formalpara title) + ;(make sequence + ;font-weight: 'bold + ;($runinhead$)) + ($lowtitle$ 5 7)) + +;;====================================== +;;Inlines +;;====================================== + +(element application ($mono-seq$)) +(element command ($bold-seq$)) +(element filename ($mono-seq$)) +(element function ($mono-seq$)) +(element guibutton ($bold-seq$)) +(element guiicon ($bold-seq$)) +(element guilabel ($italic-seq$)) +(element guimenu ($bold-seq$)) +(element guimenuitem ($bold-seq$)) +(element hardware ($bold-mono-seq$)) +(element keycap ($bold-seq$)) +(element literal ($mono-seq$)) +(element parameter ($italic-mono-seq$)) +(element prompt ($mono-seq$)) +(element symbol ($charseq$)) +(element emphasis ($italic-seq$)) + +</style-specification-body> +</style-specification> + + +<!-- +;;=========================================================================== +;; HTML +;;=========================================================================== +--> + +<style-specification id="html" use="docbook"> +<style-specification-body> + +;; this is necessary because right now jadetex does not understand +;; symbolic entities, whereas things work well with numeric entities. +(declare-characteristic preserve-sdata? + "UNREGISTERED::James Clark//Characteristic::preserve-sdata?" + #f) + + +;;========================= +;;Header HTML 4.0.1 +;;========================= + +(define %html-pubid% "-//W3C//DTD HTML 4.01//EN") + +;;========================= +;;Common Stuff +;;========================= + +;;Should there be a link to the legalnotice? +(define %generate-legalnotice-link% + #t) + +;;What graphics extensions allowed? +(define %graphic-extensions% +'("gif" "png" "jpg" "jpeg" "tif" "tiff" "eps" "epsf" )) + +;;What is the default extension for images? +(define %graphic-default-extension% "png") + +;;Use element ids as filenames? +(define %use-id-as-filename% + #f) + + +;;========================= +;;Book Stuff +;;========================= + +;;Do you want a TOC for Books? +(define %generate-book-toc% + #t) + +;;What depth should the TOC generate? +;;!Only top level of appendixes! +(define (toc-depth nd) + (if (string=? (gi nd) (normalize "book")) + 3 + (if (string=? (gi nd) (normalize "appendix")) + 0 + 1))) + +;;What elements should have an LOT? +(define ($generate-book-lot-list$) + (list (normalize "equation"))) + +;;Do you want a title page for your Book? +(define %generate-book-titlepage% +#t) + +;;========================= +;;Part Stuff +;;========================= + +;;Should parts have TOCs? +(define %generate-part-toc% + #t) + +;;Should part TOCs be on their titlepages? +(define %generate-part-toc-on-titlepage% + #t) + +;;Do you want a title page for your part? +(define %generate-part-titlepage% + #t) + +;;Should the Part intro be on the part title page? +(define %generate-partintro-on-titlepage% + #t) + +(define %para-autolabel% + #t) + +;;======================== +;;Chapter Stuff +;;======================= + +;;No TOCs in Chapters +(define $generate-chapter-toc$ + (lambda () + #f)) + +;;========================= +;;Navigation +;;========================= + +;;Should there be navigation at top? +(define %header-navigation% + #t) + +;;Should there be navigation at bottom? +(define %footer-navigation% + #t) + +;;Use tables to create the navigation? +(define %gentext-nav-use-tables% + #t) + +;;If tables are used for navigation, +;;how wide should they be? +(define %gentext-nav-tblwidth% +"100%") + +;;Add arrows to navigation (comment these +;;out if you want admon graphics here) +(define (gentext-en-nav-prev prev) + (make sequence (literal "<<< Previous"))) + +;;Add arrows to navigation (comment these +;;out if you want admon graphics here) +(define (gentext-en-nav-next next) + (make sequence (literal "Next >>>"))) + + +;;========================= +;;Tables and Lists +;;========================= + +;;Should Variable lists be tables? +(define %always-format-variablelist-as-table% + #f) + +;;What is the length of the 'Term' in a variablelist? +(define %default-variablelist-termlength% + 20) + +;;When true | If the terms are shorter than +;;the termlength above then the variablelist +;;will be formatted as a table. +(define %may-format-variablelist-as-table% +#f) + +;;This overrides the tgroup definition +;;(copied from 1.20, dbtable.dsl). +;;It changes the table background color, +;;cell spacing and cell padding. +;;This is based on gtk-doc additions - thanks! + +(element tgroup + (let* ((wrapper (parent (current-node))) + (frameattr (attribute-string (normalize "frame") wrapper)) + (pgwide (attribute-string (normalize "pgwide") wrapper)) + (footnotes (select-elements (descendants (current-node)) + (normalize "footnote"))) + (border (if (equal? frameattr (normalize "none")) + '(("BORDER" "0")) + '(("BORDER" "1")))) + (bgcolor '(("BGCOLOR" "#E0E0E0"))) + (width (if (equal? pgwide "1") + (list (list "WIDTH" ($table-width$))) + '())) + (head (select-elements (children (current-node)) (normalize "thead"))) + (body (select-elements (children (current-node)) (normalize "tbody"))) + (feet (select-elements (children (current-node)) (normalize "tfoot")))) + (make element gi: "TABLE" + attributes: (append + border + width + bgcolor + '(("CELLSPACING" "0")) + '(("CELLPADDING" "4")) + (if %cals-table-class% + (list (list "CLASS" %cals-table-class%)) + '())) + (process-node-list head) + (process-node-list body) + (process-node-list feet) + (make-table-endnotes)))) + +;;=================== +;; Admon Graphics +;;=================== + +;;Should Admon Graphics be used? +(define %admon-graphics% + #t) + +;;Where are those admon graphics? +(define %admon-graphics-path% + "./stylesheet-images/") + +;;Given an admonition node, returns the +;;name of the graphic that should +;;be used for that admonition. +;;Define admon graphics usage +;;NOTE these will change to pngs +;;soon in the GDP when Tigert gets +;;the time to make special ones for us! +(define ($admon-graphic$ #!optional (nd (current-node))) + (cond ((equal? (gi nd) (normalize "tip")) + (string-append %admon-graphics-path% "tip.gif")) + ((equal? (gi nd) (normalize "note")) + (string-append %admon-graphics-path% "note.gif")) + ((equal? (gi nd) (normalize "important")) + (string-append %admon-graphics-path% "important.gif")) + ((equal? (gi nd) (normalize "caution")) + (string-append %admon-graphics-path% "caution.gif")) + ((equal? (gi nd) (normalize "warning")) + (string-append %admon-graphics-path% "warning.gif")) + (else (error (string-append (gi nd) " is not an admonition."))))) + +;;Given an admonition node, returns +;;the width of the graphic that will +;;be used for that admonition. +(define ($admon-graphic-width$ #!optional (nd (current-node))) + "25") + +;;========================= +;;Labels +;;========================= + +;;Enumerate Chapters? +(define %chapter-autolabel% + #f) + +;;Enumerate Sections? +(define %section-autolabel% + #f) + +;;========================= +;; HTML Attributes +;;========================= + +;;What attributes should be hung off +;;of 'body'? +(define %body-attr% + (list + (list "BGCOLOR" "#FFFFFF") + (list "TEXT" "#000000") + (list "LINK" "#0000FF") + (list "VLINK" "#840084") + (list "ALINK" "#0000FF"))) + +;;Default extension for filenames? +(define %html-ext% + ".html") + +;;Use a CSS stylesheet? +;;Which one? Should work on +;;this one soon +;(define %stylesheet% +; "./gnome.css") + +;;Use it +;(define %stylesheet-type% +;"text/css") + + +;;======================== +;;Title Pages for Books +;;======================= + +(define (book-titlepage-recto-elements) + (list (normalize "title") + (normalize "subtitle") + (normalize "corpauthor") + (normalize "authorgroup") + (normalize "author") + (normalize "orgname") + (normalize "graphic") + (normalize "copyright") + (normalize "legalnotice") + (normalize "releaseinfo") + (normalize "publisher") + (normalize "isbn"))) + +;;======================== +;;Title Pages for Articles +;;======================== + +;;Should Articles have a TOC? +(define %generate-article-toc% + #t) + +;;Which elements should appear +;;on title page? +(define (article-titlepage-recto-elements) + (list (normalize "title") + (normalize "subtitle") + (normalize "authorgroup") + (normalize "copyright") + (normalize "legalnotice") + (normalize "abstract"))) + +;;How should elements on title page look? +(mode article-titlepage-recto-mode + +;;Author name is too big - change it! + (element author + (let ((author-name (author-string)) + (author-affil (select-elements (children (current-node)) + (normalize "affiliation")))) + (make sequence + (make element gi: "H4" + attributes: (list (list "CLASS" (gi))) + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (literal author-name))) + (process-node-list author-affil)))) + +;;Address? + (element address + (make sequence + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (process-children)))) + +;;Get rid of spam-producing "mailto" links +;;and get rid of email indentation + (element email + (make sequence + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (process-children)))) + +;;Point Abstract to custom table function +;;(See $dcm-abstract-object$ below. For default +;;use $semiformal-object$ + (element abstract + (make element gi: "DIV" + ($dcm-abstract-object$))) + + (element (abstract title) (empty-sosofo)) + +;;subtitle sizing +(element subtitle + (make element gi: "H4" + attributes: (list (list "CLASS" (gi))) + (process-children-trim)))) + +;;================= +;; INLINES +;;================= + +;Define my own series of fonts for various elements +(element application ($mono-seq$)) +(element command ($bold-seq$)) +(element filename ($mono-seq$)) +(element function ($mono-seq$)) +(element guibutton ($bold-seq$)) +(element guiicon ($bold-seq$)) +(element guilabel ($bold-mono-seq$)) +(element guimenu ($bold-seq$)) +(element guimenuitem ($bold-seq$)) +(element guisubmenu ($bold-seq$)) +(element hardware ($bold-mono-seq$)) +(element keycap ($bold-seq$)) +(element literal ($mono-seq$)) +(element parameter ($italic-mono-seq$)) +(element prompt ($mono-seq$)) +(element symbol ($charseq$)) +(element emphasis ($italic-seq$)) + +;;Show comment element? +(define %show-comments% + #t) + +;;==================== +;; General Formatting +;;==================== + +;;Formal Paras are ugly by default! +;;Make the title run in - otherwise +;;you should use a sect! +(element formalpara + (make element gi: "DIV" + attributes: (list + (list "CLASS" (gi))) + (make element gi: "P" + (process-children)))) + +;;This is the old one +;(element (formalpara title) +;($lowtitle$ 5)) + +;;This is the new one +(element (formalpara title) + (make element gi: "B" + ($runinhead$))) + +;;Make captions come after objects in the list +(define ($object-titles-after$) + (list (normalize "figure"))) + + +;; Handle qanda labelling with Q: A: +(define (qanda-defaultlabel) + (normalize "qanda")) + +;;From FreeBSD Sheets (Thanks!) Display Q and A in bigger bolder fonts + +(element question + (let* ((chlist (children (current-node))) + (firstch (node-list-first chlist)) + (restch (node-list-rest chlist))) + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (make element gi: "P" + (make element gi: "BIG" + (make element gi: "A" + attributes: (list + (list "NAME" (element-id))) + (empty-sosofo)) + (make element gi: "B" + (literal (question-answer-label + (current-node)) " ") + (process-node-list (children firstch))))) + (process-node-list restch)))) + +;;Literal Elements + +;;Indent Literal layouts? +(define %indent-literallayout-lines% + #f) + +;;Indent Programlistings? +(define %indent-programlisting-lines% + #f) + +;;Number lines in Programlistings? +(define %number-programlisting-lines% + #f) + +;;Should verbatim items be 'shaded' with a table? +(define %shade-verbatim% + #t) + +;;Define shade-verbatim attributes +(define ($shade-verbatim-attr$) + (list + (list "BORDER" "0") + (list "BGCOLOR" "#E0E0E0") + (list "WIDTH" ($table-width$)))) + +;;=================== +;; Entities +;;=================== + +;;Netscape doesn't handle trademark +;;entity right at all!! Get rid of it. +;;Make a TM in a superscipt font. +(element trademark + (make sequence + (process-children) + (make element gi: "sup" + (literal "TM")))) + + +;;=================== +;; New Definitions +;;================== + +(define ($dcm-abstract-object$) + (make element gi: "TABLE" + attributes: '(("BORDER" "0") + ("BGCOLOR" "#E0E0E0") + ("WIDTH" "50%") + ("CELLSPACING" "0") + ("CELLPADDING" "0") + ("ALIGN" "CENTER")) + (make element gi: "TR" + (make element gi: "TD" + attributes: '(("VALIGN" "TOP")) + (make element gi: "B" + (literal "Abstract")))) + (make element gi: "TR" + (make element gi: "TD" + attributes: '(("VALIGN" "TOP")) + (process-children))))) + +;;Redefine Titlepage Separator on Articles + +(define (article-titlepage-separator side) + (make empty-element gi: "HR" + attributes: '(("WIDTH" "75%") + ("ALIGN" "CENTER") + ("COLOR" "#000000") + ("SIZE" "1")))) + + + + +(define (chunk-element-list) + (list (normalize "preface") + (normalize "chapter") + (normalize "appendix") + (normalize "article") + (normalize "glossary") + (normalize "bibliography") + (normalize "index") + (normalize "colophon") + (normalize "setindex") + (normalize "reference") + (normalize "refentry") + (normalize "part") + (normalize "sect1") + (normalize "section") + (normalize "book") ;; just in case nothing else matches... + (normalize "set") ;; sets are definitely chunks... + )) + +;;Do you want Callouts to be graphics? +(define %callout-graphics% +#f) + + +;;Make Callout graphics PNGs +(define %callout-graphics-path% + "./imagelib/callouts/") + + ;; Redefine $callout-bug$ to support the %callout-graphic-ext% + ;; variable. + (define ($callout-bug$ conumber) + (let ((number (if conumber (format-number conumber "1") "0"))) + (if conumber + (if %callout-graphics% + (if (<= conumber %callout-graphics-number-limit%) + (make empty-element gi: "IMG" + attributes: (list (list "SRC" + (root-rel-path + (string-append + %callout-graphics-path% + number + %callout-graphics-ext%))) + (list "HSPACE" "0") + (list "VSPACE" "0") + (list "BORDER" "0") + (list "ALT" + (string-append + "(" number ")")))) + (make element gi: "B" + (literal "(" (format-number conumber "1") ")"))) + (make element gi: "B" + (literal "(" (format-number conumber "1") ")"))) + (make element gi: "B" + (literal "(??)"))))) + +</style-specification-body> +</style-specification> + +<external-specification id="docbook" document="docbook.dsl"> + +</style-sheet> @@ -0,0 +1 @@ +6b41b18c365c01f225bc417cf632d81c docbook-utils-0.6.14.tar.gz |