public
Description: Pluggable wmd editor wrapper for django apps
Homepage: http://jobs.scrum8.com
Clone URL: git://github.com/scrum8/django-wmd-editor.git
name age message
file .gitignore Fri Dec 04 16:40:19 -0800 2009 updated gitignore [Joshua Partogi]
file LICENSE Sat Aug 22 06:58:55 -0700 2009 updated license and setup [Joshua Partogi]
file README.md Fri Dec 04 18:57:54 -0800 2009 small enhancements [Joshua Partogi]
file setup.py Sun Nov 01 07:49:03 -0800 2009 changed download url to github [Joshua Partogi]
directory wmd/ Fri Dec 04 07:48:05 -0800 2009 Removed textarea resizer folder [Joshua Partogi]
README.md

Django WMD Editor

A WMD-Editor wrapper for django application.

Installation

Installing django-wmd-editor should be really as easy as possible. To install django-wmd-editor all you need to do is just follow these steps:

  1. Get django-wmd-editor

1.1 Checkout the latest revision of django-wmd-editor from github::

    $ git clone git://github.com/scrum8/django-wmd-editor.git

1.2 Or download the not so latest django-wmd-editor from github

  1. Install django-wmd-editor package to python site-packages

2.1 Install django-wmd-editor with this command:::

    $ sudo python setup.py install

2.2 Or you can just symlink ~/django-wmd-editor/wmd to your python site packages

  1. Install django-wmd-editor in your django application::

    INSTALLED_APPS = ( ... wmd', ... )

  2. Symlink or copy ~/django-wmd-editor/media/wmd directory to where your MEDIA_URL directory is pointing to. django-wmd-editor will look for the /wmd path

Usage

  1. In your models:

    from wmd import models as wmd_models

    description = wmd_models.MarkDownField()

  2. In your forms:

    from wmd.widgets import MarkDownInput

    description = forms.CharField(widget=MarkDownInput())

  3. You also need to add these lines on your template to load up the wmd static files:

    {{ form.media }}

  4. In the admin, these static files is loaded automatically.

Configuration

In your django settings file, use this configuration for setting up your django wmd editor

  • WMD_OUTPUT: The format sent to the server. Use "Markdown" to return the markdown source. Values: Markdown, HTML Default: Markdown
  • WMD_LINE_LENGTH: Line wrapping length for lists, blockquotes, etc. Default: 40
  • WMD_BUTTONS: The toolbar buttons. Undo and redo get appended automatically. Values: bold italic link blockquote code image ol ul heading hr | Default: bold italic | link blockquote code image | ol ul heading hr
  • WMD_SHOW_PREVIEW: Whether to show the preview or not. This is the setting if you use the wmd editor outside the admin. Values: True, False Default: False
  • WMD_ADMIN_SHOW_PREVIEW: Whether to show the preview in the admin or not. Values: True, False Default: False

Bugs & Features request

Just file it in the issue tracker.

License

Copyright (c) 2009 Scrum8 (http://scrum8.com) under BSD License.