Skip to content

Commit

Permalink
Added pagedown extras
Browse files Browse the repository at this point in the history
  • Loading branch information
timmyomahony committed Dec 11, 2015
1 parent 63b944b commit 5257aee
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2012, Timmy O'Mahony
Copyright (c) 2015, Timmy O'Mahony
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
3 changes: 2 additions & 1 deletion pagedown/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@

SHOW_PREVIEW = getattr(settings, 'PAGEDOWN_SHOW_PREVIEW', True)
WIDGET_TEMPLATE = getattr(settings, 'PAGEDOWN_WIDGET_TEMPLATE', 'pagedown/widgets/default.html')
WIDGET_CSS = getattr(settings, 'PAGEDOWN_WIDGET_CSS', ('pagedown/demo/browser/demo.css', ))
WIDGET_CSS = getattr(settings, 'PAGEDOWN_WIDGET_CSS', ('pagedown/demo/browser/demo.css', ))
EXTENSIONS = getattr(settings, 'PAGEDOWN_EXTENSIONS', [])
3 changes: 3 additions & 0 deletions pagedown/static/pagedown_init.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ DjangoPagedown = (function() {

var init = function() {
that.converter = Markdown.getSanitizingConverter();
Markdown.Extra.init(that.converter, {
extensions: "all"
});
that.elements = document.getElementsByTagName("textarea");
that.editors = {};
for (var i = 0; i < that.elements.length; ++i){
Expand Down
2 changes: 2 additions & 0 deletions pagedown/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ def _media(self):
},
js=(
compatible_staticpath("pagedown/Markdown.Converter.js"),
compatible_staticpath('pagedown-extra/pagedown/Markdown.Converter.js'),
compatible_staticpath("pagedown/Markdown.Sanitizer.js"),
compatible_staticpath("pagedown/Markdown.Editor.js"),
compatible_staticpath('pagedown-extra/Markdown.Extra.js'),
compatible_staticpath("pagedown_init.js"),
))
media = property(_media)
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
def get_submodules():
if path.exists('.git'):
check_call(['rm', '-rf', 'pagedown/static/pagedown'])
check_call(['rm', '-rf', 'pagedown/static/pagedown-extra'])
check_call(['git', 'reset', '--hard'])
check_call(['git', 'submodule', 'init'])
check_call(['git', 'submodule', 'update'])
check_call(['git', 'submodule', 'update', '--init', '--recursive'])


class build_with_submodules(build):
Expand All @@ -27,7 +27,7 @@ def run(self):

setup(
name="django-pagedown",
version="0.1.0",
version="0.1.2",
author="Timmy O'Mahony",
author_email="hey@timmyomahony.com",
url="https://github.com/timmyomahony/django-pagedown",
Expand Down

0 comments on commit 5257aee

Please sign in to comment.