Задать вопрос

Тел: +7 965 3737 888

505

Просмотров

2

Ответов

A simple rest template filter

<p><strong>Attention! This snippet must be ignored</strong>, like <a href="">zgoda</a> pointed with reason: already exists this functionality in markup contrib.</p>
<p><strong>Explanations:</strong></p>
<p>This template filter allows you to render easily a reStructuredText to <strong>HTML</strong> or another format it supports.</p>
<p><strong>Setup:</strong></p>
<p>Insert the snippet into an_app/templatetags/restutils.py.</p>
<p><strong>Use in template:</strong></p>
<p>{% load restutils %} and use it as following:</p>
<ul><li>{{ entry.content|rest:"html" }}</li>
</ul>

Вопрос полезен? Да0/Нет0
file_4258.py(228.0б)
None

Ответы (2):

Ответmarinho:16.11.2007
Ответ полезен? Да0/Нет0

hummm... it's truth, I not knew this :/ thanks :)

Ответzgoda:15.11.2007
Ответ полезен? Да0/Нет0

Why would one need to reinvent the wheel? There is already ReST filter in markup contrib library.