Skip to content

Commit a5963ef

Browse files
committed
doc: Improve setup for documentation building with FOP
Add a makefile rule for building PDFs with FOP. Two new build targets in doc/src/sgml are postgres-A4-fop.pdf and postgres-US-fop.pdf. Run .fo output through xmllint for reformatting, so that errors are easier to find. (The default output has hardly any line breaks, so you might be looking for an error in column 20000.) Set some XSLT parameters to optimize for building with FOP. Remove some redundant or somewhat useless chapterinfo/author information, because it renders strangely with the FO stylesheet. Reviewed-by: Álvaro Herrera <alvherre@2ndquadrant.com>
1 parent 709170b commit a5963ef

File tree

4 files changed

+27
-34
lines changed

4 files changed

+27
-34
lines changed

doc/src/sgml/Makefile

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,12 +268,24 @@ xslthtml-stamp: stylesheet.xsl postgres.xml
268268
htmlhelp: stylesheet-hh.xsl postgres.xml
269269
$(XSLTPROC) $(XSLTPROCFLAGS) $^
270270

271-
%-A4.fo: stylesheet-fo.xsl %.xml
271+
%-A4.fo.tmp: stylesheet-fo.xsl %.xml
272272
$(XSLTPROC) $(XSLTPROCFLAGS) --stringparam paper.type A4 -o $@ $^
273273

274-
%-US.fo: stylesheet-fo.xsl %.xml
274+
%-US.fo.tmp: stylesheet-fo.xsl %.xml
275275
$(XSLTPROC) $(XSLTPROCFLAGS) --stringparam paper.type USletter -o $@ $^
276276

277+
FOP = fop
278+
XMLLINT = xmllint
279+
280+
# reformat FO output so that locations of errors are easier to find
281+
%.fo: %.fo.tmp
282+
$(XMLLINT) --format --output $@ $^
283+
284+
.SECONDARY: postgres-A4.fo postgres-US.fo
285+
286+
%-fop.pdf: %.fo
287+
$(FOP) -fo $< -pdf $@
288+
277289
epub: postgres.epub
278290
postgres.epub: postgres.xml
279291
$(DBTOEPUB) $<
@@ -391,7 +403,7 @@ clean:
391403
# index
392404
rm -f HTML.index $(GENERATED_SGML)
393405
# XSLT
394-
rm -f postgres.xml postgres.xmltmp htmlhelp.hhp toc.hhc index.hhk *.fo
406+
rm -f postgres.xml postgres.xmltmp htmlhelp.hhp toc.hhc index.hhk *.fo *.fo.tmp
395407
# EPUB
396408
rm -f postgres.epub
397409
# Texinfo

doc/src/sgml/geqo.sgml

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,6 @@
11
<!-- doc/src/sgml/geqo.sgml -->
22

33
<chapter id="geqo">
4-
<chapterinfo>
5-
<author>
6-
<firstname>Martin</firstname>
7-
<surname>Utesch</surname>
8-
<affiliation>
9-
<orgname>
10-
University of Mining and Technology
11-
</orgname>
12-
<orgdiv>
13-
Institute of Automatic Control
14-
</orgdiv>
15-
<address>
16-
<city>
17-
Freiberg
18-
</city>
19-
<country>
20-
Germany
21-
</country>
22-
</address>
23-
</affiliation>
24-
</author>
25-
<date>1997-10-02</date>
26-
</chapterinfo>
27-
284
<title>Genetic Query Optimizer</title>
295

306
<para>

doc/src/sgml/nls.sgml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
<!-- doc/src/sgml/nls.sgml -->
22

33
<chapter id="nls">
4-
<chapterinfo>
5-
<author>
6-
<firstname>Peter</firstname>
7-
<surname>Eisentraut</surname>
8-
</author>
9-
</chapterinfo>
10-
114
<title>Native Language Support</title>
125

136
<sect1 id="nls-translator">

doc/src/sgml/stylesheet-fo.xsl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@
66
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"/>
77
<xsl:include href="stylesheet-common.xsl" />
88

9+
<xsl:param name="fop1.extensions" select="1"></xsl:param>
10+
<xsl:param name="tablecolumns.extension" select="0"></xsl:param>
11+
<xsl:param name="toc.max.depth">3</xsl:param>
12+
<xsl:param name="ulink.footnotes" select="1"></xsl:param>
13+
<xsl:param name="use.extensions" select="1"></xsl:param>
14+
<xsl:param name="variablelist.as.blocks" select="1"></xsl:param>
15+
16+
<xsl:attribute-set name="monospace.verbatim.properties"
17+
use-attribute-sets="verbatim.properties monospace.properties">
18+
<xsl:attribute name="wrap-option">wrap</xsl:attribute>
19+
</xsl:attribute-set>
20+
921
<!-- Change display of some elements -->
1022

1123
<xsl:template match="command">

0 commit comments

Comments
 (0)