From b8cd2d937eb0e305509d1ffc70a52315320541c8 Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Wed, 15 Oct 2014 18:39:56 +0100 Subject: refactor bupa slightly, add isso comments on separate entry pages --- scripts/bupa | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'scripts/bupa') diff --git a/scripts/bupa b/scripts/bupa index b982ec8..0ed31e6 100755 --- a/scripts/bupa +++ b/scripts/bupa @@ -46,16 +46,21 @@ def parse(filename): return page def build_journal(env): - template = env.get_template('journal.html') + template = env.get_template('journal.html') + entry_tmpl = env.get_template('entry.html') files = os.listdir('src/journal') files.sort(key=filename_to_id, reverse=True) entries = [] for file in files: entry = parse('src/journal/' + file) - entry.body = reST_to_html(entry.body) entry.id = filename_to_id(file) + entry.page = 'journal/' + file.split('.', 1)[0] + '.html' + entry.body = reST_to_html(entry.body) entries += [entry] + with open('build/'+entry.page, 'w') as file: + file.write(entry_tmpl.render(entry=entry, title='~/journal', + header='The lost journal')) with open('build/journal.html', 'w') as file: file.write(template.render(entries=entries, title='~/journal', header='The lost journal')) -- cgit v1.2.3-70-g09d2