Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5f1f30d

Browse files
committed
Reorganize XSLT stylesheet support. Put common things into a separate
file (instead of repeating), add XSL-FO stylesheet and appropriate makerules.
1 parent0a265e4 commit5f1f30d

File tree

5 files changed

+112
-157
lines changed

5 files changed

+112
-157
lines changed

‎doc/src/sgml/Makefile

Lines changed: 12 additions & 7 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.82 2006/12/10 01:53:15 petere Exp $
5+
# $PostgreSQL: pgsql/doc/src/sgml/Makefile,v 1.83 2006/12/1016:01:06 petere Exp $
66
#
77
#----------------------------------------------------------------------------
88

@@ -207,7 +207,7 @@ regress_README.html: regress.sgml
207207

208208

209209
##
210-
##Experimental XML stuff
210+
##XSLT processing
211211
##
212212

213213
OSX = osx# (may be called sx or sgml2xml on some systems)
@@ -219,11 +219,16 @@ postgres.xml: postgres.sgml $(GENERATED_SGML)
219219
-e'1a\' -e'<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">'\
220220
>$@
221221

222-
testxml: stylesheet.xsl postgres.xml
223-
$(XSLTPROC)$(XSLTPROCFLAGS) --stringparam pg.version'$(VERSION)'$^
222+
overrideXSLTPROCFLAGS += --stringparam pg.version '$(VERSION)'
223+
224+
xslthtml: stylesheet.xsl postgres.xml
225+
$(XSLTPROC)$(XSLTPROCFLAGS)$^
224226

225227
htmlhelp: stylesheet-hh.xsl postgres.xml
226-
$(XSLTPROC)$(XSLTPROCFLAGS) --stringparam pg.version'$(VERSION)'$^
228+
$(XSLTPROC)$(XSLTPROCFLAGS)$^
229+
230+
%.fo: stylesheet-fo.xsl%.xml
231+
$(XSLTPROC)$(XSLTPROCFLAGS) -o$@$^
227232

228233

229234
##
@@ -271,7 +276,7 @@ clean distclean maintainer-clean:
271276
rm -f HTML.index $(GENERATED_SGML)
272277
# text
273278
rm -f INSTALL HISTORY regress_README
274-
#XML
275-
rm -f postgres.xml htmlhelp.hhp toc.hhc index.hhk
279+
#XSLT
280+
rm -f postgres.xml htmlhelp.hhp toc.hhc index.hhk *.fo
276281
# Texinfo
277282
rm -f *.texixml *.texi *.info db2texi.refs

‎doc/src/sgml/stylesheet-common.xsl

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<xsl:stylesheetxmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3+
version="1.0">
4+
5+
<!--
6+
This file contains XSLT stylesheet customizations that are common to
7+
all output formats (HTML, HTML Help, XSL-FO, etc.).
8+
-->
9+
10+
11+
<!-- Parameters-->
12+
13+
<xsl:paramname="pg.fast"select="'0'"/>
14+
15+
<!--
16+
<xsl:param name="draft.mode">
17+
<xsl:choose>
18+
<xsl:when test="contains($pg.version, 'devel')">yes</xsl:when>
19+
<xsl:otherwise>no</xsl:otherwise>
20+
</xsl:choose>
21+
</xsl:param>
22+
-->
23+
24+
<xsl:paramname="show.comments">
25+
<xsl:choose>
26+
<xsl:whentest="contains($pg.version, 'devel')">1</xsl:when>
27+
<xsl:otherwise>0</xsl:otherwise>
28+
</xsl:choose>
29+
</xsl:param>
30+
31+
<xsl:paramname="callout.graphics"select="'0'"></xsl:param>
32+
<xsl:paramname="toc.section.depth">2</xsl:param>
33+
<xsl:paramname="linenumbering.extension"select="'0'"></xsl:param>
34+
<xsl:paramname="generate.index"select="1 - $pg.fast"></xsl:param>
35+
<xsl:paramname="preface.autolabel"select="1 - $pg.fast"></xsl:param>
36+
<xsl:paramname="section.autolabel"select="1 - $pg.fast"></xsl:param>
37+
<xsl:paramname="section.label.includes.component.label"select="1 - $pg.fast"></xsl:param>
38+
<xsl:paramname="refentry.xref.manvolnum"select="0"/>
39+
<xsl:paramname="formal.procedures"select="0"></xsl:param>
40+
<xsl:paramname="punct.honorific"select="''"></xsl:param>
41+
42+
43+
<!-- Change display of some elements-->
44+
45+
<xsl:templatematch="command">
46+
<xsl:call-templatename="inline.monoseq"/>
47+
</xsl:template>
48+
49+
<xsl:templatematch="productname">
50+
<xsl:call-templatename="inline.charseq"/>
51+
</xsl:template>
52+
53+
<xsl:templatematch="structfield">
54+
<xsl:call-templatename="inline.monoseq"/>
55+
</xsl:template>
56+
57+
<xsl:templatematch="structname">
58+
<xsl:call-templatename="inline.monoseq"/>
59+
</xsl:template>
60+
61+
<xsl:templatematch="symbol">
62+
<xsl:call-templatename="inline.monoseq"/>
63+
</xsl:template>
64+
65+
<xsl:templatematch="systemitem">
66+
<xsl:call-templatename="inline.charseq"/>
67+
</xsl:template>
68+
69+
<xsl:templatematch="token">
70+
<xsl:call-templatename="inline.monoseq"/>
71+
</xsl:template>
72+
73+
<xsl:templatematch="type">
74+
<xsl:call-templatename="inline.monoseq"/>
75+
</xsl:template>
76+
77+
<xsl:templatematch="programlisting/emphasis">
78+
<xsl:call-templatename="inline.boldseq"/>
79+
</xsl:template>
80+
81+
82+
<!-- Special support for Tcl synopses-->
83+
84+
<xsl:templatematch="optional[@role='tcl']">
85+
?<xsl:call-templatename="inline.charseq"/>?
86+
</xsl:template>
87+
88+
</xsl:stylesheet>

‎doc/src/sgml/stylesheet-fo.xsl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<xsl:stylesheetxmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3+
version="1.0"
4+
xmlns:fo="http://www.w3.org/1999/XSL/Format">
5+
6+
<xsl:importhref="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"/>
7+
<xsl:includehref="stylesheet-common.xsl" />
8+
9+
</xsl:stylesheet>

‎doc/src/sgml/stylesheet-hh.xsl

Lines changed: 1 addition & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -5,94 +5,21 @@
55
exclude-result-prefixes="#default">
66

77
<xsl:importhref="http://docbook.sourceforge.net/release/xsl/current/htmlhelp/htmlhelp.xsl"/>
8+
<xsl:includehref="stylesheet-common.xsl" />
89

910
<!-- Parameters-->
1011
<xsl:paramname="htmlhelp.use.hhk"select="'1'"/>
11-
<xsl:paramname="pg.fast"select="'0'"/>
1212

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:paramname="show.comments">
23-
<xsl:choose>
24-
<xsl:whentest="contains($pg.version, 'devel')">1</xsl:when>
25-
<xsl:otherwise>0</xsl:otherwise>
26-
</xsl:choose>
27-
</xsl:param>
28-
29-
30-
<xsl:paramname="callout.graphics"select="'0'"></xsl:param>
31-
<xsl:paramname="toc.section.depth">2</xsl:param>
32-
<xsl:paramname="linenumbering.extension"select="'0'"></xsl:param>
33-
<xsl:paramname="generate.index"select="1 - $pg.fast"></xsl:param>
34-
<xsl:paramname="preface.autolabel"select="1 - $pg.fast"></xsl:param>
35-
<xsl:paramname="section.autolabel"select="1 - $pg.fast"></xsl:param>
36-
<xsl:paramname="section.label.includes.component.label"select="1 - $pg.fast"></xsl:param>
3713
<xsl:paramname="html.stylesheet"select="'stylesheet.css'"></xsl:param>
3814
<xsl:paramname="use.id.as.filename"select="'1'"></xsl:param>
3915
<xsl:paramname="make.valid.html"select="1"></xsl:param>
4016
<xsl:paramname="generate.id.attributes"select="1"></xsl:param>
4117
<xsl:paramname="generate.legalnotice.link"select="1"></xsl:param>
42-
<xsl:paramname="refentry.xref.manvolnum"select="0"/>
4318
<xsl:paramname="link.mailto.url">pgsql-docs@postgresql.org</xsl:param>
44-
<xsl:paramname="formal.procedures"select="0"></xsl:param>
45-
<xsl:paramname="punct.honorific"select="''"></xsl:param>
4619
<xsl:paramname="chunker.output.indent"select="'yes'"/>
4720
<xsl:paramname="chunk.quietly"select="1"></xsl:param>
4821

4922

50-
<!-- Change display of some elements-->
51-
52-
<xsl:templatematch="command">
53-
<xsl:call-templatename="inline.monoseq"/>
54-
</xsl:template>
55-
56-
<xsl:templatematch="productname">
57-
<xsl:call-templatename="inline.charseq"/>
58-
</xsl:template>
59-
60-
<xsl:templatematch="structfield">
61-
<xsl:call-templatename="inline.monoseq"/>
62-
</xsl:template>
63-
64-
<xsl:templatematch="structname">
65-
<xsl:call-templatename="inline.monoseq"/>
66-
</xsl:template>
67-
68-
<xsl:templatematch="symbol">
69-
<xsl:call-templatename="inline.monoseq"/>
70-
</xsl:template>
71-
72-
<xsl:templatematch="systemitem">
73-
<xsl:call-templatename="inline.charseq"/>
74-
</xsl:template>
75-
76-
<xsl:templatematch="token">
77-
<xsl:call-templatename="inline.monoseq"/>
78-
</xsl:template>
79-
80-
<xsl:templatematch="type">
81-
<xsl:call-templatename="inline.monoseq"/>
82-
</xsl:template>
83-
84-
<xsl:templatematch="programlisting/emphasis">
85-
<xsl:call-templatename="inline.boldseq"/>
86-
</xsl:template>
87-
88-
89-
<!-- Special support for Tcl synopses-->
90-
91-
<xsl:templatematch="optional[@role='tcl']">
92-
?<xsl:call-templatename="inline.charseq"/>?
93-
</xsl:template>
94-
95-
9623
<!--
9724
Format multiple terms in varlistentry vertically, instead
9825
of comma-separated.

‎doc/src/sgml/stylesheet.xsl

Lines changed: 2 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -5,94 +5,20 @@
55
exclude-result-prefixes="#default">
66

77
<xsl:importhref="http://docbook.sourceforge.net/release/xsl/current/xhtml/chunk.xsl"/>
8+
<xsl:includehref="stylesheet-common.xsl" />
89

9-
<!-- Parameters-->
10-
11-
<xsl:paramname="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-
-->
2110

22-
<xsl:paramname="show.comments">
23-
<xsl:choose>
24-
<xsl:whentest="contains($pg.version, 'devel')">1</xsl:when>
25-
<xsl:otherwise>0</xsl:otherwise>
26-
</xsl:choose>
27-
</xsl:param>
28-
29-
30-
<xsl:paramname="callout.graphics"select="'0'"></xsl:param>
31-
<xsl:paramname="toc.section.depth">2</xsl:param>
32-
<xsl:paramname="linenumbering.extension"select="'0'"></xsl:param>
33-
<xsl:paramname="generate.index"select="1 - $pg.fast"></xsl:param>
34-
<xsl:paramname="preface.autolabel"select="1 - $pg.fast"></xsl:param>
35-
<xsl:paramname="section.autolabel"select="1 - $pg.fast"></xsl:param>
36-
<xsl:paramname="section.label.includes.component.label"select="1 - $pg.fast"></xsl:param>
11+
<!-- Parameters-->
3712
<xsl:paramname="html.stylesheet"select="'stylesheet.css'"></xsl:param>
3813
<xsl:paramname="use.id.as.filename"select="'1'"></xsl:param>
3914
<xsl:paramname="make.valid.html"select="1"></xsl:param>
4015
<xsl:paramname="generate.id.attributes"select="1"></xsl:param>
4116
<xsl:paramname="generate.legalnotice.link"select="1"></xsl:param>
42-
<xsl:paramname="refentry.xref.manvolnum"select="0"/>
4317
<xsl:paramname="link.mailto.url">pgsql-docs@postgresql.org</xsl:param>
44-
<xsl:paramname="formal.procedures"select="0"></xsl:param>
45-
<xsl:paramname="punct.honorific"select="''"></xsl:param>
4618
<xsl:paramname="chunker.output.indent"select="'yes'"/>
4719
<xsl:paramname="chunk.quietly"select="1"></xsl:param>
4820

4921

50-
<!-- Change display of some elements-->
51-
52-
<xsl:templatematch="command">
53-
<xsl:call-templatename="inline.monoseq"/>
54-
</xsl:template>
55-
56-
<xsl:templatematch="productname">
57-
<xsl:call-templatename="inline.charseq"/>
58-
</xsl:template>
59-
60-
<xsl:templatematch="structfield">
61-
<xsl:call-templatename="inline.monoseq"/>
62-
</xsl:template>
63-
64-
<xsl:templatematch="structname">
65-
<xsl:call-templatename="inline.monoseq"/>
66-
</xsl:template>
67-
68-
<xsl:templatematch="symbol">
69-
<xsl:call-templatename="inline.monoseq"/>
70-
</xsl:template>
71-
72-
<xsl:templatematch="systemitem">
73-
<xsl:call-templatename="inline.charseq"/>
74-
</xsl:template>
75-
76-
<xsl:templatematch="token">
77-
<xsl:call-templatename="inline.monoseq"/>
78-
</xsl:template>
79-
80-
<xsl:templatematch="type">
81-
<xsl:call-templatename="inline.monoseq"/>
82-
</xsl:template>
83-
84-
<xsl:templatematch="programlisting/emphasis">
85-
<xsl:call-templatename="inline.boldseq"/>
86-
</xsl:template>
87-
88-
89-
<!-- Special support for Tcl synopses-->
90-
91-
<xsl:templatematch="optional[@role='tcl']">
92-
?<xsl:call-templatename="inline.charseq"/>?
93-
</xsl:template>
94-
95-
9622
<!--
9723
Format multiple terms in varlistentry vertically, instead
9824
of comma-separated.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp