Package: mezzanine-mdown
This package provides widgets and filters for mezzanine that enable admins
to use markdown formatting to create their site content, rather than using
the tinymce editor to generate html used inrich contenttypes, such asrich pagesandblog posts.InstallationGet the packagepip:user@home:~$ pip install mezzanine-mdowneasy_install:user@home:~$ easy_install mezzanine-mdownPrep the static mediaUsing the excellentstaticfilesapp, mdown’s
static files should get picked up automatically.If the staticfiles app is not your style, you’ll need to locate the install
location for themdownpackage (usually your python interpreter’ssite-packagesdirectory) and copy/symlinkmdown/static/mdowninto your
projectsite_mediadirectory.ConfigurationFirst off, addmdownto your list ofINSTALLED_APPSin your project settings module.With the app installed, you need to make a couple choices. You’ll have to
specify theRICHTEXT_WIDGET_CLASSandRICHTEXT_FILTERvalues in your
settings module.RICHTEXT_WIDGET_CLASSThis package provides 2 options for this setting.mdown.forms.WmdWidgetActivates the WMD rich text editor.(recommended)mdown.forms.PlainWidgetUse a plain Textarea (no rich text editor).RICHTEXT_FILTERAgain, there are 2 options for this setting.mdown.filters.codehiliteRenders the content using markdown with the
codehilite extension enabled.mdown.filters.plainRenders the content using vanilla markdown formatting.Extra StepsPygments StylesUsing the management commandpygments_stylesyou can generate css to
colorize code blocks parsed by the codehilite filter.Note:this requires pygments to be installed (usepip install pygmentsoreasy_install pygmentsto use this feature).Invoke the command with no args to see a usage message and list of available
color schemes on your system.:user@home:~/mysite$ ./manage.py pygments_styles
Usage: ./manage.py pygments_styles <scheme_name>
Available color schemes:
  borland
  bw
  colorful
  default
  ... [ snip ] ...Invoking with the scheme’s name as an argument will print the css to stdout, which you can
redirect to a file like so:user@home:~/mysite$ ./manage.py pygment_styles colorful > site_media/css/pygments.cssIn additon to this single scheme method, the command also accepts the--allflag, which will generate styles for all available, but with one key
difference: each scheme is prefixed with its name as a css class name. This
is handy during theme development as you can quickly switch pygments schemes
just by setting the class on the body tag to your choice of scheme without
having to regenerate css files constantly.Once you’ve got a css file generated, simply add it to your site’s base
template to get your code “pretty” printed.Updating Theme TemplatesThemes that were based on the default theme and were created prior toMezzanine’s 0.11.3 releasewill most likely not have therichtext_filterapplied torich content. To correct this, you simply have to update the
templates for these content types so that the filter is used.For example, in the default theme, thetemplates/blog/blog_post_detail.htmlhad a line that  was updated from:{{ blog_post.content|safe }}to:{{ blog_post.content|richtext_filter|safe }}Just ensure that thesafefilter comes after therichtext_filter.