diff options
author | jwansek <eddie.atten.ea29@gmail.com> | 2022-03-12 19:50:03 +0000 |
---|---|---|
committer | jwansek <eddie.atten.ea29@gmail.com> | 2022-03-12 19:50:03 +0000 |
commit | c7fea1d2c78e77654f098f9ac7409f97ad171f44 (patch) | |
tree | c637935478b24bd3d89490148eb8528ec1e39d2a /app.py | |
parent | ae079307387d1e97a7ae425dc9c110cafd873116 (diff) | |
download | eda.gay-c7fea1d2c78e77654f098f9ac7409f97ad171f44.tar.gz eda.gay-c7fea1d2c78e77654f098f9ac7409f97ad171f44.zip |
switched to mistune (over misaka) for markdown parsing, added table of contents
Diffstat (limited to 'app.py')
-rw-r--r-- | app.py | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -57,7 +57,7 @@ def index(): return flask.render_template( "index.jinja", **get_template_items("eden's site :3", db), - markdown = parser.parse_text(f.read()), + markdown = parser.parse_text(f.read())[0], featured_thoughts = db.get_featured_thoughts(), tweets = db.get_cached_tweets(7) + [("view all tweets...", db.get_my_twitter())], commits = db.get_cached_commits(since = datetime.datetime.now() - datetime.timedelta(days = 7)) @@ -93,7 +93,8 @@ def get_thought(): thought_id = flask.request.args.get("id", type=int) with database.Database() as db: try: - category_name, title, dt, parsed = parser.get_thought_from_id(db, thought_id) + category_name, title, dt, parsed, headers = parser.get_thought_from_id(db, thought_id) + print(headers) except TypeError: flask.abort(404) return @@ -102,6 +103,7 @@ def get_thought(): **get_template_items(title, db), thought = True, dt = "published: " + str(dt), + headers = headers, category = category_name, othercategories = db.get_categories_not(category_name), related = db.get_similar_thoughts(category_name, thought_id) |