Giter Club home page Giter Club logo

django-easymde's Introduction

A markdown editor (with preview) for Django

Use a simple markdown editor https://github.com/Ionaru/easy-markdown-editor in django forms. This project is inspired by https://github.com/sparksuite/simplemde-markdown-editor and https://github.com/douglasmiranda/django-wysiwyg-redactor/.

Note that SimpleMDE is no longer in development, and has been forked to create EasyMDE, which is in active development as of mid-2024.

Getting started

  • install django-easymde
pip install django-easymde
  • add 'easymde' to INSTALLED_APPS.
INSTALLED_APPS = (
    # ...
    'easymde',
    # ...
)

Using field in models

from django.db import models
from easymde.fields import EasyMDEField

class Entry(models.Model):
    title = models.CharField(max_length=250, verbose_name=u'Title')
    content = EasyMDEField(verbose_name=u'mardown content')

Note: The widget EasyMDEWidget can also be used in forms on existing fields.

EasyMDE options

EasyMDE options can be set in settings.py:

EASYMDE_OPTIONS = {
    'placeholder': 'Type here...',
    'status': False,
    'autosave': {
        'enabled': True
    }
}

For the autosave option, this plugin will generate uniqueId with python's uuid.uuid4 automatically.

Right now, this plugin supports EasyMDE Configurations, but only the static ones(no support for javascript configurations such as previewRender)

Get EasyMDE instance from DOM

After EasyMDE is initialized, a EasyMDE instance can be retrieved from the DOM element:

$('.easymde-box')[0].EasyMDE

django-easymde's People

Contributors

onepill avatar benjamin-antupit avatar batisteo avatar eraldo avatar alexcleduc avatar cjdreiss avatar braunsonm avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.