VirtualBox

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

Last change on this file since 103131 was 99116, checked in by vboxsync, 21 months ago

manual: Compacted the C and latex syntax diagrams a tiny bit, adding a special role=compact to arg/group to selectively make nested groups tighter too. Fixed controlvm natpf syntax.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.0 KB
Line 
1<?xml version="1.0"?>
2
3<!--
4 Copyright (C) 2006-2023 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="arg.or.sep.compact">|</xsl:variable>
95<xsl:variable name="cmdsynopsis.hanging.indent">4pi</xsl:variable>
96
97<!--
98 Make sure that sections inside the Preface are not numbered.
99 -->
100<xsl:template match="preface/sect1" mode="object.title.template">
101 <xsl:call-template name="gentext.template">
102 <xsl:with-param name="context" select="'title-unnumbered'"/>
103 <xsl:with-param name="name">
104 <xsl:call-template name="xpath.location"/>
105 </xsl:with-param>
106 </xsl:call-template>
107</xsl:template>
108
109<!--
110 refentry related layout tweaks.
111
112 Note! While we could save us all this work by using refsect1..3 and
113 refsynopsisdiv docbook-refentry-to-manual-sect1.xsl, we'd like to have
114 a valid XML document and thus do do some extra markup using the role
115 and condition attributes. We catch some of it here. But the XSLT
116 for specific targets (html, latex, etc) have a few more tweaks
117 related to this.
118
119 The @role has only one special trick 'not-in-toc' that excludes sections
120 like 'Synopsis' and 'Description' from the TOCs.
121
122 The @condition records the original refentry element name, i.e. it will
123 have values like refentry, refsynopsisdiv, refsect1, refsect2 and refsect3.
124 -->
125
126<!-- This removes the not-in-toc bits from the toc. -->
127<xsl:template match="sect2[@role = 'not-in-toc']" mode="toc" />
128<xsl:template match="sect3[@role = 'not-in-toc']" mode="toc" />
129<xsl:template match="sect4[@role = 'not-in-toc']" mode="toc" />
130<xsl:template match="sect5[@role = 'not-in-toc']" mode="toc" />
131<xsl:template match="section[@role = 'not-in-toc']" mode="toc" />
132<xsl:template match="simplesect[@role = 'not-in-toc']" mode="toc" />
133
134<!-- This removes unnecessary <dd><dl> stuff caused by the above. -->
135<xsl:template match="sect1[sect2/@role = 'not-in-toc']" mode="toc">
136 <xsl:param name="toc-context" select="."/>
137 <xsl:call-template name="subtoc">
138 <xsl:with-param name="toc-context" select="$toc-context"/>
139 <xsl:with-param name="nodes" select="sect2[@role != 'not-in-toc'] | bridgehead[$bridgehead.in.toc != 0]"/>
140 </xsl:call-template>
141</xsl:template>
142
143<xsl:template match="sect2[sect3/@role = 'not-in-toc']" mode="toc">
144 <xsl:param name="toc-context" select="."/>
145 <xsl:call-template name="subtoc">
146 <xsl:with-param name="toc-context" select="$toc-context"/>
147 <xsl:with-param name="nodes" select="sect3[@role != 'not-in-toc'] | bridgehead[$bridgehead.in.toc != 0]"/>
148 </xsl:call-template>
149</xsl:template>
150
151<!-- This make the refsect* and refsynopsisdiv unnumbered like the default refentry rendering. -->
152<xsl:template match="sect2[@condition = 'refsynopsisdiv']
153 | sect2[starts-with(@condition, 'refsect')]
154 | sect3[starts-with(@condition, 'refsect')]
155 | sect4[starts-with(@condition, 'refsect')]
156 | sect5[starts-with(@condition, 'refsect')]
157 | section[starts-with(@condition, 'refsect')]
158 | simplesect[starts-with(@condition, 'refsect')]"
159 mode="object.title.template"
160 >
161 <xsl:call-template name="gentext.template">
162 <xsl:with-param name="context" select="'title-unnumbered'"/>
163 <xsl:with-param name="name">
164 <xsl:call-template name="xpath.location"/>
165 </xsl:with-param>
166 </xsl:call-template>
167</xsl:template>
168
169
170</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