Debian Codegraph @

xsl/customPDF.xsl.in

raw
1 <?xml version='1.0' ?>
2
3 <xsl:stylesheet
4 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5 xmlns:fo="http://www.w3.org/1999/XSL/Format"
6 version="1.0">
7
8 <xsl:import href="@xsl_base_path@/fo/docbook.xsl"/>
9
10 <xsl:param name="fop1.extensions" select="1" />
11
12 <xsl:param name="chunk.section.depth" select="2" />
13 <xsl:param name="use.id.as.filename" select="1" />
14 <xsl:param name="chunker.output.indent" select="'yes'" />
15 <xsl:param name="toc.section.depth" select="2" />
16 <xsl:param name="refentry.generate.name" select="0" />
17 <xsl:param name="refentry.generate.title" select="1" />
18 <xsl:param name="chapter.autolabel" select="0" />
19 <xsl:param name="admon.graphics" select="1" />
20
21 <!-- <xsl:param name="html.stylesheet" select="'blue.css'"/> -->
22 <!-- <xsl:param name="chunk.first.sections" select="1" /> -->
23 <!-- <xsl:param name="section.autolabel" select="1" /> -->
24 <!--<xsl:param name="section.label.includes.component.label" select="1" /> -->
25 <!-- <xsl:param name="navig.graphics" select="1" /> -->
26
27 <xsl:param name="generate.toc">
28 appendix toc,title
29 article/appendix nop
30 article toc,title
31 book toc,title <!--,figure,table,example,equation -->
32 chapter title <!-- toc, -->
33 part toc,title
34 preface toc,title
35 qandadiv toc
36 qandaset toc
37 reference toc,title
38 sect1 toc
39 sect2 toc
40 sect3 toc
41 sect4 toc
42 sect5 toc
43 section toc
44 set toc,title
45 </xsl:param>
46
47 <!-- monospace fonts smaller -->
48 <xsl:attribute-set name="monospace.properties">
49 <xsl:attribute name="font-family">
50 <xsl:value-of select="$monospace.font.family"/>
51 </xsl:attribute>
52 <xsl:attribute name="font-size">8pt</xsl:attribute>
53 </xsl:attribute-set>
54
55 <!-- rules for quickref -->
56 <xsl:template match="chapter/formalpara/para/synopsis">
57 <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
58 <xsl:variable name="content">
59 <xsl:apply-templates mode="quickref"/>
60 </xsl:variable>
61 <fo:block id="{$id}"
62 white-space-collapse='false'
63 white-space-treatment='preserve'
64 linefeed-treatment="preserve"
65 text-align="left"
66 xsl:use-attribute-sets="monospace.properties">
67 <xsl:copy-of select="$content"/>
68 </fo:block>
69 </xsl:template>
70
71 <xsl:template match="link" mode="quickref">
72 <xsl:element name="fo:basic-link">
73 <xsl:attribute name="internal-destination"><xsl:value-of select="@linkend"/></xsl:attribute>
74 <xsl:element name="fo:inline">
75 <xsl:attribute name="color"><xsl:value-of select="'blue'"/></xsl:attribute>
76 <xsl:attribute name="font-weight"><xsl:value-of select="'bold'"/></xsl:attribute>
77 <xsl:apply-templates/>
78 </xsl:element>
79 </xsl:element>
80 </xsl:template>
81
82 <xsl:template match="emphasis[@role = 'k']"> <!-- Keyword -->
83 <fo:inline color="rgb(0,128,0)" font-weight="bold"><xsl:apply-templates/></fo:inline>
84 </xsl:template>
85 <xsl:template match="emphasis[@role = 'kd']"> <!-- Keyword.Declaration -->
86 <fo:inline color="rgb(128,0,128)" font-weight="bold"><xsl:apply-templates/></fo:inline>
87 </xsl:template>
88 <xsl:template match="emphasis[starts-with(@role, 'k')]">
89 <fo:inline color="rgb(0,128,0)"><xsl:apply-templates/></fo:inline>
90 </xsl:template>
91
92 <xsl:template match="emphasis[@role = 'na']"> <!-- Name.Attribute -->
93 <fo:inline color="rgb(0,128,0)"><xsl:apply-templates/></fo:inline>
94 </xsl:template>
95 <xsl:template match="emphasis[@role = 'nb']"> <!-- Name.Builtin -->
96 <fo:inline color="rgb(0,0,255)" font-weight="bold"><xsl:apply-templates/></fo:inline>
97 </xsl:template>
98 <xsl:template match="emphasis[@role = 'bp']"> <!-- Name.Builtin.Pseudo -->
99 <fo:inline color="rgb(0,0,255)" font-weight="bold"><xsl:apply-templates/></fo:inline>
100 </xsl:template>
101 <xsl:template match="emphasis[@role = 'nl']"> <!-- Name.Label -->
102 <fo:inline color="rgb(205,92,92)" font-weight="bold"><xsl:apply-templates/></fo:inline>
103 </xsl:template>
104 <xsl:template match="emphasis[@role = 'nt']"> <!-- Name.Tag -->
105 <fo:inline color="rgb(165,42,42)"><xsl:apply-templates/></fo:inline>
106 </xsl:template>
107 <xsl:template match="emphasis[@role = 'vg']"> <!-- Name.Variable.Global -->
108 <fo:inline color="rgb(139,0,0)" font-weight="bold"><xsl:apply-templates/></fo:inline>
109 </xsl:template>
110 <xsl:template match="emphasis[@role = 'vi']"> <!-- Name.Variable.Instance -->
111 <fo:inline color="rgb(0,0,255)" font-weight="bold"><xsl:apply-templates/></fo:inline>
112 </xsl:template>
113
114 <xsl:template match="emphasis[@role = 'c']"> <!-- Comment -->
115 <fo:inline color="rgb(0,128,0)" font-style="italic"><xsl:apply-templates/></fo:inline>
116 </xsl:template>
117 <xsl:template match="emphasis[@role = 'cm']"> <!-- Comment.Multiline -->
118 <fo:inline color="rgb(0,128,0)" font-style="italic"><xsl:apply-templates/></fo:inline>
119 </xsl:template>
120 <xsl:template match="emphasis[@role = 'cp']"> <!-- Comment.Preproc -->
121 <fo:inline color="rgb(186,85,211)" font-weight="bold"><xsl:apply-templates/></fo:inline>
122 </xsl:template>
123 <xsl:template match="emphasis[@role = 'c1']"> <!-- Comment.Single -->
124 <fo:inline color="rgb(0,128,0)" font-style="italic"><xsl:apply-templates/></fo:inline>
125 </xsl:template>
126 <xsl:template match="emphasis[@role = 'cs']"> <!-- Comment.Special -->
127 <fo:inline color="rgb(0,128,0)" font-style="italic"><xsl:apply-templates/></fo:inline>
128 </xsl:template>
129
130 <xsl:template match="emphasis[@role = 'o']"> <!-- Operator -->
131 <fo:inline font-weight="bold"><xsl:apply-templates/></fo:inline>
132 </xsl:template>
133 <xsl:template match="emphasis[@role = 'ow']"> <!-- Operator.Word -->
134 <fo:inline color="rgb(0,128,0)" font-weight="bold"><xsl:apply-templates/></fo:inline>
135 </xsl:template>
136
137 <xsl:template match="emphasis[@role = 'sd']"> <!-- String.Doc -->
138 <fo:inline color="rgb(205,133,63)" font-style="italic"><xsl:apply-templates/></fo:inline>
139 </xsl:template>
140 <xsl:template match="emphasis[@role = 'se']"> <!-- String.Escape -->
141 <fo:inline color="rgb(0,128,0)"><xsl:apply-templates/></fo:inline>
142 </xsl:template>
143 <xsl:template match="emphasis[@role = 'si']"> <!-- String.Interpol -->
144 <fo:inline color="rgb(205,133,63)" font-weight="bold"><xsl:apply-templates/></fo:inline>
145 </xsl:template>
146 <xsl:template match="emphasis[starts-with(@role, 's')]">
147 <fo:inline color="rgb(205,133,63)"><xsl:apply-templates/></fo:inline>
148 </xsl:template>
149
150 </xsl:stylesheet>