diff options
author | Peter Eisentraut | 2004-01-15 23:51:32 +0000 |
---|---|---|
committer | Peter Eisentraut | 2004-01-15 23:51:32 +0000 |
commit | e1d47fb680a883c5b1737353b8e6dfd255ae67f0 (patch) | |
tree | 351369501e640c6927d0c7af288eb4f6396ca936 | |
parent | febd72624290869cffdf079e2393d6bb960e6034 (diff) |
Some refinement of XSLT processing: The result now looks just about as good
as the result of the SGML-based tool chain.
-rw-r--r-- | doc/src/sgml/Makefile | 7 | ||||
-rw-r--r-- | doc/src/sgml/stylesheet.xsl | 62 |
2 files changed, 55 insertions, 14 deletions
diff --git a/doc/src/sgml/Makefile b/doc/src/sgml/Makefile index 913cec6511..1f66737ef6 100644 --- a/doc/src/sgml/Makefile +++ b/doc/src/sgml/Makefile @@ -205,10 +205,13 @@ OSX = osx # (may be called sx or sgml2xml on some systems) XSLTPROC = xsltproc postgres.xml: postgres.sgml $(GENERATED_SGML) - $(OSX) -x lower $< >$@ + $(OSX) -x lower $< | \ + sed -e 's/\[\(lt\|gt\|amp\|nbsp\|copy\|quot\|ouml\|uuml\|egrave\) *\]/\&\1;/g' \ + -e '1a\' -e '<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">' \ + >$@ testxml: stylesheet.xsl postgres.xml - $(XSLTPROC) $^ + $(XSLTPROC) $(XSLTPROCFLAGS) --stringparam pg.version '$(VERSION)' $^ ## diff --git a/doc/src/sgml/stylesheet.xsl b/doc/src/sgml/stylesheet.xsl index 3301afd617..0a1af776e5 100644 --- a/doc/src/sgml/stylesheet.xsl +++ b/doc/src/sgml/stylesheet.xsl @@ -4,30 +4,48 @@ xmlns="http://www.w3.org/TR/xhtml1/transitional" exclude-result-prefixes="#default"> -<xsl:import href="http://docbook.sourceforge.net/release/xsl/snapshot/html/chunk.xsl"/> +<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/chunk.xsl"/> <!-- Parameters --> -<xsl:param name="autotoc.label.separator" select="'. '"/> +<xsl:param name="pg.fast" select="'0'"/> + +<!-- +<xsl:param name="draft.mode"> + <xsl:choose> + <xsl:when test="contains($pg.version, 'devel')">yes</xsl:when> + <xsl:otherwise>no</xsl:otherwise> + </xsl:choose> +</xsl:param> +--> + +<xsl:param name="show.comments"> + <xsl:choose> + <xsl:when test="contains($pg.version, 'devel')">1</xsl:when> + <xsl:otherwise>0</xsl:otherwise> + </xsl:choose> +</xsl:param> + + <xsl:param name="callout.graphics" select="'0'"></xsl:param> -<xsl:param name="toc.section.depth">3</xsl:param> +<xsl:param name="toc.section.depth">2</xsl:param> <xsl:param name="linenumbering.extension" select="'0'"></xsl:param> -<xsl:param name="preface.autolabel" select="1"></xsl:param> -<xsl:param name="section.autolabel" select="1"></xsl:param> -<xsl:param name="section.label.includes.component.label" select="1"></xsl:param> +<xsl:param name="generate.index" select="1 - $pg.fast"></xsl:param> +<xsl:param name="preface.autolabel" select="1 - $pg.fast"></xsl:param> +<xsl:param name="section.autolabel" select="1 - $pg.fast"></xsl:param> +<xsl:param name="section.label.includes.component.label" select="1 - $pg.fast"></xsl:param> <xsl:param name="html.stylesheet" select="'stylesheet.css'"></xsl:param> <xsl:param name="use.id.as.filename" select="'1'"></xsl:param> <xsl:param name="make.valid.html" select="1"></xsl:param> -<xsl:param name="generate.id.attributes" select="0"></xsl:param> <!-- ? --> +<xsl:param name="generate.id.attributes" select="1"></xsl:param> <xsl:param name="generate.legalnotice.link" select="1"></xsl:param> +<xsl:param name="refentry.xref.manvolnum" select="0"/> <xsl:param name="link.mailto.url">[email protected]</xsl:param> <xsl:param name="formal.procedures" select="0"></xsl:param> <xsl:param name="punct.honorific" select="''"></xsl:param> -<xsl:param name="chunker.output.doctype-public" select="''"/> <!-- ? --> -<xsl:param name="chunker.output.indent" select="'no'"/> <!-- ? --> -<xsl:param name="chunker.output.omit-xml-declaration" select="'no'"/> -<xsl:param name="html.extra.head.links" select="0"></xsl:param> -<xsl:param name="chunk.quietly" select="0"></xsl:param> +<xsl:param name="chunker.output.indent" select="'yes'"/> +<xsl:param name="chunk.quietly" select="1"></xsl:param> + <!-- Change display of some elements --> @@ -67,4 +85,24 @@ <xsl:call-template name="inline.boldseq"/> </xsl:template> + +<!-- Special support for Tcl synopses --> + +<xsl:template match="optional[@role='tcl']"> + ?<xsl:call-template name="inline.charseq"/>? +</xsl:template> + + +<!-- + Format multiple terms in varlistentry vertically, instead + of comma-separated. + --> + +<xsl:template match="varlistentry/term[position()!=last()]"> + <span class="term"> + <xsl:call-template name="anchor"/> + <xsl:apply-templates/> + </span><br/> +</xsl:template> + </xsl:stylesheet> |