SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 0ea9ca7c authored by Jean-Sébastien Caux's avatar Jean-Sébastien Caux
Browse files

Finish removing deprecated restructuredtext template filter

parent 7a4a6975
No related branches found
No related tags found
No related merge requests found
{% load restructuredtext %}
{% load automarkup %}
<div class="card m-2 {% if post.motion %}text-white bg-dark{% else %}text-body{% endif %}" id="post{{ post.id }}">
<div class="card-header">
......@@ -12,7 +12,7 @@
</div>
</div>
<div class="card-body">
{{ post.text|restructuredtext }}
{{ post.text|automarkup }}
</div>
<div class="card-footer">
<div class="d-flex flex-wrap justify-content-end align-items-center">
......
{% extends 'forums/base.html' %}
{% load bootstrap %}
{% load restructuredtext %}
{% load automarkup %}
{% block breadcrumb_items %}
......@@ -23,7 +23,7 @@
</div>
<div class="card-body">
{% if form.initial.text %}
{{ form.initial.text|restructuredtext }}
{{ form.initial.text|automarkup }}
{% else %}
<span class="text-danger">No text given</span>
{% endif %}
......
{% extends 'forums/base.html' %}
{% load bootstrap %}
{% load restructuredtext %}
{% block breadcrumb_items %}
{{ block.super }}
......
__copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)"
__license__ = "AGPL v3"
from django import template
from django.utils.encoding import force_text
from django.utils.safestring import mark_safe
register = template.Library()
@register.filter(name='restructuredtext')
def restructuredtext(text):
if not text:
return ''
from docutils.core import publish_parts
parts = publish_parts(
source=text,
writer_name='html5_polyglot',
settings_overrides={
'math_output': 'MathJax https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML,Safe',
'initial_header_level': 1,
'doctitle_xform': False,
'raw_enabled': False,
'file_insertion_enabled': False,
})
return mark_safe(force_text(parts['html_body']))
{% load restructuredtext %}
{% load automarkup %}
<p>
Re: ticket {{ followup.ticket.title }}
</p>
<p>A followup has been posted by {{ followup.by.get_full_name }} on the ticket above:</p>
<hr>
{{ followup.text|restructuredtext }}
{{ followup.text|automarkup }}
<hr>
<p>You can view details (and eventually take further steps) by navigating to the <a href="https://scipost.org{{ followup.ticket.get_absolute_url }}">ticket's page</a> (login required). You can also see this ticket on your personal list at our online <a href="https://scipost.org/helpdesk/">helpdesk</a>.</p>
<p>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment