Fix doc toc misses
[shapes.git] / doc / parts / formats / plain-book-html.xsl
blobdd0d56a112811adfbe428c015a58b053fbd97603
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"
26 <xsl:template match="/book">
27 <html>
28 <head>
29 <title><xsl:apply-templates select="title" /></title>
30 <xsl:element name="link">
31 <xsl:attribute name="rel">stylesheet</xsl:attribute>
32 <xsl:attribute name="href"><xsl:value-of select="/book/base/@href" />shapes.css</xsl:attribute>
33 </xsl:element>
34 </head>
35 <body>
36 <xsl:if test="under-development"><xsl:call-template name="under-development-banner" /></xsl:if>
37 <xsl:call-template name="head-navigation" />
38 <xsl:if test="prelude">
39 <h3>[standard prelude]</h3>
40 </xsl:if>
41 <h2><xsl:apply-templates select="title" /></h2>
42 <hr class="thick"/>
43 <xsl:apply-templates select="top" />
45 <xsl:if test="section">
46 <div class="p">
47 <b>Sections:</b>
48 <xsl:for-each select="section">
49   
50 <xsl:element name="a">
51 <xsl:attribute name="href">#<xsl:call-template name="id-to-anchor-name"><xsl:with-param name="id"><xsl:value-of select="@id" /></xsl:with-param></xsl:call-template></xsl:attribute>
52 <xsl:apply-templates select="title" />
53 </xsl:element>
54 </xsl:for-each>
55 </div>
56 </xsl:if>
58 <xsl:if test="body and not(section)">
59 <xsl:apply-templates select="body" />
60 </xsl:if>
62 <xsl:for-each select="section">
63 <hr class="thin"/>
64 <xsl:choose>
65 <xsl:when test="@id">
66 <h3>
67 <xsl:element name="a">
68 <xsl:attribute name="name"><xsl:call-template name="id-to-anchor-name"><xsl:with-param name="id"><xsl:value-of select="@id" /></xsl:with-param></xsl:call-template></xsl:attribute>
69 <xsl:apply-templates select="title" />
70 </xsl:element>
71 </h3>
72 </xsl:when>
73 <xsl:otherwise>
74 <h3><xsl:apply-templates select="title" /></h3>
75 </xsl:otherwise>
76 </xsl:choose>
77 <xsl:apply-templates select="top" />
78 <xsl:apply-templates select="body" />
79 <xsl:for-each select="section">
80 <xsl:choose>
81 <xsl:when test="@id">
82 <h4>
83 <xsl:element name="a">
84 <xsl:attribute name="name"><xsl:call-template name="id-to-anchor-name"><xsl:with-param name="id"><xsl:value-of select="@id" /></xsl:with-param></xsl:call-template></xsl:attribute>
85 <xsl:apply-templates select="title" />
86 </xsl:element>
87 </h4>
88 </xsl:when>
89 <xsl:otherwise>
90 <h4><xsl:apply-templates select="title" /></h4>
91 </xsl:otherwise>
92 </xsl:choose>
93 <xsl:apply-templates select="top" />
94 <xsl:apply-templates select="body" />
95 <xsl:for-each select="section">
96 <xsl:choose>
97 <xsl:when test="@id">
98 <h5>
99 <xsl:element name="a">
100 <xsl:attribute name="name"><xsl:call-template name="id-to-anchor-name"><xsl:with-param name="id"><xsl:value-of select="@id" /></xsl:with-param></xsl:call-template></xsl:attribute>
101 <xsl:apply-templates select="title" />
102 </xsl:element>
103 </h5>
104 </xsl:when>
105 <xsl:otherwise>
106 <h5><xsl:apply-templates select="title" /></h5>
107 </xsl:otherwise>
108 </xsl:choose>
109 <xsl:apply-templates select="top" />
110 <xsl:apply-templates select="body" />
111 </xsl:for-each>
112 </xsl:for-each>
113 </xsl:for-each>
114 <xsl:call-template name="SF-placeholder" />
115 </body>
116 </html>
117 <!-- Finally, a newline at end of file. -->
118 <xsl:text>
119 </xsl:text>
120 </xsl:template>
123 </xsl:stylesheet>