Let the other namespaces in!
[shapes.git] / doc / parts / extensions / formats / html.xsl
blobc104e6e698d073c86acb4cd3f5fe6b60d290a6de
1 <?xml version="1.0" encoding="UTF-8"?>
3 <!-- This file is part of Shapes. -->
4 <!-- -->
5 <!-- Shapes is free software: you can redistribute it and/or modify -->
6 <!-- it under the terms of the GNU General Public License as published by -->
7 <!-- the Free Software Foundation, either version 3 of the License, or -->
8 <!-- any later version. -->
9 <!-- -->
10 <!-- Shapes is distributed in the hope that it will be useful, -->
11 <!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
12 <!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
13 <!-- GNU General Public License for more details. -->
14 <!-- -->
15 <!-- You should have received a copy of the GNU General Public License -->
16 <!-- along with Shapes. If not, see <http://www.gnu.org/licenses/>. -->
17 <!-- -->
18 <!-- Copyright 2008 Henrik Tidefelt -->
20 <xsl:stylesheet
21 version="2.0"
22 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
23 xmlns="http://www.w3.org/1999/xhtml"
25 <xsl:output method="xml" indent="no"
26 doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
27 doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
30 <xsl:include href="../../formats/html.xsl" />
31 <xsl:include href="../../formats/bindings-html.xsl" />
32 <xsl:include href="../../formats/examplecode-html.xsl" />
33 <xsl:include href="../../formats/plain-book-html.xsl" />
34 <xsl:include href="../../formats/language-elements-html.xsl" />
36 <xsl:template match="alphabetical-index">
37 <xsl:variable name="ns"><xsl:value-of select="ancestor::book/namespace" /></xsl:variable>
38 <xsl:variable name="ext"><xsl:value-of select="ancestor::book/extension" /></xsl:variable>
39 <div class="p" style="text-align:center;"><b>Alphabetical index</b></div>
40 <div class="p" style="text-align:center;">
41 <xsl:for-each select="/book/external/toc/bindings/binding[@namespace = $ns and @extension = $ext]">
42 <xsl:sort select="@name" />
43 <xsl:if test="position() != 1"><xsl:text> </xsl:text></xsl:if>
44 <span class="horizontal-item">
45 <xsl:apply-templates mode="placed-binding" select="." />
46 </span>
47 </xsl:for-each>
48 </div>
49 <hr class="thin"/>
50 <xsl:apply-templates select="/book/namespace" />
51 <xsl:if test="/book/needs/a[@extension]">
52 <div class="p">
53 <b>Dependencies:</b>
54 <xsl:for-each select="/book/needs/a[@extension]">
55 <xsl:text>  </xsl:text>
56 <xsl:apply-templates select="."/>
57 </xsl:for-each>
58 </div>
59 </xsl:if>
60 <hr class="thin"/>
61 </xsl:template>
63 <xsl:template match="index-of-books">
64 <ul>
65 <xsl:apply-templates select="/book/external/book" />
66 </ul>
67 </xsl:template>
69 <xsl:template match="external/book">
70 <li>
71 <xsl:element name="a">
72 <xsl:attribute name="href"><xsl:apply-templates select="meta-selflink" /></xsl:attribute>
73 <b><xsl:apply-templates select="title" /></b>
74 </xsl:element>
75 <xsl:if test="prelude">
76 <xsl:text> (in standard prelude)</xsl:text>
77 </xsl:if>:
78 <xsl:apply-templates select="description" />
79 </li>
80 </xsl:template>
82 <xsl:template match="/book/namespace">
83 <div class="p">
84 <b>Namespace:</b><xsl:text>  </xsl:text>
85 <xsl:call-template name="name-to-linked-namespace">
86 <xsl:with-param name="name"><xsl:value-of select="." /></xsl:with-param>
87 </xsl:call-template>
88 </div>
89 </xsl:template>
91 </xsl:stylesheet>