From ad162d74db6718b2ba7dd1ab2e1f21847a7c7744 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 6 Jul 2010 20:16:10 -0500 Subject: Format all news items using markdown Implements FS#13741. A preview function is also added so working with news items is easier to make sure you get the formatting right. This will result in some older news items looking a bit weird if they didn't put linebreaks in all the right places, we can fix a few of these as we notice them. Signed-off-by: Dan McGee --- templates/news/add.html | 38 ++++++++++++++++++++++++++++++++------ templates/news/view.html | 5 +++-- 2 files changed, 35 insertions(+), 8 deletions(-) (limited to 'templates/news') diff --git a/templates/news/add.html b/templates/news/add.html index 9b2ebae..51f4d30 100644 --- a/templates/news/add.html +++ b/templates/news/add.html @@ -9,17 +9,43 @@ {% else %}

News: Add Article

{% endif %} - +

News articles are formatted using + Markdown syntax. + Please use this syntax if at all possible over raw HTML, which can be used + if Markdown doesn't support what you would like to do. Before posting, you + are highly encouraged to use the Preview button to check + your work. Javascript must be enabled to use it, but it will render the + news item exactly as it will appear on the news view page.

{% csrf_token %}
{{ form.as_p }}
- {% if form.instance.id %} -

- {% else %} -

- {% endif %} +

+ + + +

+ + +{% load cdn %}{% jquery %} + {% endblock %} diff --git a/templates/news/view.html b/templates/news/view.html index 1b82bc0..64c510e 100644 --- a/templates/news/view.html +++ b/templates/news/view.html @@ -1,8 +1,9 @@ {% extends "base.html" %} +{% load markup %} {% block title %}Arch Linux - News: {{ news.title }}{% endblock %} {% block content %} -
+

News: {{ news.title }}

@@ -17,7 +18,7 @@ - {{ news.content|safe|linebreaks }} +
{{ news.content|markdown }}
{% endblock %} -- cgit v1.2.3-24-g4f1b