VirtualBox

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

Last change on this file since 63694 was 56483, checked in by vboxsync, 9 years ago

syntax diagram tweaking.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.7 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 refentry related layout tweaks.
75
76 Note! While we could save us all this work by using refsect1..3 and
77 refsynopsisdiv docbook-refentry-to-manual-sect1.xsl, we'd like to have
78 a valid XML document and thus do do some extra markup using the role
79 and condition attributes. We catch some of it here. But the XSLT
80 for specific targets (html, latex, etc) have a few more tweaks
81 related to this.
82
83 The @role has only one special trick 'not-in-toc' that excludes sections
84 like 'Synopsis' and 'Description' from the TOCs.
85
86 The @condition records the original refentry element name, i.e. it will
87 have values like refentry, refsynopsisdiv, refsect1, refsect2 and refsect3.
88 -->
89
90<!-- This removes the not-in-toc bits from the toc. -->
91<xsl:template match="sect2[@role = 'not-in-toc']" mode="toc" />
92<xsl:template match="sect3[@role = 'not-in-toc']" mode="toc" />
93<xsl:template match="sect4[@role = 'not-in-toc']" mode="toc" />
94<xsl:template match="sect5[@role = 'not-in-toc']" mode="toc" />
95<xsl:template match="section[@role = 'not-in-toc']" mode="toc" />
96<xsl:template match="simplesect[@role = 'not-in-toc']" mode="toc" />
97
98<!-- This removes unnecessary <dd><dl> stuff caused by the above. -->
99<xsl:template match="sect1[sect2/@role = 'not-in-toc']" mode="toc">
100 <xsl:param name="toc-context" select="."/>
101 <xsl:call-template name="subtoc">
102 <xsl:with-param name="toc-context" select="$toc-context"/>
103 <xsl:with-param name="nodes" select="sect2[@role != 'not-in-toc'] | bridgehead[$bridgehead.in.toc != 0]"/>
104 </xsl:call-template>
105</xsl:template>
106
107<xsl:template match="sect2[sect3/@role = 'not-in-toc']" mode="toc">
108 <xsl:param name="toc-context" select="."/>
109 <xsl:call-template name="subtoc">
110 <xsl:with-param name="toc-context" select="$toc-context"/>
111 <xsl:with-param name="nodes" select="sect3[@role != 'not-in-toc'] | bridgehead[$bridgehead.in.toc != 0]"/>
112 </xsl:call-template>
113</xsl:template>
114
115<!-- This make the refsect* and refsynopsisdiv unnumbered like the default refentry rendering. -->
116<xsl:template match="sect2[@condition = 'refsynopsisdiv']
117 | sect2[starts-with(@condition, 'refsect')]
118 | sect3[starts-with(@condition, 'refsect')]
119 | sect4[starts-with(@condition, 'refsect')]
120 | sect5[starts-with(@condition, 'refsect')]
121 | section[starts-with(@condition, 'refsect')]
122 | simplesect[starts-with(@condition, 'refsect')]"
123 mode="object.title.template"
124 >
125 <xsl:call-template name="gentext.template">
126 <xsl:with-param name="context" select="'title-unnumbered'"/>
127 <xsl:with-param name="name">
128 <xsl:call-template name="xpath.location"/>
129 </xsl:with-param>
130 </xsl:call-template>
131</xsl:template>
132
133
134</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