From e88b631cdbc56836e3c0f023a97a651d1c704614 Mon Sep 17 00:00:00 2001 From: Danielle McLean Date: Wed, 25 Oct 2017 13:25:58 +1100 Subject: [PATCH] Enable Markdown rendering support for user notes and entry content --- Pipfile | 1 + Pipfile.lock | 14 +++++++++++++- entries/static/entries/css/h-entry.styl | 2 ++ entries/templates/entries/h-entry.html | 4 ++-- home/static/home/css/index.styl | 2 ++ home/templates/home/index.html | 4 ++-- lemoncurry/settings/base.py | 23 +++++++++++++++++++++++ 7 files changed, 45 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index ddd12ec..eeb9042 100644 --- a/Pipfile +++ b/Pipfile @@ -21,6 +21,7 @@ django-otp = "*" qrcode = "*" django-otp-agents = "*" python-slugify = "*" +django-markdown-deux = "*" [dev-packages] diff --git a/Pipfile.lock b/Pipfile.lock index 1f8c35f..b42c4f8 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "a6c119918001f41c9b233d8cf9606c9acd10c6dcc13ed248f88511b198d9e929" + "sha256": "c32114b4f91b4ef6f4023a180c8db8c0567a6f9206da1af2136af17dd6026b93" }, "host-environment-markers": { "implementation_name": "cpython", @@ -80,6 +80,12 @@ ], "version": "==0.0.7" }, + "django-markdown-deux": { + "hashes": [ + "sha256:5b4a3cd9454af5b4cec0e19151b41d98d09400ddae0688afb81dbf62a4edafff" + ], + "version": "==1.0.5" + }, "django-meta": { "hashes": [ "sha256:2a5b8d95099f69fb9736630c4fbf4fcc2972a1fcd9c708a5bb72dde22e84d8dd", @@ -147,6 +153,12 @@ ], "version": "==4.1.0" }, + "markdown2": { + "hashes": [ + "sha256:264731e7625402227ff6fb01f2d814882da7705432659a18a419c508e8bfccb1" + ], + "version": "==2.3.4" + }, "olefile": { "hashes": [ "sha256:61f2ca0cd0aa77279eb943c07f607438edf374096b66332fae1ee64a6f0f73ad" diff --git a/entries/static/entries/css/h-entry.styl b/entries/static/entries/css/h-entry.styl index 38ef5c4..7e8a00b 100644 --- a/entries/static/entries/css/h-entry.styl +++ b/entries/static/entries/css/h-entry.styl @@ -10,6 +10,8 @@ ol.entries margin-bottom 0 .card.h-entry + .e-content > :last-child + margin-bottom 0 .card-footer display flex justify-content space-evenly diff --git a/entries/templates/entries/h-entry.html b/entries/templates/entries/h-entry.html index 395a41e..28f0ac0 100644 --- a/entries/templates/entries/h-entry.html +++ b/entries/templates/entries/h-entry.html @@ -1,7 +1,7 @@ -{% load humanize %}
+{% load humanize markdown_deux_tags %}
{% if entry.name %}

{{ entry.name }}

{% endif %} -
{{ entry.content }}
+
{{ entry.content | markdown }}