def show_acknowledgements(): acknowledgements = [] with app.open_resource("tex/documentation/support", mode="r") as f: for line in f: if line.startswith("%") or line.isspace(): continue acknowledgements.append(line) return render_template("single/acknowledgements.html", acknowledgements=acknowledgements)
def show_contributors(): contributors = [] with app.open_resource("tex/CONTRIBUTORS") as f: for line in f: line = line.decode("utf-8") if line.startswith("%") or line.isspace(): continue contributors.append(line) return render_template("single/contributors.html", contributors=contributors)
def show_recent_changes(): changes = dict() with app.open_resource("changes.md", mode="r") as f: date = None for line in f: # new item starts with date if line.startswith("#"): date = dateutil.parser.parse(line[2:].strip()) changes[date] = "" elif date != None: changes[date] = changes[date] + line # turn Markdown into HTML changes.update({date: sfm(change) for date, change in changes.items()}) years = list(set([date.year for date in changes])) changes = { year: [(date, changes[date]) for date in changes if date.year == year] for year in years } return render_template("kerodon/changes.html", changes=changes)