diff --git a/base/torque/ansible/roles/torque/templates/Pipfile.j2 b/base/torque/ansible/roles/torque/templates/Pipfile.j2 index b5f02186f76f7f89dcc482e61c22fa358fbb8119..2bc3a9067965cbe087d210e324c6d1d45c4c22cd 100644 --- a/base/torque/ansible/roles/torque/templates/Pipfile.j2 +++ b/base/torque/ansible/roles/torque/templates/Pipfile.j2 @@ -16,6 +16,7 @@ phonenumbers = "*" python-dateutil = "*" django-unused-media = "*" pymemcache = "*" +markdown = "*" [requires] python_version = "3.11" diff --git a/base/torque/ansible/roles/torque/templates/settings.py.j2 b/base/torque/ansible/roles/torque/templates/settings.py.j2 index 960a053b80fd303ea00563a697dbc91d7923440d..d02713c49ae2e75c577cc6789b60bb01c39dc6e4 100644 --- a/base/torque/ansible/roles/torque/templates/settings.py.j2 +++ b/base/torque/ansible/roles/torque/templates/settings.py.j2 @@ -3,6 +3,7 @@ import os import csv import json import re +import markdown # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/ @@ -63,6 +64,12 @@ def convert_md_to_mwiki(markdown): else: return "" +def convert_md_to_html(md): + if md: + return markdown.markdown(md) + else: + return "" + def debug_it(x): import pprint pprint.PrettyPrinter(indent=2, width=240).pprint(x) @@ -175,6 +182,7 @@ TORQUE_EDIT_PROCESSOR=convert_md_to_mwiki TORQUE_JINJA_GLOBALS={ "convert_md_to_mwiki": convert_md_to_mwiki, + "convert_md_to_html": convert_md_to_html, "commaize_number": commaize_number, "subject_area_table": subject_area_table, "employees_table": employees_table,