-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simple template tag to render the editor #135
Comments
Hello @ghost, seems currently we didn't support this yet.
from django import template
from martor.widgets import MartorWidget
register = template.Library()
@register.filter
def as_martor_field(form_textarea):
return MartorWidget().render(name=form_textarea.name, value=form_textarea.value)
{{ field.description|as_martor_field }}
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi all, I've a template which rather than using forms, calls an API directly. I'd like to include the martor editor in the page. Is there a simple way of inserting something like {{ martorfield }} into the middle of some form html to add the markdown editor with a relevant html form element name?
The text was updated successfully, but these errors were encountered: