{% extends "pages/wiki/base.html" %} {% block title -%} Wiki Editor {%- endblock title %} {% block content %} {% from 'macros/render_form.html' import submitcancel_render_form %}
{{ submitcancel_render_form(form) }}
{% endblock content %} {% block sidebar %}

This editor is markdown featured.

* I
* am
* a
* list
Turns into:

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

Create links with [GitHub](https://www.github.com). They turn into GitHub.

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'); console.log($pre); 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('wikipreview') }}", 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(); }); $('#howtolink').on('click', function() { $('#howtocontent').toggle(); }); $('#howtobtn').on('click', function(event) { event.preventDefault(); $('#howtolink').click(); }); {%- endblock postscripts %}