This adds support for the location used by Debian/Ubuntu. --- docbook/manpages.in | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++ docbook/manpages.xsl | 55 -------------------------------------------------- docbook/sgml2html | 15 ++++++++++++++ docbook/sgml2man | 16 ++++++++++++++- 4 files changed, 85 insertions(+), 56 deletions(-) create mode 100644 docbook/manpages.in delete mode 100644 docbook/manpages.xsl
diff --git a/docbook/manpages.in b/docbook/manpages.in new file mode 100644 index 0000000..3d378d4 --- /dev/null +++ b/docbook/manpages.in @@ -0,0 +1,55 @@ +<?xml version='1.0'?> +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + +<xsl:include href="/usr/share/sgml/docbook/xsl-stylesheets/xhtml/onechunk.xsl"/> + +<xsl:param name="html.stylesheet" select="'style.css'"/> +<xsl:param name="admon.graphics" select="0"/> + +<xsl:param name="use.id.as.filename" select="1"/> + +<xsl:param name="funcsynopsis.style">ansi</xsl:param> + +<xsl:param name="table.borders.with.css" select="1" /> + +<xsl:param name="default.table.frame" select="'collapse'" /> +<xsl:param name="table.cell.border.style" select="''" /> +<xsl:param name="table.cell.border.thickness" select="''" /> +<xsl:param name="table.cell.border.color" select="''" /> +<xsl:param name="emphasis.propagates.style" select="1" /> +<xsl:param name="para.propagates.style" select="1" /> +<xsl:param name="entry.propagates.style" select="1" /> + +<xsl:param name="part.autolabel" select="0" /> +<xsl:param name="section.autolabel" select="0" /> +<xsl:param name="chapter.autolabel" select="0" /> + +<xsl:template name="user.head.content"> + + <link rel='stylesheet' type='text/css' href='manpage.css' /> + <meta name="MSSmartTagsPreventParsing" content="TRUE" /> + <link rel="icon" href="icon.gif" type="image/gif" /> + <xsl:comment> + +Copyright 1998 - 2009 Double Precision, Inc. See COPYING for distribution +information. + +</xsl:comment> +</xsl:template> + +<!-- Bug fix 1.76.1 --> +<xsl:template match="funcdef/function" mode="ansi-tabular"> + <xsl:choose> + <xsl:when test="$funcsynopsis.decoration != 0"> + <strong xmlns="http://www.w3.org/1999/xhtml" + xmlns:xslo="http://www.w3.org/1999/XSL/Transform"><xsl:apply-templates mode="ansi-nontabular"/></strong> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates mode="kr-tabular"/> + </xsl:otherwise> + </xsl:choose> +</xsl:template> + +</xsl:stylesheet> + diff --git a/docbook/manpages.xsl b/docbook/manpages.xsl deleted file mode 100644 index 3d378d4..0000000 --- a/docbook/manpages.xsl +++ /dev/null @@ -1,55 +0,0 @@ -<?xml version='1.0'?> -<xsl:stylesheet - xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> - -<xsl:include href="/usr/share/sgml/docbook/xsl-stylesheets/xhtml/onechunk.xsl"/> - -<xsl:param name="html.stylesheet" select="'style.css'"/> -<xsl:param name="admon.graphics" select="0"/> - -<xsl:param name="use.id.as.filename" select="1"/> - -<xsl:param name="funcsynopsis.style">ansi</xsl:param> - -<xsl:param name="table.borders.with.css" select="1" /> - -<xsl:param name="default.table.frame" select="'collapse'" /> -<xsl:param name="table.cell.border.style" select="''" /> -<xsl:param name="table.cell.border.thickness" select="''" /> -<xsl:param name="table.cell.border.color" select="''" /> -<xsl:param name="emphasis.propagates.style" select="1" /> -<xsl:param name="para.propagates.style" select="1" /> -<xsl:param name="entry.propagates.style" select="1" /> - -<xsl:param name="part.autolabel" select="0" /> -<xsl:param name="section.autolabel" select="0" /> -<xsl:param name="chapter.autolabel" select="0" /> - -<xsl:template name="user.head.content"> - - <link rel='stylesheet' type='text/css' href='manpage.css' /> - <meta name="MSSmartTagsPreventParsing" content="TRUE" /> - <link rel="icon" href="icon.gif" type="image/gif" /> - <xsl:comment> - -Copyright 1998 - 2009 Double Precision, Inc. See COPYING for distribution -information. - -</xsl:comment> -</xsl:template> - -<!-- Bug fix 1.76.1 --> -<xsl:template match="funcdef/function" mode="ansi-tabular"> - <xsl:choose> - <xsl:when test="$funcsynopsis.decoration != 0"> - <strong xmlns="http://www.w3.org/1999/xhtml" - xmlns:xslo="http://www.w3.org/1999/XSL/Transform"><xsl:apply-templates mode="ansi-nontabular"/></strong> - </xsl:when> - <xsl:otherwise> - <xsl:apply-templates mode="kr-tabular"/> - </xsl:otherwise> - </xsl:choose> -</xsl:template> - -</xsl:stylesheet> - diff --git a/docbook/sgml2html b/docbook/sgml2html index 6040700..73da461 100755 --- a/docbook/sgml2html +++ b/docbook/sgml2html @@ -14,6 +14,21 @@ fi rm -rf $dstfile.tmp mkdir $dstfile.tmp + +ONECHUNK="" +# sgml/docbook/xsl-stylesheets used by Fedora, xml/docbook/stylesheet by Debian/Ubuntu +for xslfile in /usr/share/sgml/docbook/xsl-stylesheets/xhtml/onechunk.xsl /usr/share/xml/docbook/stylesheet/docbook-xsl/xhtml/onechunk.xsl; do + if [ -f "$xslfile" ]; then + ONECHUNK="$xslfile" + break + fi +done +if [ -z "$ONECHUNK" ]; then + echo >&2 onechunk.xsl stylesheet not found. Please edit docbook/sgml2html + exit 1 +fi + +sed 's|^\(<xsl:include href="\)[^"]*/onechunk.xsl\("/>\)|'"\1$ONECHUNK\2|" `dirname $0`/manpages.in > `dirname $0`/manpages.xsl xsltproc -o $dstfile.tmp/ `dirname $0`/manpages.xsl $srcfile || exit 1 xsltproc `dirname $0`/fixhtml.xsl $dstfile.tmp/* >$dstfile.tmp2 || exit 1 rm -rf $dstfile.tmp diff --git a/docbook/sgml2man b/docbook/sgml2man index a7f71e2..fef7719 100755 --- a/docbook/sgml2man +++ b/docbook/sgml2man @@ -14,7 +14,21 @@ fi rm -rf $dstfile.tmpdir mkdir -p $dstfile.tmpdir -xsltproc --nonet -o $dstfile.tmpdir/ /usr/share/sgml/docbook/xsl-stylesheets/manpages/docbook.xsl $srcfile + +DOCBOOK_XSL="" +# sgml/docbook/xsl-stylesheets used by Fedora, xml/docbook/stylesheet by Debian/Ubuntu +for xslfile in /usr/share/sgml/docbook/xsl-stylesheets/manpages/docbook.xsl /usr/share/xml/docbook/stylesheet/docbook-xsl/manpages/docbook.xsl; do + if [ -f "$xslfile" ]; then + DOCBOOK_XSL="$xslfile" + break + fi +done +if [ -z "$DOCBOOK_XSL" ]; then + echo >&2 docbook.xsl stylesheet not found. Please edit docbook/sgml2man + exit 1 +fi + +xsltproc --nonet -o $dstfile.tmpdir/ "$DOCBOOK_XSL" $srcfile for f in $dstfile.tmpdir/* do -- 1.7.10.4 ------------------------------------------------------------------------------ Slashdot TV. Video for Nerds. Stuff that matters. http://tv.slashdot.org/ _______________________________________________ courier-users mailing list courier-users@lists.sourceforge.net Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users