This commit is contained in:
Anish Lakhwara 2020-10-20 22:55:13 +10:00
parent 0017b074f0
commit c17cec9b46

View file

@ -15,19 +15,23 @@ def createFile(tiddler):
# create the filename # create the filename
filename = created[2:8] # YYMMDD filename = created[2:8] # YYMMDD
filename = filename + "-" filename = filename + "-"
hour = title[-5:].replace(':', '') hour = title[-5:]
filename = filename+hour+'.wiki' time = hour.replace(':', '')
filename = filename+time+'.wiki'
# handle tags # handle tags
allTags = ':' 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 + ':' allTags = allTags + t + ':'
# handle date # handle date
date = created[:4] + '-' + created[4:6] + '-' + created[6:8] + ' ' + hour date = created[:4] + '-' + created[4:6] + '-' + created[6:8] + ' ' + hour
# create write list # 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 # create and write the file
file = open('./jrnl/'+filename, 'w+') file = open('./jrnl/'+filename, 'w+')