about summary refs log tree commit diff stats
path: root/filters/html-converters
diff options
context:
space:
mode:
Diffstat (limited to 'filters/html-converters')
-rwxr-xr-xfilters/html-converters/md2html6
1 files changed, 5 insertions, 1 deletions
diff --git a/filters/html-converters/md2html b/filters/html-converters/md2html index 67141ba..c8ee7d9 100755 --- a/filters/html-converters/md2html +++ b/filters/html-converters/md2html
@@ -1,5 +1,6 @@
1#!/usr/bin/env python 1#!/usr/bin/env python
2import markdown 2import markdown
3from pygments.formatters import HtmlFormatter
3print(''' 4print('''
4<style> 5<style>
5.markdown-body { 6.markdown-body {
@@ -277,9 +278,12 @@ print('''
277 background-color: transparent; 278 background-color: transparent;
278 border: none; 279 border: none;
279} 280}
281''')
282print(HtmlFormatter(style='pastie').get_style_defs('.highlight'))
283print('''
280</style> 284</style>
281''') 285''')
282print("<div class='markdown-body'>") 286print("<div class='markdown-body'>")
283# Note: you may want to run this through bleach for sanitization 287# Note: you may want to run this through bleach for sanitization
284markdown.markdownFromFile(output_format="html5") 288markdown.markdownFromFile(output_format="html5", extensions=["markdown.extensions.fenced_code", "markdown.extensions.codehilite", "markdown.extensions.tables"], extension_configs={"markdown.extensions.codehilite":{"css_class":"highlight"}})
285print("</div>") 289print("</div>")