Enable Markdown rendering support for user notes and entry content

This commit is contained in:
Danielle McLean 2017-10-25 13:25:58 +11:00
parent 60cd6c911b
commit e88b631cdb
Signed by: 00dani
GPG key ID: 5A5D2D1AFF12EEC5
7 changed files with 45 additions and 5 deletions

View file

@ -12,6 +12,7 @@ https://docs.djangoproject.com/en/1.11/ref/settings/
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
@ -71,6 +72,7 @@ INSTALLED_APPS = [
'django_otp',
'django_otp.plugins.otp_totp',
'favicon',
'markdown_deux',
'meta',
'lemoncurry',
@ -205,6 +207,27 @@ AGENT_COOKIE_SECURE = True
# https://django-otp-official.readthedocs.io/en/latest/overview.html
OTP_TOTP_ISSUER = LEMONCURRY_SITE_NAME
# django-markdown-deux
# https://github.com/trentm/django-markdown-deux
def copy_update(source_dict, **kwargs):
copy = source_dict.copy()
copy.update(**kwargs)
return copy
MARKDOWN_DEUX_DEFAULT_STYLE = {
"extras": {
"code-friendly": None,
},
"safe_mode": "escape",
}
MARKDOWN_DEUX_STYLES = {
'default': MARKDOWN_DEUX_DEFAULT_STYLE,
'trusted': copy_update(MARKDOWN_DEUX_DEFAULT_STYLE, safe_mode=False),
}
# django-meta
# https://django-meta.readthedocs.io/en/latest/settings.html
META_SITE_PROTOCOL = 'https'