You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I do see the performance advantage of storing rendered Markdown, but also wonder why there is no documented means for avoiding it. It seems a perfectly valid and common use case to me, to store only the markdown and render on, well, rendering the template. That is rather than:
from django.db import models
from markdownfield.models import MarkdownField, RenderedMarkdownField
from markdownfield.validators import VALIDATOR_STANDARD
class Page(models.Model):
text = MarkdownField(rendered_field='text_rendered', validator=VALIDATOR_STANDARD)
text_rendered = RenderedMarkdownField()
and in templates:
{{ post.text_rendered | safe }}
something more like:
from django.db import models
from markdownfield.models import MarkdownField
from markdownfield.validators import VALIDATOR_STANDARD
class Page(models.Model):
text = MarkdownField(validator=VALIDATOR_STANDARD)
and in templates:
{{ post.text | render_markdown }}
Not only is that use case to my mind very valid, I think that the render_markdown filter would find broader use in templates.
The text was updated successfully, but these errors were encountered:
I do see the performance advantage of storing rendered Markdown, but also wonder why there is no documented means for avoiding it. It seems a perfectly valid and common use case to me, to store only the markdown and render on, well, rendering the template. That is rather than:
and in templates:
something more like:
and in templates:
Not only is that use case to my mind very valid, I think that the
render_markdown
filter would find broader use in templates.The text was updated successfully, but these errors were encountered: