Release 0.7.8
[vala-lang.git] / doc / vala / xhtml.xsl
blob607fbaccda6821af55aec078ca92c3a687ef7cb5
1 <?xml version="1.0"?>
2 <xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.1">
3 <xsl:output method="xml" indent="yes" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"/>
4 <xsl:strip-space elements="blockquote/l"/>
5 <xsl:template match="/">
6 <xsl:apply-templates select="html"/>
7 </xsl:template>
8 <xsl:template match="html">
9 <html><xsl:apply-templates select="head|body"/></html>
10 </xsl:template>
11 <xsl:template match="head">
12 <head>
13 <xsl:apply-templates select="title"/>
14 <link rel="stylesheet" type="text/css" href="default.css"/>
15 </head>
16 </xsl:template>
17 <xsl:template match="title">
18 <title><xsl:value-of select="."/></title>
19 </xsl:template>
20 <xsl:template match="body">
21 <body>
22 <div class="header">
23 <a href="index.html"><xsl:value-of select="//title/text()"/></a>
24 </div>
25 <xsl:apply-templates select="h|p|section"/>
26 <ul class="toc">
27 <xsl:for-each select="section">
28 <li>
29 <a href="{@id}.html"><xsl:value-of select="h/text()"/></a>
30 <xsl:if test="count(section) > 0">
31 <ul>
32 <xsl:for-each select="section">
33 <li><a href="{../@id}.html#{@id}"><xsl:value-of select="h/text()"/></a></li>
34 </xsl:for-each>
35 </ul>
36 </xsl:if>
37 </li>
38 </xsl:for-each>
39 </ul>
40 </body>
41 </xsl:template>
42 <xsl:template match="body/h">
43 <h1><xsl:value-of select="text()"/></h1>
44 </xsl:template>
45 <xsl:template match="body/section">
46 <xsl:document href="{@id}.html" method="xml" indent="yes">
47 <html>
48 <head>
49 <title><xsl:value-of select="h/text()"/> - <xsl:value-of select="//title/text()"/></title>
50 <link rel="stylesheet" type="text/css" href="default.css"/>
51 </head>
52 <body>
53 <div class="header">
54 <a href="index.html"><xsl:value-of select="//title/text()"/></a>
55 </div>
56 <xsl:apply-templates select="h|p|section|div|blockcode|blockquote|ol|ul"/>
57 </body>
58 </html>
59 </xsl:document>
60 </xsl:template>
61 <xsl:template match="body/section/h">
62 <h2><xsl:value-of select="text()"/></h2>
63 </xsl:template>
64 <xsl:template match="body/section/section">
65 <xsl:apply-templates select="h|p|div|blockcode|blockquote|section|ol|ul"/>
66 </xsl:template>
67 <xsl:template match="body/section/section/h">
68 <h3><xsl:value-of select="text()"/><a id="{../@id}"><xsl:text> </xsl:text></a></h3>
69 </xsl:template>
70 <xsl:template match="body/section/section/section">
71 <xsl:apply-templates select="h|p|div|blockcode|blockquote|section|ol|ul"/>
72 </xsl:template>
73 <xsl:template match="body/section/section/section/h">
74 <h4><xsl:value-of select="text()"/><a id="{../@id}"><xsl:text> </xsl:text></a></h4>
75 </xsl:template>
76 <xsl:template match="div[@role='note']">
77 <div class="note"><xsl:apply-templates select="h|p|blockcode|blockquote"/></div>
78 </xsl:template>
79 <xsl:template match="div/h">
80 <h4><xsl:value-of select="text()"/></h4>
81 </xsl:template>
82 <xsl:template match="p">
83 <p><xsl:apply-templates select="text()|code"/></p>
84 </xsl:template>
85 <xsl:template match="code">
86 <code><xsl:value-of select="text()"/></code>
87 </xsl:template>
88 <xsl:template match="blockcode">
89 <pre><xsl:value-of select="text()"/></pre>
90 </xsl:template>
91 <xsl:template match="blockquote">
92 <blockquote><xsl:apply-templates select="text()|l"/></blockquote>
93 </xsl:template>
94 <xsl:template match="blockquote/l">
95 <span class="literal"><xsl:value-of select="text()"/></span>
96 </xsl:template>
97 <xsl:template match="ol">
98 <ol><xsl:apply-templates select="item"/></ol>
99 </xsl:template>
100 <xsl:template match="ul">
101 <ul><xsl:apply-templates select="item"/></ul>
102 </xsl:template>
103 <xsl:template match="ol/item|ul/item">
104 <li><xsl:value-of select="text()"/></li>
105 </xsl:template>
106 </xsl:stylesheet>