VirtualBox

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

最後變更 在這個檔案從56482是 56482,由 vboxsync 提交於 9 年 前

Made docbook-refentry-to-manual-sect1.xsl produce valid docbook xml but with a few hints that can be used for nice manpage-like formatting.

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 4.9 KB
 
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
59<!--
60 refentry related layout tweaks.
61
62 Note! While we could save us all this work by using refsect1..3 and
63 refsynopsisdiv docbook-refentry-to-manual-sect1.xsl, we'd like to have
64 a valid XML document and thus do do some extra markup using the role
65 and condition attributes. We catch some of it here. But the XSLT
66 for specific targets (html, latex, etc) have a few more tweaks
67 related to this.
68
69 The @role has only one special trick 'not-in-toc' that excludes sections
70 like 'Synopsis' and 'Description' from the TOCs.
71
72 The @condition records the original refentry element name, i.e. it will
73 have values like refentry, refsynopsisdiv, refsect1, refsect2 and refsect3.
74 -->
75
76<!-- This removes the not-in-toc bits from the toc. -->
77<xsl:template match="sect2[@role = 'not-in-toc']" mode="toc" />
78<xsl:template match="sect3[@role = 'not-in-toc']" mode="toc" />
79<xsl:template match="sect4[@role = 'not-in-toc']" mode="toc" />
80<xsl:template match="sect5[@role = 'not-in-toc']" mode="toc" />
81<xsl:template match="section[@role = 'not-in-toc']" mode="toc" />
82<xsl:template match="simplesect[@role = 'not-in-toc']" mode="toc" />
83
84<!-- This removes unnecessary <dd><dl> stuff caused by the above. -->
85<xsl:template match="sect1[sect2/@role = 'not-in-toc']" mode="toc">
86 <xsl:param name="toc-context" select="."/>
87 <xsl:call-template name="subtoc">
88 <xsl:with-param name="toc-context" select="$toc-context"/>
89 <xsl:with-param name="nodes" select="sect2[@role != 'not-in-toc'] | bridgehead[$bridgehead.in.toc != 0]"/>
90 </xsl:call-template>
91</xsl:template>
92
93<xsl:template match="sect2[sect3/@role = 'not-in-toc']" mode="toc">
94 <xsl:param name="toc-context" select="."/>
95 <xsl:call-template name="subtoc">
96 <xsl:with-param name="toc-context" select="$toc-context"/>
97 <xsl:with-param name="nodes" select="sect3[@role != 'not-in-toc'] | bridgehead[$bridgehead.in.toc != 0]"/>
98 </xsl:call-template>
99</xsl:template>
100
101<!-- This make the refsect* and refsynopsisdiv unnumbered like the default refentry rendering. -->
102<xsl:template match="sect2[@condition = 'refsynopsisdiv']
103 | sect2[starts-with(@condition, 'refsect')]
104 | sect3[starts-with(@condition, 'refsect')]
105 | sect4[starts-with(@condition, 'refsect')]
106 | sect5[starts-with(@condition, 'refsect')]
107 | section[starts-with(@condition, 'refsect')]
108 | simplesect[starts-with(@condition, 'refsect')]"
109 mode="object.title.template"
110 >
111 <xsl:call-template name="gentext.template">
112 <xsl:with-param name="context" select="'title-unnumbered'"/>
113 <xsl:with-param name="name">
114 <xsl:call-template name="xpath.location"/>
115 </xsl:with-param>
116 </xsl:call-template>
117</xsl:template>
118
119
120</xsl:stylesheet>
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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