Socket
Socket
Sign inDemoInstall

django-simplemde

Package Overview
Dependencies
0
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    django-simplemde

django-simplemde is a WYSIWYG markdown editor for Django


Maintainers
1

Readme

A markdown editor(with preview) for Django

Use markdown editor https://github.com/sparksuite/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

Keywords

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc