hgbook

view stylesheets/base-html-stylesheet.xsl @ 639:1a3d882149fd

Set chunker.output.encoding to 'utf-8'
author Dongsheng Song <dongsheng.song@gmail.com>
date Mon Mar 16 17:49:05 2009 +0800 (2009-03-16)
parents 40025381bded
children 1c13ed2130a7
line source
1 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
3 <xsl:param name="html.stylesheet">/support/styles.css</xsl:param>
4 <xsl:param name="toc.section.depth">3</xsl:param>
5 <xsl:param name="annotate.toc">0</xsl:param>
7 <xsl:param name="generate.id.attributes" select="1"></xsl:param>
8 <xsl:param name="header.rule" select="0"></xsl:param>
9 <xsl:param name="footer.rule" select="0"></xsl:param>
10 <xsl:param name="html.cleanup" select="1"></xsl:param>
11 <xsl:param name="admon.style"><xsl:text></xsl:text></xsl:param>
12 <xsl:param name="admon.graphics" select="1"></xsl:param>
13 <xsl:param name="admon.graphics.path">/support/figs/</xsl:param>
15 <xsl:template match="sect1" mode="toc">
16 <xsl:param name="toc-context" select="."/>
17 <xsl:call-template name="subtoc">
18 <xsl:with-param name="toc-context" select="$toc-context"/>
19 <xsl:with-param name="nodes"
20 select="sect2|refentry|bridgehead[$bridgehead.in.toc != 0]"/>
21 </xsl:call-template>
22 </xsl:template>
24 <xsl:template match="sect2" mode="toc">
25 <xsl:param name="toc-context" select="."/>
27 <xsl:call-template name="subtoc">
28 <xsl:with-param name="toc-context" select="$toc-context"/>
29 <xsl:with-param name="nodes"
30 select="sect3|refentry|bridgehead[$bridgehead.in.toc != 0]"/>
31 </xsl:call-template>
32 </xsl:template>
34 <!-- Add id attributes to <p> tags. This is mostly a copy of the
35 base XSL. -->
36 <xsl:template name="paragraph">
37 <xsl:param name="class" select="''"/>
38 <xsl:param name="content"/>
40 <xsl:variable name="p">
41 <p>
42 <xsl:call-template name="dir"/>
43 <xsl:if test="$class != ''">
44 <xsl:apply-templates select="." mode="class.attribute">
45 <xsl:with-param name="class" select="$class"/>
46 </xsl:apply-templates>
47 </xsl:if>
48 <!-- Here we go. -->
49 <xsl:if test="$generate.id.attributes != 0">
50 <xsl:attribute name="id">
51 <xsl:call-template name="object.id"/>
52 </xsl:attribute>
53 </xsl:if>
54 <xsl:copy-of select="$content"/>
55 </p>
56 </xsl:variable>
58 <xsl:choose>
59 <xsl:when test="$html.cleanup != 0">
60 <xsl:call-template name="unwrap.p">
61 <xsl:with-param name="p" select="$p"/>
62 </xsl:call-template>
63 </xsl:when>
64 <xsl:otherwise>
65 <xsl:copy-of select="$p"/>
66 </xsl:otherwise>
67 </xsl:choose>
68 </xsl:template>
70 <!-- Add id attributes to <programlisting> and <screen> tags. Once
71 again, this is mostly a copy of the base XSL, although rather
72 trimmed down. -->
73 <xsl:template match="programlisting|screen">
74 <xsl:param name="suppress-numbers" select="'0'"/>
76 <xsl:call-template name="anchor"/>
78 <pre>
79 <!-- Here we go. -->
80 <xsl:if test="$generate.id.attributes != 0">
81 <xsl:attribute name="id">
82 <xsl:call-template name="object.id"/>
83 </xsl:attribute>
84 </xsl:if>
86 <xsl:apply-templates select="." mode="class.attribute"/>
87 <xsl:call-template name="apply-highlighting"/>
88 </pre>
89 </xsl:template>
91 <!-- The default stylesheet generates a little TOC at the beginning
92 of each qandaset. Uh, no thanks. -->
93 <xsl:template name="process.qanda.toc"/>
95 <xsl:template name="user.header.navigation">
96 <div class="navheader"><h2 class="booktitle"><a href="/">Mercurial: The Definitive Guide</a> <span class="authors">by Bryan O'Sullivan</span></h2></div>
97 </xsl:template>
99 <xsl:template name="user.head.content">
100 <link rel="alternate" type="application/atom+xml" title="Comments"
101 href="/feeds/comments/"/>
102 <link rel="shortcut icon" type="image/png" href="/support/figs/favicon.png"/>
103 <script type="text/javascript" src="/support/jquery-min.js"></script>
104 <script type="text/javascript" src="/support/form.js"></script>
105 <script type="text/javascript" src="/support/hsbook.js"></script>
106 </xsl:template>
108 <xsl:template name="user.footer.content">
109 <div class="rwhfooter">
110 <p><img src="/support/figs/rss.png"/> Want to stay up to date? Subscribe to the comment feed for <a id="chapterfeed" class="feed" href="/feeds/comments/">this chapter</a>, or the <a class="feed" href="/feeds/comments/">entire book</a>.</p>
111 <p>Copyright 2006, 2007, 2008, 2009 Bryan O'Sullivan.
112 Icons by <a href="mailto:mattahan@gmail.com">Paul Davey</a> aka <a href="http://mattahan.deviantart.com/">Mattahan</a>.</p>
113 </div>
114 </xsl:template>
116 <xsl:template name="user.footer.navigation">
117 <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
118 <script type="text/javascript">_uacct = "UA-1805907-3"; urchinTracker();</script>
119 </xsl:template>
120 </xsl:stylesheet>