diff --git a/bin/_ttbp.py b/bin/_ttbp.py index 596c92c..50200b0 100644 --- a/bin/_ttbp.py +++ b/bin/_ttbp.py @@ -416,6 +416,9 @@ thanks to everyone who reads, listens, writes, and feels.\ def write_entry(entry=os.path.join(DATA, "test.txt")): entered = raw_input(""" +"""+util.hilight("new feature!")+""" you can now use standard markdown in +your entry text! raw html is still valid, and you can mix them together. + feels will be recorded for today, """+time.strftime("%d %B %Y")+""". if you've already started recording feels for this day, you diff --git a/bin/core.py b/bin/core.py index eb6d353..e768474 100644 --- a/bin/core.py +++ b/bin/core.py @@ -4,6 +4,7 @@ import os import time import subprocess import re +import mistune import chatter @@ -50,7 +51,6 @@ def load_files(): FILES = [] for filename in os.listdir(DATA): filename = os.path.join(DATA, filename) - #if os.path.isfile(filename) and os.path.splitext(filename)[1] == ".txt": if os.path.isfile(filename) and valid(filename): FILES.append(filename) @@ -114,8 +114,8 @@ def write_entry(filename): entry = [ "\t\t
\n", "\t\t" + "\t\t\t
" ] raw = [] @@ -125,12 +125,14 @@ def write_entry(filename): raw.append(line) rawfile.close() - for line in raw: - entry.append(line+"\t\t\t") - if line == "\n": - entry.append("
\n\t\t\t") + entry.append("\t\t\t"+mistune.markdown("".join(raw), escape=False, hard_wrap=False)) - entry.append("
\n") + #for line in raw: + #entry.append(line+"\t\t\t") + #if line == "\n": + # entry.append("\n\t\t\t") + + #entry.append("
\n") entry.append("\t\t\t\n") entry.append("\n\t\t%s\n
\n' % code
+ code = escape(code, quote=True, smart_amp=False)
+ return '%s\n
\n' % (lang, code)
+
+ def block_quote(self, text):
+ """Rendering with the given text. + + :param text: text content of the blockquote. + """ + return '%s\n\n' % text.rstrip('\n') + + def block_html(self, html): + """Rendering block level pure html content. + + :param html: text content of the html snippet. + """ + if self.options.get('skip_style') and \ + html.lower().startswith('