From: qw3rty Date: Mon, 17 May 2010 18:43:28 +0000 (+0000) Subject: Add the page for more explanation of how to use markdown. If anyone has any ideas... X-Git-Tag: live~836 X-Git-Url: https://git.openstreetmap.org./osqa.git/commitdiff_plain/414490259481cfdb1adc636ba74800f8e12d51a1 Add the page for more explanation of how to use markdown. If anyone has any ideas of information that would be good to add just tell me. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@295 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- diff --git a/forum/skins/default/media/style/markdown_help.css b/forum/skins/default/media/style/markdown_help.css new file mode 100644 index 0000000..68a9f1c --- /dev/null +++ b/forum/skins/default/media/style/markdown_help.css @@ -0,0 +1,46 @@ +div.main-wrapper { + /* + margin: 30px auto; + overflow:hidden; + position:relative; + */ +} + +div.section { + padding-top:30px; +} + +h2.section-title { + padding-top:10px; + padding-left:10px; + width:100%; + background-color:#b6c4e2; +} + +div.section-description { + padding-top:20px; + padding-bottom:10px; +} + +table.section-example { + padding-top:5px; + padding-bottom:10px; + width:100%; +} + +table.section-example tr { +} + +table.section-example tr td { + background-color:#e5ebf8; + + padding:5px 5px 5px 5px; + width:50%; + + text-align:left; + + border-style:solid; + border-width:1px; + -moz-border-radius:5px; + -webkit-border-radius:5px; +} diff --git a/forum/skins/default/templates/markdown_help.html b/forum/skins/default/templates/markdown_help.html new file mode 100644 index 0000000..a54334b --- /dev/null +++ b/forum/skins/default/templates/markdown_help.html @@ -0,0 +1,248 @@ +{% extends "base.html" %} +{% load extra_tags %} +{% load humanize %} +{% load i18n %} + +{% block fulltitle %}{% spaceless %}{% trans "Markdown Help" %}{% endspaceless %}{% endblock %} + +{% block forejs %} + +{% endblock %} + +{% block content %} +


+
+

Markdown Syntax

+

This document describes some of the more important parts of Markdown (for writers, that is). There's a lot more to the syntax than is mentioned here, though. To get the full syntax documentation, go to John Gruber's Markdown Syntax page

+
+ +
+

Headers

+
+ For top-level headers underline the text with equal signs. For second-level headers use dashes to underline. +
+ + + +
+ This is an H1
+ ============= +
+

This is an H1

+
+ + + + +
+ This is an H2
+ ------------- +
+

This is an H2

+
+ +
+ If you would rather, you can prefix headers with a hash (#) symbol instead. The number of hash symbols indicates the header level. For example, a single hash indicates a header level of one while two indicates the second header level: +
+ + + +
+ # This is H1 + +

This is an H1

+
+ + + + +
+ ## This is H2 + +

This is an H2

+
+ + + + +
+ ### This is H3 + +

This is an H3

+
+ +
+ Which you choose is a matter of style. Whichever you thinks looks better in the text document. In both cases, the final, fully formatted, document looks the same. +
+
+ +
+

Paragraphs

+
+ Paragraphs are surrounded by blank lines. +
+
+ This is paragraph one. +

+
+ This is paragraph two. +
+
+ +
+

Links

+
+ There are two parts to every link. + The first is the actual text that the user will see and it is surrounded by brackets. + The second is address of the page you wish to link to and it is surrounded in parenthesis. +
+ + + +
+ [link text](http://example.com/) + + link text +
+
+ +
+

Formatting

+
+ To indicate bold text surround the text with two star (*) symbols or two underscore (_) symbols: +
+ + + +
+ **This is bold** + + This is bold +
+ + + +
+ __This is also bold__ + + This is also bold +
+ +
+ To indicate italicized text surround the text with a single star (*) symbol or underscore (_) symbol: +
+ + + +
+ *This is italics* + + This is italics +
+ + + +
+ _This is also italics_ + + This is also italics +
+ +
+ To indicate italicized and bold text surround the text with three star (*) symbol or underscore (_) symbol: +
+ + + +
+ ***This is bold and italics*** + + This is italics +
+ + + +
+ ___This is also bold and italics___ + + This is italics +
+
+ + +
+

Blockquotes

+
+ To create an indented area use the right angle bracket (>) character before each line to be included in the blockquote. +
+ + + +
+ > This is part of a blockquote.
+ > This is part of the same blockquote. +
+

This is part of a blockquote.
This is part of the same blockquote.

+
+ +
+ Rather than putting it in front of each line to include in the block quote you can put it at the beginning and end the quote with a newline. +
+ + + +
+ > This is part of a blockquote.
+ This continues the blockquote even though there's no bracket.

+ The blank line ends the blockquote. +
+

This is part of a blockquote.
This continues the blockquote even though there's no bracket.

+

The blank line ends the blockquote.

+
+
+ +
+

Lists

+
+ To create a numbered list in Markdown, prefix each item in the list with a number followed by a period and space. The number you use actually doesn't matter. +
+ + + +
+ 1. Item 1
+ 2. Item 2
+ 3. Item 3 +
+
    +
  1. Item 1
  2. +
  3. Item 2
  4. +
  5. Item 3
  6. +
+
+ +
+ To create a bulleted list, prefix each item in the list with a star (*) character. +
+ + + +
+ * A list item
+ * Another list item
+ * A third list item +
+
    +
  • A list item
  • +
  • Another list item
  • +
  • A third list item
  • +
+
+
+ +
+

A Lot More

+
There's a lot more to the Markdown syntax than is mentioned here. But for creative writers, this covers a lot of the necessities. To find out more about Markdown than you'd ever want to really know, go to the Markdown page where it all started.
+
+
+{% endblock %} \ No newline at end of file diff --git a/forum/skins/default/templates/question_edit_tips.html b/forum/skins/default/templates/question_edit_tips.html index 6083c12..3e72a1e 100644 --- a/forum/skins/default/templates/question_edit_tips.html +++ b/forum/skins/default/templates/question_edit_tips.html @@ -71,7 +71,7 @@ diff --git a/forum/urls.py b/forum/urls.py index 6f053fd..a262fd5 100644 --- a/forum/urls.py +++ b/forum/urls.py @@ -48,6 +48,7 @@ urlpatterns += patterns('', #url(r'^%s/$' % _('signin/'), 'django_authopenid.views.signin', name='signin'), url(r'^%s$' % _('faq/'), app.meta.static, {'content': settings.FAQ_PAGE_TEXT, 'title': _('FAQ')}, name='faq'), url(r'^%s$' % _('about/'), app.meta.static, {'content': settings.ABOUT_PAGE_TEXT, 'title': _('About')}, name='about'), + url(r'^%s$' % _('markdown_help/'), app.meta.markdown_help, name='markdown_help'), url(r'^opensearch\.xml$', app.meta.opensearch, name='opensearch'), url(r'^%s$' % _('privacy/'), app.meta.privacy, name='privacy'), url(r'^%s$' % _('logout/'), app.meta.logout, name='logout'), diff --git a/forum/views/meta.py b/forum/views/meta.py index fc050c2..97c852f 100644 --- a/forum/views/meta.py +++ b/forum/views/meta.py @@ -21,6 +21,13 @@ def favicon(request): def static(request, title, content): return render_to_response('static.html', {'content' : content, 'title': title}, context_instance=RequestContext(request)) +def markdown_help(request): + # md = markdown.Markdown([SettingsExtension({})]) + # text = md.convert(settings.FAQ_PAGE_TEXT.value) + + return render_to_response('markdown_help.html', context_instance=RequestContext(request)) + + def opensearch(request): return render_to_response('opensearch.html', {'settings' : settings}, context_instance=RequestContext(request))