summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/bupa8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/bupa b/scripts/bupa
index 0ed31e6..d0630f5 100755
--- a/scripts/bupa
+++ b/scripts/bupa
@@ -5,7 +5,7 @@ Options:
-h --help Show this screen.
"""
from jinja2 import Environment, FileSystemLoader
-import os, yaml, docopt
+import glob, yaml, docopt
from docutils import core
from docutils.writers.html4css1 import Writer
@@ -48,14 +48,14 @@ def parse(filename):
def build_journal(env):
template = env.get_template('journal.html')
entry_tmpl = env.get_template('entry.html')
- files = os.listdir('src/journal')
+ files = glob.glob('src/journal/*.rst')
files.sort(key=filename_to_id, reverse=True)
entries = []
for file in files:
- entry = parse('src/journal/' + file)
+ entry = parse(file)
entry.id = filename_to_id(file)
- entry.page = 'journal/' + file.split('.', 1)[0] + '.html'
+ entry.page = file.split('/', 1)[1].split('.', 1)[0] + '.html'
entry.body = reST_to_html(entry.body)
entries += [entry]
with open('build/'+entry.page, 'w') as file: