diff --git a/tiddly2kitaab.py b/tiddly2kitaab.py index defcd1f..b485b5c 100644 --- a/tiddly2kitaab.py +++ b/tiddly2kitaab.py @@ -15,19 +15,23 @@ def createFile(tiddler): # create the filename filename = created[2:8] # YYMMDD filename = filename + "-" - hour = title[-5:].replace(':', '') - filename = filename+hour+'.wiki' + hour = title[-5:] + time = hour.replace(':', '') + filename = filename+time+'.wiki' # handle tags allTags = ':' - for t in tags: + tagList = tags.replace('[', '').replace(']', '').split(' ') # Ugly one liner + for t in tagList: + if t == 'Journal': + t = 'jrnl' allTags = allTags + t + ':' # handle date date = created[:4] + '-' + created[4:6] + '-' + created[6:8] + ' ' + hour # create write list - writeList = ['%title {title}', allTags, '%date {date}', '', text] + writeList = ['%title {}\n'.format(title), allTags, '\n', '%date {}\n'.format(date), '\n', text] # create and write the file file = open('./jrnl/'+filename, 'w+')