aboutsummaryrefslogtreecommitdiffstats
path: root/app.py
diff options
context:
space:
mode:
authorjwansek <eddie.atten.ea29@gmail.com>2022-03-12 19:50:03 +0000
committerjwansek <eddie.atten.ea29@gmail.com>2022-03-12 19:50:03 +0000
commitc7fea1d2c78e77654f098f9ac7409f97ad171f44 (patch)
treec637935478b24bd3d89490148eb8528ec1e39d2a /app.py
parentae079307387d1e97a7ae425dc9c110cafd873116 (diff)
downloadeda.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.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/app.py b/app.py
index 08e45ff..8e1e703 100644
--- a/app.py
+++ b/app.py
@@ -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)