mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-18 12:08:31 +02:00
Use Unicode strings
and convert to .format()
This commit is contained in:
parent
115a5c705d
commit
dcfd15fb6a
1 changed files with 5 additions and 6 deletions
|
@ -68,14 +68,13 @@ def to_txt(journal):
|
||||||
def to_pelican(entry):
|
def to_pelican(entry):
|
||||||
"""Returns a markdown representation of the Journal with Pelican formatted
|
"""Returns a markdown representation of the Journal with Pelican formatted
|
||||||
front matter"""
|
front matter"""
|
||||||
out = ''
|
out = u''
|
||||||
out = out + 'Title: ' + entry.title + '\n'
|
out += u'Title: {}\n'.format(entry.title)
|
||||||
out = out + 'Date: ' + str(entry.date) + '\n'
|
out += u'Date: {}\n'.format(str(entry.date))
|
||||||
if entry.tags:
|
if entry.tags:
|
||||||
# drop tag symbol
|
# drop tag symbol
|
||||||
out = out + 'Tags: ' + ', '.join([tag[1:] for tag in entry.tags]) + '\n'
|
out += u'Tags: {}\n'.format(', '.join([tag[1:] for tag in entry.tags]))
|
||||||
out += '\n'
|
out += u'\n{}'.format(entry.body)
|
||||||
out += entry.body
|
|
||||||
return out
|
return out
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue