summaryrefslogtreecommitdiff
path: root/templates/du2html.xsl
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2009-08-17 10:54:50 +0200
committerdakkar <dakkar@thenautilus.net>2009-08-17 10:54:50 +0200
commitf3b6e73ca1fcf29731cc2a85114c41fad87d0d96 (patch)
tree452b0c5a8612aceb6975e530193c57dafaba36e7 /templates/du2html.xsl
parentCV updated (diff)
downloadthenautilus-f3b6e73ca1fcf29731cc2a85114c41fad87d0d96.tar.gz
thenautilus-f3b6e73ca1fcf29731cc2a85114c41fad87d0d96.tar.bz2
thenautilus-f3b6e73ca1fcf29731cc2a85114c41fad87d0d96.zip
moved stuff around
it's a good idea to separate the documents from the templates
Diffstat (limited to 'templates/du2html.xsl')
-rw-r--r--templates/du2html.xsl108
1 files changed, 108 insertions, 0 deletions
diff --git a/templates/du2html.xsl b/templates/du2html.xsl
new file mode 100644
index 0000000..0e40c2a
--- /dev/null
+++ b/templates/du2html.xsl
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="utf-8"?>
+<x:stylesheet xmlns:x="http://www.w3.org/1999/XSL/Transform"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:wc="http://webcoso.thenautilus.net/"
+ version="1.0"
+ >
+
+ <x:import href="reST.xsl"/>
+
+ <x:param name="language" select="'en'"/>
+ <x:param name="path"/>
+ <x:param name="filename"/>
+
+ <x:output method="html" encoding="utf-8"
+ doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
+ indent="yes"/>
+
+ <x:template match="reference">
+ <x:element name="a">
+ <x:attribute name="href">
+ <x:choose>
+ <x:when test="@refid">
+ <x:value-of select="concat('#', @refid)" />
+ </x:when>
+ <x:when test="@refuri">
+ <x:value-of select="@refuri" />
+ </x:when>
+ </x:choose>
+ </x:attribute>
+
+ <x:choose>
+ <x:when test="@refuri and string(.)=string(@refuri)">
+ <x:apply-templates select="wc:title-for($language,$filename,@refuri)"/>
+ </x:when>
+ <x:otherwise>
+ <x:apply-templates />
+ </x:otherwise>
+ </x:choose>
+ </x:element>
+ </x:template>
+
+ <x:template match="/document">
+ <html xml:lang="{$language}" lang="{$language}">
+ <head>
+ <title><x:value-of select="title"/></title>
+ <style type="text/css"><![CDATA[
+ div.literal-block { white-space: pre }
+ ]]></style>
+ </head>
+ <body>
+ <div id="content">
+ <h1><x:apply-templates select="title/node()"/></h1>
+ <x:apply-templates/>
+ </div>
+ <x:copy-of select="wc:tagged()"/>
+ <div id="tags">
+ <x:apply-templates select="wc:tagged()"/>
+ </div>
+ <div id="dates">
+ <x:apply-templates select="wc:dates-for($language,$filename,'./')"/>
+ </div>
+ </body>
+ </html>
+ </x:template>
+
+ <x:template match="/wc:dates">
+ <span id="created">Creato: <span class="date created"><x:value-of select="wc:creation-date"/></span></span><x:text> </x:text>
+ <span id="lastmod">Ultima modifica: <span class="date lastmod"><x:value-of select="wc:last-change"/></span></span>
+ </x:template>
+
+ <x:template match="/wc:tags">
+ <dl>
+ <x:apply-templates/>
+ </dl>
+ </x:template>
+
+ <x:template match="wc:tag">
+ <x:value-of select="wc:message('wc:tag',.)"/>
+ <dt><span class="tag title"><x:apply-templates select="wc:title-for($language,$filename,concat('/tags/',@name,'/'))"/></span></dt>
+ <dd>
+ <ul>
+ <x:apply-templates/>
+ </ul>
+ </dd>
+ </x:template>
+
+ <x:template match="wc:doc">
+ <x:value-of select="wc:message('wc:doc',.)"/>
+ <li>
+ <a class="tag doc" href="{@uri}"><x:apply-templates select="wc:title-for($language,$filename,@uri)"/></a>
+ (<span class="tag doc langs"><x:apply-templates/></span>)
+ </li>
+ </x:template>
+
+ <x:template match="wc:lang">
+ <x:value-of select="wc:message('wc:lang',.)"/>
+ <x:choose>
+ <x:when test=".!=$language">
+ <a href="{../@uri}{.}" class="lang"><x:value-of select="."/></a>
+ </x:when>
+ <x:otherwise>
+ <span class="lang"><x:value-of select="."/></span>
+ </x:otherwise>
+ </x:choose>
+ <x:if test="following-sibling::wc:lang"> | </x:if>
+ </x:template>
+
+</x:stylesheet> \ No newline at end of file