1 | <?xml version="1.0"?>
|
---|
2 |
|
---|
3 | <!--
|
---|
4 | Copyright (C) 2006-2022 Oracle Corporation
|
---|
5 |
|
---|
6 | This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
7 | available from http://www.215389.xyz. This file is free software;
|
---|
8 | you can redistribute it and/or modify it under the terms of the GNU
|
---|
9 | General Public License (GPL) as published by the Free Software
|
---|
10 | Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
11 | VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
12 | hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
13 | -->
|
---|
14 |
|
---|
15 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
---|
16 |
|
---|
17 | <!-- General formatting settings. -->
|
---|
18 | <xsl:variable name="section.autolabel">1</xsl:variable>
|
---|
19 | <xsl:variable name="section.label.includes.component.label">1</xsl:variable>
|
---|
20 | <xsl:attribute-set name="monospace.properties">
|
---|
21 | <xsl:attribute name="font-size">90%</xsl:attribute>
|
---|
22 | </xsl:attribute-set>
|
---|
23 | <xsl:param name="draft.mode" select="'no'"/>
|
---|
24 |
|
---|
25 | <!-- Shift down section sizes one magstep. -->
|
---|
26 | <xsl:attribute-set name="section.title.level1.properties">
|
---|
27 | <xsl:attribute name="font-size">
|
---|
28 | <xsl:value-of select="$body.font.master * 1.728"></xsl:value-of>
|
---|
29 | <xsl:text>pt</xsl:text>
|
---|
30 | </xsl:attribute>
|
---|
31 | </xsl:attribute-set>
|
---|
32 | <xsl:attribute-set name="section.title.level2.properties">
|
---|
33 | <xsl:attribute name="font-size">
|
---|
34 | <xsl:value-of select="$body.font.master * 1.44"></xsl:value-of>
|
---|
35 | <xsl:text>pt</xsl:text>
|
---|
36 | </xsl:attribute>
|
---|
37 | </xsl:attribute-set>
|
---|
38 | <xsl:attribute-set name="section.title.level3.properties">
|
---|
39 | <xsl:attribute name="font-size">
|
---|
40 | <xsl:value-of select="$body.font.master * 1.2"></xsl:value-of>
|
---|
41 | <xsl:text>pt</xsl:text>
|
---|
42 | </xsl:attribute>
|
---|
43 | </xsl:attribute-set>
|
---|
44 | <xsl:attribute-set name="section.title.level4.properties">
|
---|
45 | <xsl:attribute name="font-size">
|
---|
46 | <xsl:value-of select="$body.font.master"></xsl:value-of>
|
---|
47 | <xsl:text>pt</xsl:text>
|
---|
48 | </xsl:attribute>
|
---|
49 | </xsl:attribute-set>
|
---|
50 | <xsl:attribute-set name="section.title.level5.properties">
|
---|
51 | <xsl:attribute name="font-size">
|
---|
52 | <xsl:value-of select="$body.font.master"></xsl:value-of>
|
---|
53 | <xsl:text>pt</xsl:text>
|
---|
54 | </xsl:attribute>
|
---|
55 | </xsl:attribute-set>
|
---|
56 | <xsl:attribute-set name="section.title.level6.properties">
|
---|
57 | <xsl:attribute name="font-size">
|
---|
58 | <xsl:value-of select="$body.font.master"></xsl:value-of>
|
---|
59 | <xsl:text>pt</xsl:text>
|
---|
60 | </xsl:attribute>
|
---|
61 | </xsl:attribute-set>
|
---|
62 |
|
---|
63 | <!-- Shift down chapter font size one magstep. -->
|
---|
64 | <xsl:attribute-set name="component.title.properties">
|
---|
65 | <xsl:attribute name="font-size">
|
---|
66 | <xsl:value-of select="$body.font.master * 2.0736"></xsl:value-of>
|
---|
67 | <xsl:text>pt</xsl:text>
|
---|
68 | </xsl:attribute>
|
---|
69 | </xsl:attribute-set>
|
---|
70 |
|
---|
71 | <!-- command synopsis -->
|
---|
72 | <xsl:variable name="arg.choice.opt.open.str">[</xsl:variable>
|
---|
73 | <xsl:variable name="arg.choice.opt.close.str">]</xsl:variable>
|
---|
74 | <xsl:variable name="arg.choice.req.open.str"><</xsl:variable>
|
---|
75 | <xsl:variable name="arg.choice.req.close.str">></xsl:variable>
|
---|
76 | <xsl:variable name="arg.choice.plain.open.str"><xsl:text> </xsl:text></xsl:variable>
|
---|
77 | <xsl:variable name="arg.choice.plain.close.str"><xsl:text> </xsl:text></xsl:variable>
|
---|
78 | <xsl:variable name="arg.choice.def.open.str">[</xsl:variable>
|
---|
79 | <xsl:variable name="arg.choice.def.close.str">]</xsl:variable>
|
---|
80 | <xsl:variable name="arg.rep.repeat.str">...</xsl:variable>
|
---|
81 | <xsl:variable name="arg.rep.norepeat.str"></xsl:variable>
|
---|
82 | <xsl:variable name="arg.rep.def.str"></xsl:variable>
|
---|
83 | <xsl:variable name="arg.or.sep"> | </xsl:variable>
|
---|
84 | <xsl:variable name="cmdsynopsis.hanging.indent">4pi</xsl:variable>
|
---|
85 |
|
---|
86 | <!--
|
---|
87 | Make sure that sections inside the Preface are not numbered.
|
---|
88 | -->
|
---|
89 | <xsl:template match="preface/sect1" mode="object.title.template">
|
---|
90 | <xsl:call-template name="gentext.template">
|
---|
91 | <xsl:with-param name="context" select="'title-unnumbered'"/>
|
---|
92 | <xsl:with-param name="name">
|
---|
93 | <xsl:call-template name="xpath.location"/>
|
---|
94 | </xsl:with-param>
|
---|
95 | </xsl:call-template>
|
---|
96 | </xsl:template>
|
---|
97 |
|
---|
98 | <!--
|
---|
99 | refentry related layout tweaks.
|
---|
100 |
|
---|
101 | Note! While we could save us all this work by using refsect1..3 and
|
---|
102 | refsynopsisdiv docbook-refentry-to-manual-sect1.xsl, we'd like to have
|
---|
103 | a valid XML document and thus do do some extra markup using the role
|
---|
104 | and condition attributes. We catch some of it here. But the XSLT
|
---|
105 | for specific targets (html, latex, etc) have a few more tweaks
|
---|
106 | related to this.
|
---|
107 |
|
---|
108 | The @role has only one special trick 'not-in-toc' that excludes sections
|
---|
109 | like 'Synopsis' and 'Description' from the TOCs.
|
---|
110 |
|
---|
111 | The @condition records the original refentry element name, i.e. it will
|
---|
112 | have values like refentry, refsynopsisdiv, refsect1, refsect2 and refsect3.
|
---|
113 | -->
|
---|
114 |
|
---|
115 | <!-- This removes the not-in-toc bits from the toc. -->
|
---|
116 | <xsl:template match="sect2[@role = 'not-in-toc']" mode="toc" />
|
---|
117 | <xsl:template match="sect3[@role = 'not-in-toc']" mode="toc" />
|
---|
118 | <xsl:template match="sect4[@role = 'not-in-toc']" mode="toc" />
|
---|
119 | <xsl:template match="sect5[@role = 'not-in-toc']" mode="toc" />
|
---|
120 | <xsl:template match="section[@role = 'not-in-toc']" mode="toc" />
|
---|
121 | <xsl:template match="simplesect[@role = 'not-in-toc']" mode="toc" />
|
---|
122 |
|
---|
123 | <!-- This removes unnecessary <dd><dl> stuff caused by the above. -->
|
---|
124 | <xsl:template match="sect1[sect2/@role = 'not-in-toc']" mode="toc">
|
---|
125 | <xsl:param name="toc-context" select="."/>
|
---|
126 | <xsl:call-template name="subtoc">
|
---|
127 | <xsl:with-param name="toc-context" select="$toc-context"/>
|
---|
128 | <xsl:with-param name="nodes" select="sect2[@role != 'not-in-toc'] | bridgehead[$bridgehead.in.toc != 0]"/>
|
---|
129 | </xsl:call-template>
|
---|
130 | </xsl:template>
|
---|
131 |
|
---|
132 | <xsl:template match="sect2[sect3/@role = 'not-in-toc']" mode="toc">
|
---|
133 | <xsl:param name="toc-context" select="."/>
|
---|
134 | <xsl:call-template name="subtoc">
|
---|
135 | <xsl:with-param name="toc-context" select="$toc-context"/>
|
---|
136 | <xsl:with-param name="nodes" select="sect3[@role != 'not-in-toc'] | bridgehead[$bridgehead.in.toc != 0]"/>
|
---|
137 | </xsl:call-template>
|
---|
138 | </xsl:template>
|
---|
139 |
|
---|
140 | <!-- This make the refsect* and refsynopsisdiv unnumbered like the default refentry rendering. -->
|
---|
141 | <xsl:template match="sect2[@condition = 'refsynopsisdiv']
|
---|
142 | | sect2[starts-with(@condition, 'refsect')]
|
---|
143 | | sect3[starts-with(@condition, 'refsect')]
|
---|
144 | | sect4[starts-with(@condition, 'refsect')]
|
---|
145 | | sect5[starts-with(@condition, 'refsect')]
|
---|
146 | | section[starts-with(@condition, 'refsect')]
|
---|
147 | | simplesect[starts-with(@condition, 'refsect')]"
|
---|
148 | mode="object.title.template"
|
---|
149 | >
|
---|
150 | <xsl:call-template name="gentext.template">
|
---|
151 | <xsl:with-param name="context" select="'title-unnumbered'"/>
|
---|
152 | <xsl:with-param name="name">
|
---|
153 | <xsl:call-template name="xpath.location"/>
|
---|
154 | </xsl:with-param>
|
---|
155 | </xsl:call-template>
|
---|
156 | </xsl:template>
|
---|
157 |
|
---|
158 |
|
---|
159 | </xsl:stylesheet>
|
---|