GithubHelp home page GithubHelp logo

isabella232 / django-simplemde Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chefclub/django-simplemde

0.0 0.0 0.0 169 KB

Use markdown editor https://github.com/NextStepWebs/simplemde-markdown-editor in django project

Python 91.37% JavaScript 6.16% HTML 2.47%

django-simplemde's Introduction

A markdown editor(with preview) for Django

Use markdown editor https://github.com/NextStepWebs/simplemde-markdown-editor in django project, this project is inspired by https://github.com/douglasmiranda/django-wysiwyg-redactor/

Getting started

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

Using in models

from django.db import models
from simplemde.fields import SimpleMDEField

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

SimpleMDE options

You could set SimpleMDE options in settings.py like this:

SIMPLEMDE_OPTIONS = {
    'placeholder': 'haha',
    'status': False,
    'autosave': {
        'enabled': True
    }
}

Right now this plugin supports SimpleMDE Configurations, but only the static ones(don't support js configurations like previewRender)

for autosave option, you dont need to set it, this plugin will generate uniqueId with python's uuid.uuid4 automatically

Get SimpleMDE instance from DOM

After SimpleMDE initialized, you could get SimpleMDE instance from dom element like this:

$('.simplemde-box')[0].SimpleMDE

django-simplemde's People

Contributors

batisteo avatar braunsonm avatar cjdreiss avatar eraldo avatar onepill 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.