VirtualBox

source: vbox/trunk/doc/manual/common-formatcfg.xsl@ 96918

Last change on this file since 96918 was 96407, checked in by vboxsync, 2 years ago

scm copyright and license note update

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

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette