Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixes issues with utf-8 when converting to html

  • Loading branch information...
commit 098120000960758cc8ddc191bbc76512c352c4f5 1 parent 2041366
Piotrek Wilczyński authored
Showing with 53 additions and 7 deletions.
  1. +9 −7 topy/src/todolist.py
  2. +44 −0 utilities/html/css/plain.css
16 topy/src/todolist.py
View
@@ -252,7 +252,7 @@ def as_html(self):
return "<ul>" + items_html + "</ul>"
def as_full_html(self, css_style=None):
- return """
+ return u"""
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
{1}
@@ -263,7 +263,7 @@ def as_full_html(self, css_style=None):
</div>
</body>""".format(
self.as_html(),
- """<link href="{0}" rel="stylesheet" type="text/css" />""".format(
+ u"""<link href="{0}" rel="stylesheet" type="text/css" />""".format(
css_style
) if css_style else ''
)
@@ -626,7 +626,7 @@ def as_html(self):
self.title.indent_level
)
- return '<li><span class="{type_class}{done_class}">{text}</span>{sub_tasks}</li>'.format(
+ return u'<li><span class="{type_class}{done_class}">{text}</span>{sub_tasks}</li>'.format(
type_class=self.type + str(css_class_level),
done_class=(
' done' if self.is_done() else ''
@@ -635,11 +635,13 @@ def as_html(self):
('\n' + self.sub_tasks.as_html())
if self.sub_tasks else ''
),
+ # text=unicode(self.title.text)
text=enclose_tags(
- escape(self.title.text),
- prefix='<span class="tag">',
- postfix='</span>'),
- )
+ unicode(escape(self.title.text)),
+ prefix=u'<span class="tag">',
+ postfix=u'</span>'
+ ),
+ )
def markdown_indent_level(self):
if self.parent_item:
44 utilities/html/css/plain.css
View
@@ -0,0 +1,44 @@
+body {
+ padding: 0;
+ width: 100%;
+ color: black;
+ font-family: Georgia;
+ line-height: 1.6em;
+ font-size: 100%;
+ word-wrap: break-word;
+}
+
+.project0, .project1, .project2, .project3, .project4, .project5{
+ font-family: Avenir;
+ font-weight: bold;
+}
+
+.project0{
+ font-size: 1.6em;
+}
+
+.project1{
+ font-size: 1.3em;
+}
+
+.project2{
+ font-size: 1.1em;
+}
+
+ .project3, .project4, .project5{
+ font-size: 0.9em;
+ }
+
+.note0, .note1, .note2, .note3, .note4, .note5{
+ color: gray;
+}
+
+.tag{
+ font-style: italic;
+ color: #19578A;
+}
+
+.done{
+ text-decoration: line-through;
+ color: gray;
+}
Please sign in to comment.
Something went wrong with that request. Please try again.