Skip to content

Commit

Permalink
Updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
timmyomahony committed May 23, 2020
1 parent 898ac59 commit 11b66eb
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ If you want to use the pagedown editor in a django admin field, there are numero

```python
from django import forms

from pagedown.widgets import AdminPagedownWidget

from music.models import Album

class AlbumForm(forms.ModelForm):
Expand All @@ -59,7 +59,7 @@ If you want to use the pagedown editor in a django admin field, there are numero

```python
from django.contrib import admin

from forms import FooModelForm
from models import FooModel

Expand Down Expand Up @@ -136,16 +136,17 @@ class MyNewWidget(PagedownWidget):
js = ('custom/javascript.js',)
```


## Rendering Markdown

`contrib.markdown` was [deprecated in Django 1.5](https://code.djangoproject.com/ticket/18054) meaning you can no longer use the `markdown` filter in your template by default.
`contrib.markdown` was [deprecated in Django 1.5](https://code.djangoproject.com/ticket/18054) meaning you can no longer use the `markdown` filter in your template by default.

[@wkcd has a good example](https://github.com/timmyomahony/django-pagedown/issues/18#issuecomment-37535535) of how to overcome by installing `django-markdown-deux`:
[@wkcd has a good example](https://github.com/timmyomahony/django-pagedown/issues/18#issuecomment-37535535) of how to overcome by installing `django-markdown-deux`:

```
```py
{% extends 'base.html' %}
{% load markdown_deux_tags %}

...
<p>{{ entry.body|markdown }}</p>
...
Expand All @@ -164,11 +165,11 @@ To do so:
3. Include the pagedown paths in your `urls.py` so that the upload endpoint is available

```py
# ...
urlpatterns = [
path('', include('pagedown.urls')),
# ...
]
# ...
urlpatterns = [
path('', include('pagedown.urls')),
# ...
]
```

This will add the URL `/pagedown/image-upload/` endpoint to your project. You can [see the default view that handles the upload here](https://github.com/timmyomahony/django-pagedown/blob/develop/pagedown/views.py)
Expand Down

0 comments on commit 11b66eb

Please sign in to comment.