-
Notifications
You must be signed in to change notification settings - Fork 90
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
How to render markdown without preview? #18
Comments
I presume you mean you don't want to see the preview when writing your markdown in the django admin or elsewhere? You could simply hide the preview via css:
but there is no built in way to ommit the preview |
No, I want to see the preview in the admin and allow editing via the admin, but on other pages I just want the rendered html without the preview. Django 1.5 had a markdown template tag but 1.6 doesn't, I'm just wondering if pagedown includes any. |
@will-emmerson You can install the django-markdown-deux package, add 'markdown_deux' to INSTALLED_APPS and put {% load markdown_deux_tags %} in the head of your template. Heres an example: {% extends 'base.html' %}
{% load markdown_deux_tags %}
{% block content %}
<div class="blog-post">
<h2 class="blog-post-title">{{ entry.title }}</h2>
<p class="blog-post-meta">{{ entry.created }} by {{ entry.author.first_name }}</p>
{{ entry.body|markdown }}
</div>
{% if user.is_superuser %}
<a href="{% url 'entry_update' slug=entry.slug %}" role="button" class="btn btn-primary"> Edit</a>
{% endif %}
{% endblock % |
I will add this to the README |
I've added a section at the bottom of the README addressing this, so hopefully it is clearer now: |
There is a difference between the django-pagedown preview and the html generated by the django-markdown-deux. Specifically the preview from pagedown shows line breaks when I press enter, but when I render it using the deux tag, the line breaks are gone. BUT, it I put two line breaks, then deux DOES puts |
@hitarths that's interesting, I haven't noticed that before. The
|
I just want to render the markdown to html in a template, without the preview.
The text was updated successfully, but these errors were encountered: