VirtualBox

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

Last change on this file since 79802 was 76704, checked in by vboxsync, 6 years ago

doc/manual: use the appropriate markup for the Preface, and make sure that the sections in it are unnumbered (a bit incomplete for the HTML/... case, but can be improved later), important fix for HTML manual as it restores the validity of the (per chapter) links to the HTML manual.

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