{% extends "base.html" %} {% block title -%} Wiki Editor {%- endblock title %} {% block content %}
{{ form.hidden_tag() }} {{ input(form.title, placeholder="Title", class="span7", autocomplete="off") }} {{ input(form.body, placeholder="Markdown", class="span7", rows="20") }} {{ input(form.tags, placeholder="Tags (comma separated)", class="span7", autocomplete="off") }}
{% endblock content %} {% block sidebar %}

Editor How-To

This editor is markdown featured.

* I
* am
* a
* list
Turns into:

**bold** and *italics* turn into bold and italics. Very easy!

Create links with [NoTube](http://www.notube.com). They turn into NoTube.

Headers are as follows:

# Level 1
## Level 2
### Level 3

{% endblock sidebar %} {% block postscripts -%} {{ super() }} $('#previewlink').on('click', function() { var $form = $('.form'); var $inputs = $form.find('input, textarea, button'); var $pre = $('#preview'); var bodycontent = 'title: preview\n\n' + $form.find('textarea').val(); $inputs.prop('disabled', true); $pre.removeClass('alert').removeClass('alert-error').html("Loading..."); $.ajax({ url: "{{ url_for('wiki.preview') }}", type: "POST", data: { body: bodycontent }, success: function(msg) { $pre.html(msg); console.log(msg); }, error: function() { $pre.addClass('alert').addClass('alert-error'); $pre.html('There was a problem with the preview.'); }, complete: function() { $inputs.prop('disabled', false); } }); }); $('#previewbtn').on('click', function(event) { event.preventDefault(); $('#previewlink').click(); }); {%- endblock postscripts %}