-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtomboy-notes.xsl
More file actions
177 lines (154 loc) · 4.75 KB
/
tomboy-notes.xsl
File metadata and controls
177 lines (154 loc) · 4.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<?xml version='1.0' encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:tomboy="http://beatniksoftware.com/tomboy"
xmlns:notes="http://beatniksoftware.com/tomboy/notes"
xmlns:size="http://beatniksoftware.com/tomboy/size"
xmlns:link="http://beatniksoftware.com/tomboy/link"
version='1.0'>
<xsl:output method="html" indent="no" />
<xsl:preserve-space elements="*" />
<xsl:param name="font" />
<xsl:param name="export-linked" />
<xsl:param name="export-linked-all" />
<xsl:param name="root-note" />
<xsl:param name="newline" select="'
'" />
<xsl:template match="/">
<html>
<head>
<title>Tomboy Notes Export</title>
<style type="text/css">/*<![CDATA[*/
body { <xsl:value-of select="$font" /> }
h1 {
font-size: xx-large;
font-weight: bold;
border-bottom: 1px solid black;
}
div.note {
position: relative;
display: block;
padding: 5pt;
margin: 5pt;
white-space: -moz-pre-wrap; /* Mozilla */
white-space: -pre-wrap; /* Opera 4 - 6 */
white-space: -o-pre-wrap; /* Opera 7 */
white-space: pre-wrap; /* CSS3 */
word-wrap: break-word; /* IE 5.5+ */
}
table.note-info{
margin: 20px 0 5px;
font-size:xx-small;
border-width: 0 1px 1px 0;
border-style: solid;
}
table.note-info td{
padding: 2px 5px;
border-width: 1px 0 0 1px;
border-style: solid;
}
/*//]]>*/
</style>
</head>
<body>
<xsl:for-each select="notes/tomboy:note">
<div class="note">
<xsl:apply-templates select="tomboy:text | tomboy:title"/>
<table class="note-info" boder="0" cellpadding="0" cellspacing="0"
summary="Note Info">
<tr>
<td>Last updated:</td>
<td><xsl:value-of select="tomboy:last-change-date" /></td>
</tr>
<tr>
<td>Tags:</td>
<td>
<xsl:for-each select="tomboy:tags">
<div><xsl:value-of select="tomboy:tag"/></div>
</xsl:for-each>
</td>
</tr>
</table>
</div>
</xsl:for-each>
</body>
</html>
</xsl:template>
<!--<xsl:variable name="ignore-chars"><![CDATA[""]]></xsl:variable>-->
<xsl:template match="text()">
<!--<xsl:value-of select="translate(., $ignore-chars, '')"/>-->
<xsl:value-of select="."/>
</xsl:template>
<xsl:template match="child::tomboy:text">
<xsl:apply-templates select="node()"/>
</xsl:template>
<xsl:template match="tomboy:title">
<h1 name="{node()}" id="{node()}"><xsl:value-of select="text()"/></h1>
</xsl:template>
<xsl:template match="tomboy:bold">
<strong><xsl:apply-templates select="node()"/></strong>
</xsl:template>
<xsl:template match="tomboy:italic">
<i><xsl:apply-templates select="node()"/></i>
</xsl:template>
<xsl:template match="tomboy:monospace">
<code><xsl:apply-templates select="node()"/></code>
</xsl:template>
<xsl:template match="tomboy:strikethrough">
<strike><xsl:apply-templates select="node()"/></strike>
</xsl:template>
<xsl:template match="tomboy:highlight">
<span style="background:yellow"><xsl:apply-templates select="node()"/></span>
</xsl:template>
<xsl:template match="tomboy:datetime">
<span style="font-style:italic;font-size:small;color:#888A85">
<xsl:apply-templates select="node()"/>
</span>
</xsl:template>
<xsl:template match="size:small">
<span style="font-size:small"><xsl:apply-templates select="node()"/></span>
</xsl:template>
<xsl:template match="size:large">
<span style="font-size:large"><xsl:apply-templates select="node()"/></span>
</xsl:template>
<xsl:template match="size:huge">
<span style="font-size:xx-large"><xsl:apply-templates select="node()"/></span>
</xsl:template>
<xsl:template match="link:broken">
<span style="color:#555753;text-decoration:underline">
<xsl:value-of select="node()"/>
</span>
</xsl:template>
<xsl:template match="link:internal">
<a style="color:#204A87" href="#{node()}">
<xsl:value-of select="node()"/>
</a>
</xsl:template>
<xsl:template match="link:url">
<xsl:choose>
<xsl:when test="contains(node(), '@')">
<a style="color:#3465A4" href="mailto:{node()}"><xsl:value-of select="node()"/></a>
</xsl:when>
<xsl:otherwise>
<a style="color:#3465A4" href="{node()}"><xsl:value-of select="node()"/></a>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="tomboy:list">
<ul>
<xsl:apply-templates select="tomboy:list-item" />
</ul>
</xsl:template>
<xsl:template match="tomboy:list-item">
<li>
<xsl:if test="normalize-space(text()) = ''">
<xsl:attribute name="style">list-style-type: none</xsl:attribute>
</xsl:if>
<xsl:attribute name="dir">
<xsl:value-of select="@dir"/>
</xsl:attribute>
<xsl:apply-templates select="node()" />
</li>
</xsl:template>
<xsl:template match="//tomboy:x | //tomboy:y | //tomboy:width | //tomboy:height | //tomboy:cursor-position | //tomboy:create-date | tomboy:last-change-date | tomboy:open-on-startup | tomboy:last-metadata-change-date | tomboy:tags">
<xsl:comment>literal</xsl:comment>
</xsl:template>
</xsl:stylesheet>