Added Markdown #366

Open
wants to merge 1 commit into
from
Jump to file or symbol
Failed to load files and symbols.
+23 −1
Diff settings

Always

Just for now

View
@@ -11,7 +11,7 @@ gulp.task 'browser-sync', false, ->
notify: false
$.watch [
"#{paths.static.dev}/**/*.{css,js}"
- "#{paths.main}/**/*.{html,py}"
+ "#{paths.main}/**/*.{html,py,md}"
], events: ['change'], (file) ->
browserSync.reload()
View
@@ -16,6 +16,8 @@ class GaeRequest(flask.Request):
app.jinja_env.line_statement_prefix = '#'
app.jinja_env.line_comment_prefix = '##'
+app.jinja_env.add_extension('jinja2_markdown.MarkdownExtension')
+app.jinja_env.markdowner.set_output_format('html5')
app.jinja_env.globals.update(
check_form_fields=util.check_form_fields,
is_iterable=util.is_iterable,
@@ -130,3 +130,21 @@
{{content}}</{{name}}>
#- endif
# endmacro
+
+
+# macro include_md(file, class='')
+ <div class="markdown {{class}}">
+ # markdown
+ # include file
+ # endmarkdown
+ </div>
+# endmacro
+
+
+# macro render_md(text, class='')
+ <div class="markdown {{class}}">
+ # markdown
+ {{text|safe}}
+ # endmarkdown
+ </div>
+# endmacro
View
@@ -4,6 +4,8 @@ flask-oauthlib==0.9.4
flask-restful==0.3.6
flask-wtf==0.14.2
flask==0.12.2
+jinja2-markdown
+markdown==2.6.5
pyjwt==1.5.0
unidecode==0.4.20
webargs==1.7.0