~ubuntu-branches/ubuntu/dapper/tomboy/dapper-updates

« back to all changes in this revision

Viewing changes to Tomboy/Plugins/ExportToHTML.xsl

  • Committer: Bazaar Package Importer
  • Author(s): Brandon Hale
  • Date: 2005-11-07 20:31:42 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051107203142-nij38ihshxir8e0y
Tags: 0.3.3-2ubuntu1
* Resynchronise with Debian.
* Drop 02_mono1.1.9.patch, added to Debian as 02_Trie.cs_mcs119.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version='1.0'?>
 
2
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 
3
                xmlns:tomboy="http://beatniksoftware.com/tomboy"
 
4
                xmlns:size="http://beatniksoftware.com/tomboy/size"
 
5
                xmlns:link="http://beatniksoftware.com/tomboy/link"
 
6
                version='1.0'>
 
7
 
 
8
<xsl:output method="html" indent="no" />
 
9
<xsl:preserve-space elements="*" />
 
10
 
 
11
<xsl:param name="font" />
 
12
<xsl:param name="export-linked" />
 
13
<xsl:param name="root-note" />
 
14
 
 
15
<xsl:param name="newline" select="'&#xA;'" />
 
16
 
 
17
<xsl:template match="/">
 
18
        <html>
 
19
        <head>
 
20
        <title><xsl:value-of select="/tomboy:note/tomboy:title" /></title>
 
21
        <style type="text/css">
 
22
        body { <xsl:value-of select="$font" /> }
 
23
        h1 { font-size: xx-large;
 
24
             font-weight: bold;
 
25
             color: red;
 
26
             text-decoration: underline; }
 
27
        div.note { overflow: auto;
 
28
                   position: relative;
 
29
                   border: 1px solid black;
 
30
                   display: block;
 
31
                   padding: 5pt;
 
32
                   margin: 5pt; 
 
33
                   white-space: -moz-pre-wrap; /* Mozilla */
 
34
                   white-space: -pre-wrap;     /* Opera 4 - 6 */
 
35
                   white-space: -o-pre-wrap;   /* Opera 7 */
 
36
                   white-space: pre-wrap;      /* CSS3 */
 
37
                   word-wrap: break-word;      /* IE 5.5+ */ }
 
38
        </style>
 
39
        </head>
 
40
        <body>
 
41
 
 
42
        <xsl:apply-templates select="tomboy:note"/>
 
43
 
 
44
        </body>
 
45
        </html>
 
46
</xsl:template>
 
47
 
 
48
<xsl:template match="tomboy:note">
 
49
        <xsl:apply-templates select="tomboy:text"/>
 
50
</xsl:template>
 
51
 
 
52
<xsl:template match="tomboy:text">
 
53
        <div class="note" 
 
54
             id="{/tomboy:note/tomboy:title}"
 
55
             style="width:{/tomboy:note/tomboy:width};">
 
56
                <a name="#{/tomboy:note/tomboy:title}" />
 
57
                <xsl:apply-templates select="node()" />
 
58
        </div>
 
59
 
 
60
        <xsl:if test="/tomboy:note/tomboy:title = $root-note">
 
61
                <xsl:if test="$export-linked">
 
62
                        <xsl:apply-templates select="document(.//link:internal/text())/node()" />
 
63
                </xsl:if>
 
64
        </xsl:if>
 
65
</xsl:template>
 
66
 
 
67
<xsl:template match="tomboy:note/tomboy:text/*[1]/text()[1]">
 
68
        <h1><xsl:value-of select="substring-before(., $newline)"/></h1>
 
69
        <xsl:value-of select="substring-after(., $newline)"/>
 
70
</xsl:template>
 
71
 
 
72
<xsl:template match="tomboy:bold">
 
73
        <b><xsl:apply-templates select="node()"/></b>
 
74
</xsl:template>
 
75
 
 
76
<xsl:template match="tomboy:italic">
 
77
        <i><xsl:apply-templates select="node()"/></i>
 
78
</xsl:template>
 
79
 
 
80
<xsl:template match="tomboy:strikethrough">
 
81
        <strike><xsl:apply-templates select="node()"/></strike>
 
82
</xsl:template>
 
83
 
 
84
<xsl:template match="tomboy:highlight">
 
85
        <span style="background:yellow"><xsl:apply-templates select="node()"/></span>
 
86
</xsl:template>
 
87
 
 
88
<xsl:template match="size:small">
 
89
        <span style="font-size:small"><xsl:apply-templates select="node()"/></span>
 
90
</xsl:template>
 
91
 
 
92
<xsl:template match="size:large">
 
93
        <span style="font-size:large"><xsl:apply-templates select="node()"/></span>
 
94
</xsl:template>
 
95
 
 
96
<xsl:template match="size:huge">
 
97
        <span style="font-size:xx-large"><xsl:apply-templates select="node()"/></span>
 
98
</xsl:template>
 
99
 
 
100
<xsl:template match="link:broken">
 
101
        <span style="color:silver"><u><xsl:value-of select="node()"/></u></span>
 
102
</xsl:template>
 
103
 
 
104
<xsl:template match="link:internal">
 
105
        <a style="color:red" href="#{document(node())/tomboy:note/tomboy:title}">
 
106
                <xsl:value-of select="node()"/>
 
107
        </a>
 
108
</xsl:template>
 
109
 
 
110
<xsl:template match="link:url">
 
111
        <a href="{node()}"><xsl:value-of select="node()"/></a>
 
112
</xsl:template>
 
113
 
 
114
</xsl:stylesheet>
 
115