diff options
-rwxr-xr-x | filters/html-converters/md2html | 6 |
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 |
2 | import markdown | 2 | import markdown |
3 | from pygments.formatters import HtmlFormatter | ||
3 | print(''' | 4 | print(''' |
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 | ''') | ||
282 | print(HtmlFormatter(style='pastie').get_style_defs('.highlight')) | ||
283 | print(''' | ||
280 | </style> | 284 | </style> |
281 | ''') | 285 | ''') |
282 | print("<div class='markdown-body'>") | 286 | print("<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 |
284 | markdown.markdownFromFile(output_format="html5") | 288 | markdown.markdownFromFile(output_format="html5", extensions=["markdown.extensions.fenced_code", "markdown.extensions.codehilite", "markdown.extensions.tables"], extension_configs={"markdown.extensions.codehilite":{"css_class":"highlight"}}) |
285 | print("</div>") | 289 | print("</div>") |