zakdoek / django-prosemirror

ProseMirror field for django admin
MIT License
11 stars 4 forks source link

Unclear how to begin using #1

Open smari opened 8 years ago

smari commented 8 years ago

Just found this, and know it's new, so it's unclear if it actually works yet, but if it is, I'd appreciate some basic instructions on how to begin using it. If I'm here too early, no worries -- then just consider this a signal of interest.

zakdoek commented 8 years ago

Here are some quick instructions, i will write the docs when i have more time.

installation via pip: pip install django-prosemirror

Simple usage:

from django.db import models
from prosemirror.fields import ProseMirrorField

class MyModel(models.Model):
    full_featured_text = ProseMirrorField(prosemirror_profile="maxi")
    minimal_text = ProseMirrorField(prosemirror_profile="micro", null=True, blank=True, ....)

Other kwargs on the field are the same as a TextField.

For more info you should read the source. It's quite small.

For best results you should use commonmark to render the output. The field is stored in CommonMark format. The only effect of this field is as admin UI.