-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathfop.xsl
91 lines (79 loc) · 3.19 KB
/
fop.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xslthl="http://xslthl.sf.net"
exclude-result-prefixes="xslthl">
<!-- Include basic AsciiDoc FOP formatting -->
<xsl:import href="file:///etc/asciidoc/docbook-xsl/fo.xsl"/>
<!-- Include source syntax highlighting -->
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/highlighting/common.xsl"/>
<!-- This contains the default source highlight styling rules -->
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/highlight.xsl"/>
<!-- Without the below, line numbering doesn't work -->
<xsl:param name="use.extensions" select="'1'"/>
<xsl:param name="linenumbering.extension" select="'1'"/>
<xsl:param name="linenumbering.everyNth" select="'1'"/>
<xsl:param name="generate.toc" select="'book toc,title'"/>
<xsl:attribute-set name="root.properties">
<xsl:attribute name="widows">4</xsl:attribute>
<xsl:attribute name="orphans">4</xsl:attribute>
</xsl:attribute-set>
<xsl:param name="orderedlist.label.width">1.5em</xsl:param>
<!-- 1.2 section -->
<xsl:attribute-set name="section.title.level1.properties">
<xsl:attribute name="font-size">
<xsl:value-of select="$body.font.master * 1.5"/>
<xsl:text>pt</xsl:text>
</xsl:attribute>
</xsl:attribute-set>
<!-- 1.2.3 section -->
<xsl:attribute-set name="section.title.level2.properties">
<xsl:attribute name="font-size">
<xsl:value-of select="$body.font.master * 1.36"/>
<xsl:text>pt</xsl:text>
</xsl:attribute>
</xsl:attribute-set>
<!-- 1.2.3.4 section -->
<xsl:attribute-set name="section.title.level3.properties">
<xsl:attribute name="font-size">
<xsl:value-of select="$body.font.master * 1.2"/>
<xsl:text>pt</xsl:text>
</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="monospace.verbatim.properties">
<xsl:attribute name="keep-together.within-column">always</xsl:attribute>
</xsl:attribute-set>
<!-- Force a blank page at the end -->
<xsl:template name="back.cover">
<fo:page-sequence master-reference="blank">
<fo:flow flow-name="xsl-region-body">
<fo:block break-before="page"> </fo:block>
</fo:flow>
</fo:page-sequence>
</xsl:template>
<!-- My style customisations
<xsl:template match='xslthl:keyword' mode="xslthl">
<fo:inline font-weight="normal" color="#AA22FF"><xsl:apply-templates mode="xslthl"/></fo:inline>
</xsl:template>
<xsl:template match="xslthl:doccomment|xslthl:doctype" mode="xslthl">
<fo:inline font-weight="normal" color="green">
<xsl:apply-templates mode="xslthl"/>
</fo:inline>
</xsl:template>
<xsl:template match="xslthl:annotation" mode="xslthl">
<fo:inline font-weight="normal" color="teal">
<xsl:apply-templates mode="xslthl"/>
</fo:inline>
</xsl:template>
<xsl:template match="xslthl:string" mode="xslthl">
<fo:inline font-weight="normal" font-style="italic" color="brown">
<xsl:apply-templates mode="xslthl"/>
</fo:inline>
</xsl:template>
<xsl:template match="xslthl:directive" mode="xslthl">
<fo:inline font-weight="normal" font-style="italic" color="blue">
<xsl:apply-templates mode="xslthl"/>
</fo:inline>
</xsl:template>
-->
</xsl:stylesheet>