Mercurial > hgbook
annotate stylesheets/base-html-stylesheet.xsl @ 838:d1f676a6a4b3 default tip
update mq chapter.
propagate ef53d025f410.
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Thu, 03 Dec 2009 01:26:08 +0900 |
parents | d8c85d831fb4 |
children |
rev | line source |
---|---|
656 | 1 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'> |
2 | |
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> | |
6 | |
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> | |
14 | |
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> | |
23 | |
24 <xsl:template match="sect2" mode="toc"> | |
25 <xsl:param name="toc-context" select="."/> | |
26 | |
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> | |
33 | |
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"/> | |
39 | |
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> | |
57 | |
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> | |
69 | |
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'"/> | |
75 | |
76 <xsl:call-template name="anchor"/> | |
77 | |
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> | |
85 | |
86 <xsl:apply-templates select="." mode="class.attribute"/> | |
87 <xsl:call-template name="apply-highlighting"/> | |
88 </pre> | |
89 </xsl:template> | |
90 | |
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"/> | |
94 | |
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> | |
98 | |
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> | |
107 | |
108 <xsl:template name="user.footer.content"> | |
696
e0d9eb01e4c2
Remove references to RWH.
Bryan O'Sullivan <bos@serpentine.com>
parents:
672
diff
changeset
|
109 <div class="hgfooter"> |
656 | 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> |
672
40025381bded
Get the copyright years right
Bryan O'Sullivan <bos@serpentine.com>
parents:
656
diff
changeset
|
111 <p>Copyright 2006, 2007, 2008, 2009 Bryan O'Sullivan. |
656 | 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> | |
115 | |
116 <xsl:template name="user.footer.navigation"> | |
699
c3c5b964901e
Update Google Analytics info
Bryan O'Sullivan <bos@serpentine.com>
parents:
696
diff
changeset
|
117 <script type="text/javascript"> |
c3c5b964901e
Update Google Analytics info
Bryan O'Sullivan <bos@serpentine.com>
parents:
696
diff
changeset
|
118 var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); |
c3c5b964901e
Update Google Analytics info
Bryan O'Sullivan <bos@serpentine.com>
parents:
696
diff
changeset
|
119 document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); |
c3c5b964901e
Update Google Analytics info
Bryan O'Sullivan <bos@serpentine.com>
parents:
696
diff
changeset
|
120 </script> |
c3c5b964901e
Update Google Analytics info
Bryan O'Sullivan <bos@serpentine.com>
parents:
696
diff
changeset
|
121 <script type="text/javascript"> |
c3c5b964901e
Update Google Analytics info
Bryan O'Sullivan <bos@serpentine.com>
parents:
696
diff
changeset
|
122 try { |
c3c5b964901e
Update Google Analytics info
Bryan O'Sullivan <bos@serpentine.com>
parents:
696
diff
changeset
|
123 var pageTracker = _gat._getTracker("UA-1805907-5"); |
c3c5b964901e
Update Google Analytics info
Bryan O'Sullivan <bos@serpentine.com>
parents:
696
diff
changeset
|
124 pageTracker._trackPageview(); |
c3c5b964901e
Update Google Analytics info
Bryan O'Sullivan <bos@serpentine.com>
parents:
696
diff
changeset
|
125 } catch(err) {}</script> |
656 | 126 </xsl:template> |
127 </xsl:stylesheet> |