Django field and widget for editing markup content (PlainText, HTML, Markdown, reStructuredText, Textile) using the CodeMirror editor with live preview.
Project description
django-markupmirror is a custom field and widget for editing markup text in Django. It utilizes the CodeMirror JS editor for a richer editing experience.
It uses parts of James Turk’s django-markupfield and adds a nicer widget with live-preview and an extension content-type for FeinCMS.
- Documentation
on Read the Docs: http://django-markupmirror.readthedocs.org/
- Code and issues
on bitbucket: https://bitbucket.org/fabianbuechler/django-markupmirror
- Releases
Quickstart
To install django-markupmirror, use pip and add 'markupmirror' to the INSTALLED_APPS in your Django project.
In your settings.py specify at least MARKUPMIRROR_DEFAULT_MARKUP_TYPE which is 'plaintext' by default.
For the markup HTML-preview, you’ll need to add markupmirror’s URLs in your URLconf. In your urls.py add:
import markupmirror.urls urlpatterns = patterns('', (r'^markupmirror/', include(markupmirror.urls.preview)), )
Add one or more markupmirror.fields.MarkupMirrorField s to your models and define markup_type or default_markup_type:
class ModelWithMarkup(models.Model): content = MarkupMirrorField( verbose_name="content", markup_type='markdown')
If you want the FeinCMS content-type model MarkupMirrorContent, you’ll also need to add 'markupmirror.feincms' to your INSTALLED_APPS.
Also, you need to register the content-type model with FeinCMS’ Page module:
from feincms.module.page.models import Page from markupmirror.feincms.models import MarkupMirrorContent Page.create_content_type(MarkupMirrorContent)
By default, django-markupmirror comes with markup converters for plain text (converts links and linebreaks) and HTML (does nothing). Converters for Markdown, reStructuredText and Textile are also available, but require 3rd-party libraries to be installed. However, you can register your own markup converters.
Changelog
0.1 - unreleased
Initial release including MarkupMirrorField field, MarkupMirrorTextarea and AdminMarkupMirrorTextareaWidget widgets and providing FeinCMS integration with MarkupMirrorContent Page content-type. Supported markup types are plain text, HTML, Mardown, reStructuredText and Textile.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for django-markupmirror-0.1a2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a1cf86b6dc8c85b2b5ebdf65eba55e70011be3dfd60b0acde20f81ca3505584 |
|
MD5 | 12e068a4c9c750bcd750b2196275a7ac |
|
BLAKE2b-256 | 2287ead2690b32354dacd08d796a49a4a64c78d0f751ab3023bfb1aa68c9428c |