Tired of annoying rich text editors getting in the way of your content input? Wish Wagtail worked more like a wiki? Well, now it can.
wagtail-markdown provides Markdown field support for Wagtail.
Specifically, it provides:
- A
MarkdownBlockfor use in streamfields. - A
MarkdownFieldfor use in page models. - A
MarkdownPanelfor use in the editor interface. - A
markdowntemplate tag.
The markdown rendered is based on python-markdown, but with several
extensions to make it actually useful in Wagtail:
- Tables.
- Code highlighting.
- Inline links to pages (
<:My page name|link title>) and documents (<:doc:My fancy document.pdf>), and inline images (<:image:My pretty image.jpeg>). - Inline Markdown preview using SimpleMDE
These are implemented using the python-markdown extension interface.
Currently, adding new extensions isn't possible without modifying the code, but
that shouldn't be difficult to implement (patches welcome).
Use it as a StreamField block:
from wagtailmarkdown import MarkdownBlock
class MyStreamBlock(StreamBlock):
markdown = MarkdownBlock(icon="code")
Or use as a page field:
from wagtailmarkdown import MarkdownField, MarkdownPanel
class MyPage(Page):
body = models.MarkdownField()
MyPage.content_panels = [
FieldPanel("title", classname="full title"),
MarkdownPanel("body"),
]
And render the content in a template:
{% load wagtailmarkdown %}
<article>
{{ self.body|markdown }}
</article>
NB: The current version was written in about an hour and is probably completely unsuitable for production use. Testing, comments and feedback are welcome: felicity@torchbox.com (or open a Github issue).
- Using the
markdownfilter in the template should not be necessary.

