Skip to content

Commit b897441

Browse files
committed
Some refinement of XSLT processing: The result now looks just about as good
as the result of the SGML-based tool chain.
1 parent dfdd59e commit b897441

File tree

2 files changed

+56
-15
lines changed

2 files changed

+56
-15
lines changed

doc/src/sgml/Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# PostgreSQL documentation makefile
44
#
5-
# $PostgreSQL: pgsql/doc/src/sgml/Makefile,v 1.63 2004/01/13 18:45:19 petere Exp $
5+
# $PostgreSQL: pgsql/doc/src/sgml/Makefile,v 1.64 2004/01/15 23:51:32 petere Exp $
66
#
77
#----------------------------------------------------------------------------
88

@@ -205,10 +205,13 @@ OSX = osx # (may be called sx or sgml2xml on some systems)
205205
XSLTPROC = xsltproc
206206

207207
postgres.xml: postgres.sgml $(GENERATED_SGML)
208-
$(OSX) -x lower $< >$@
208+
$(OSX) -x lower $< | \
209+
sed -e 's/\[\(lt\|gt\|amp\|nbsp\|copy\|quot\|ouml\|uuml\|egrave\) *\]/\&\1;/g' \
210+
-e '1a\' -e '<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">' \
211+
>$@
209212

210213
testxml: stylesheet.xsl postgres.xml
211-
$(XSLTPROC) $^
214+
$(XSLTPROC) $(XSLTPROCFLAGS) --stringparam pg.version '$(VERSION)' $^
212215

213216

214217
##

doc/src/sgml/stylesheet.xsl

Lines changed: 50 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,48 @@
44
xmlns="http://www.w3.org/TR/xhtml1/transitional"
55
exclude-result-prefixes="#default">
66

7-
<xsl:import href="http://docbook.sourceforge.net/release/xsl/snapshot/html/chunk.xsl"/>
7+
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/chunk.xsl"/>
88

99
<!-- Parameters -->
1010

11-
<xsl:param name="autotoc.label.separator" select="'. '"/>
11+
<xsl:param name="pg.fast" select="'0'"/>
12+
13+
<!--
14+
<xsl:param name="draft.mode">
15+
<xsl:choose>
16+
<xsl:when test="contains($pg.version, 'devel')">yes</xsl:when>
17+
<xsl:otherwise>no</xsl:otherwise>
18+
</xsl:choose>
19+
</xsl:param>
20+
-->
21+
22+
<xsl:param name="show.comments">
23+
<xsl:choose>
24+
<xsl:when test="contains($pg.version, 'devel')">1</xsl:when>
25+
<xsl:otherwise>0</xsl:otherwise>
26+
</xsl:choose>
27+
</xsl:param>
28+
29+
1230
<xsl:param name="callout.graphics" select="'0'"></xsl:param>
13-
<xsl:param name="toc.section.depth">3</xsl:param>
31+
<xsl:param name="toc.section.depth">2</xsl:param>
1432
<xsl:param name="linenumbering.extension" select="'0'"></xsl:param>
15-
<xsl:param name="preface.autolabel" select="1"></xsl:param>
16-
<xsl:param name="section.autolabel" select="1"></xsl:param>
17-
<xsl:param name="section.label.includes.component.label" select="1"></xsl:param>
33+
<xsl:param name="generate.index" select="1 - $pg.fast"></xsl:param>
34+
<xsl:param name="preface.autolabel" select="1 - $pg.fast"></xsl:param>
35+
<xsl:param name="section.autolabel" select="1 - $pg.fast"></xsl:param>
36+
<xsl:param name="section.label.includes.component.label" select="1 - $pg.fast"></xsl:param>
1837
<xsl:param name="html.stylesheet" select="'stylesheet.css'"></xsl:param>
1938
<xsl:param name="use.id.as.filename" select="'1'"></xsl:param>
2039
<xsl:param name="make.valid.html" select="1"></xsl:param>
21-
<xsl:param name="generate.id.attributes" select="0"></xsl:param> <!-- ? -->
40+
<xsl:param name="generate.id.attributes" select="1"></xsl:param>
2241
<xsl:param name="generate.legalnotice.link" select="1"></xsl:param>
42+
<xsl:param name="refentry.xref.manvolnum" select="0"/>
2343
<xsl:param name="link.mailto.url">pgsql-docs@postgresql.org</xsl:param>
2444
<xsl:param name="formal.procedures" select="0"></xsl:param>
2545
<xsl:param name="punct.honorific" select="''"></xsl:param>
26-
<xsl:param name="chunker.output.doctype-public" select="''"/> <!-- ? -->
27-
<xsl:param name="chunker.output.indent" select="'no'"/> <!-- ? -->
28-
<xsl:param name="chunker.output.omit-xml-declaration" select="'no'"/>
29-
<xsl:param name="html.extra.head.links" select="0"></xsl:param>
30-
<xsl:param name="chunk.quietly" select="0"></xsl:param>
46+
<xsl:param name="chunker.output.indent" select="'yes'"/>
47+
<xsl:param name="chunk.quietly" select="1"></xsl:param>
48+
3149

3250
<!-- Change display of some elements -->
3351

@@ -67,4 +85,24 @@
6785
<xsl:call-template name="inline.boldseq"/>
6886
</xsl:template>
6987

88+
89+
<!-- Special support for Tcl synopses -->
90+
91+
<xsl:template match="optional[@role='tcl']">
92+
?<xsl:call-template name="inline.charseq"/>?
93+
</xsl:template>
94+
95+
96+
<!--
97+
Format multiple terms in varlistentry vertically, instead
98+
of comma-separated.
99+
-->
100+
101+
<xsl:template match="varlistentry/term[position()!=last()]">
102+
<span class="term">
103+
<xsl:call-template name="anchor"/>
104+
<xsl:apply-templates/>
105+
</span><br/>
106+
</xsl:template>
107+
70108
</xsl:stylesheet>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy