Add Markdown support

This commit is contained in:
Gregory Soutade
2014-01-04 13:43:38 +01:00
parent 9de9cea99a
commit 88e6ebd3a4
11 changed files with 2521 additions and 12 deletions

View File

@@ -17,7 +17,69 @@ Available tags:
{% endfor %}
</select>
<input type="button" onclick="addTag();" value="Add Tag"/>
<textarea name="content" class="mceAdvanced"></textarea><br/><br/>
<br/>Editor <select name="editor" id="editor" onchange="switchEditor();">
{% if editor == "html" %}
<option value="html" selected="selected">HTML
<option value="text">Text
{% else %}
<option value="html">HTML
<option value="text" selected="selected">Text
{% endif %}
</select><br/>
{% if editor == "html" %}
<textarea id="content" name="content" cols="100" rows="25" class="mceAdvanced"></textarea>
{% else %}
<textarea id="content" name="content" cols="100" rows="25"></textarea>
{% endif %}
<br/>
<input type="submit" name="add" value="Add" /><input type="button" name="preview" value="Preview" onClick="previewPost({{ blog_id }});"/><input type="submit" name="cancel" value="Cancel" />
</form>
{% if editor == "html" %}
<div id="markdown_help" style="display:none">
{% else %}
<div id="markdown_help">
{% endif %}
<b>Markdown syntax</b><br /><br />
<table>
<tr>
<td class="markdown_help">
<pre style="display:inline">_italic_</pre> <span style="font-style:italic">italic</span><br/>
<pre style="display:inline">**bold**</pre> <span style="font-weight:bold">bold</span><br/>
<pre style="display:inline">~~line through~~</pre> <span style="text-decoration:line-through">line through</span><br/>
<pre style="display:inline">>Citation</pre><br/>
<pre>
* Unordered list
* Second element
</pre>
<ul>
<li>Unordered list
<li>Second element
</ul>
<pre>
1. Ordered list
1. Second element
</pre>
<ol>
<li>Ordered list
<li>Second element
</ol>
<pre style="display:inline">![Picture](https://bits.wikimedia.org/images/wikimedia-button.png)</pre><img src="https://bits.wikimedia.org/images/wikimedia-button.png" alt="Picture"/><br/>
<pre style="display:inline">[Link](http://www.wikipedia.org)</pre> <a href="http://www.wikipedia.org">Link</a><br/><br/>
</td>
<td>
<pre># Title # or
Title
=====</pre>
<h1>Title</h1>
<pre>## Sub title ## or
Sub title
---------</pre>
<h2>Sub title</h2>
<pre>### Sub sub title ###</pre>
<h3>Sub sub title</h3>
</td>
</tr>
</table>
</div>
<br/><br/>
{% endblock %}

View File

@@ -17,7 +17,20 @@ Available tags:
{% endfor %}
</select>
<input type="button" onclick="addTag();" value="Add Tag"/>
<textarea name="content" class="mceAdvanced">{{ content }}</textarea>
<br/>Editor <select name="editor" id="editor" onchange="switchEditor();">
{% if editor == "html" %}
<option value="html" selected="selected">HTML
<option value="text">Text
{% else %}
<option value="html">HTML
<option value="text" selected="selected">Text
{% endif %}
</select><br/>
{% if editor == "html" %}
<textarea id="content" name="content" cols="100" rows="25" class="mceAdvanced">{{ content }}</textarea><br/>
{% else %}
<textarea id="content" name="content" cols="100" rows="25">{{ content }}</textarea><br/>
{% endif %}
<input type="submit" name="edit" value="Edit" /><input type="button" name="preview" value="Preview" onClick="previewPost({{ blog_id }});"/><input type="submit" name="cancel" value="Cancel" />
</form>
<div class="comments">
@@ -32,5 +45,52 @@ Available tags:
{% endautoescape %}
</div>
{% endfor %}
</div><br/>
{% if editor == "html" %}
<div id="markdown_help" style="display:none">
{% else %}
<div id="markdown_help">
{% endif %}
<b>Markdown syntax</b><br /><br />
<table>
<tr>
<td class="markdown_help">
<pre style="display:inline">_italic_</pre> <span style="font-style:italic">italic</span><br/>
<pre style="display:inline">**bold**</pre> <span style="font-weight:bold">bold</span><br/>
<pre style="display:inline">~~line through~~</pre> <span style="text-decoration:line-through">line through</span><br/>
<pre style="display:inline">>Citation</pre><br/>
<pre>
* Unordered list
* Second element
</pre>
<ul>
<li>Unordered list
<li>Second element
</ul>
<pre>
1. Ordered list
1. Second element
</pre>
<ol>
<li>Ordered list
<li>Second element
</ol>
<pre style="display:inline">![Picture](https://bits.wikimedia.org/images/wikimedia-button.png)</pre><img src="https://bits.wikimedia.org/images/wikimedia-button.png" alt="Picture"/><br/>
<pre style="display:inline">[Link](http://www.wikipedia.org)</pre> <a href="http://www.wikipedia.org">Link</a><br/><br/>
</td>
<td>
<pre># Title # or
Title
=====</pre>
<h1>Title</h1>
<pre>## Sub title ## or
Sub title
---------</pre>
<h2>Sub title</h2>
<pre>### Sub sub title ###</pre>
<h3>Sub sub title</h3>
</td>
</tr>
</table>
</div>
{% endblock %}

View File

@@ -22,7 +22,7 @@
</head>
<body>
<div class="logo">
<img src="{{ STATIC_URL }}images/logo.png"/>
<a href="http://indefero.soutade.fr/p/dynastie>"><img src="{{ STATIC_URL }}images/logo.png"/></a>
</div>
<div class="form">
<form method="post" action="/index">