README.md

What's with the "deux" in the name?

The obvious name for this project is django-markdown2. However, there
already is one! and name
confusion doesn't help anybody. Plus, I took French immersion in school for 12
years: might as well put it to use.

So why another project then?

Because I wanted to do something slightly different. Django-markdown2's
markdown filter takes
"extras" as arguments
-- with the one exception that "safe" is transformed to python-markdown2's
safe_mode argument. This is handy for quick usage. My use case is more
commonly: lots of markdown filter and block usage in my Django templates with
the same set of python-markdown2 options.

Django project setup

Add markdown_deux to INSTALLED_APPS in your project's "settings.py".

Optionally set some of the MARKDOWN_DEUX_* settings. See the "Settings"
section below.

Usage

The markdown_deux facilities typically take an optional "style" argument. This
is a name for a set of options to the python-markdown2 processor. There is
a "default" style that is used if no argument is given. See the
MARKDOWN_DEUX_STYLES setting below for more.

markdown_allowed template tag

In a template:

{% markdown_allowed %}

will emit a short HTML blurb that says Markdown syntax is allowed. This can be
handy for placing under form elements that accept markdown syntax. You can also
use it as the help_text for a form field something like:

markdown_cheatsheet tag

This outputs HTML giving a narrow (appropriate for, e.g., a sidebar) listing of
some of the more common Markdown features.

markdown_deux.markdown(TEXT, STYLE) in your Python code

The markdown filter and block tags above ultimately use this
markdown_deux.markdown(...) function. You might find it useful to do Markdown
processing in your Python code (e.g. in a view, in a model .save() method).

Settings

All settings for this app are optional.

MARKDOWN_DEUX_STYLES setting

A mapping of style name to a dict of keyword arguments for python-markdown2's
markdown2.markdown(text, **kwargs). For example the default setting is
effectively: