From: Jason A. Donenfeld Date: Tue, 23 Feb 2016 05:32:03 +0000 (+0100) Subject: md2html: Do syntax highlighting too X-Git-Url: https://gitweb.ps.run/ps-cgit/commitdiff_plain/1892cd9a603e1eda206c40efb576bd75b7532be6?ds=sidebyside md2html: Do syntax highlighting too --- 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 @@ #!/usr/bin/env python import markdown +from pygments.formatters import HtmlFormatter print(''' ''') print("
") # Note: you may want to run this through bleach for sanitization -markdown.markdownFromFile(output_format="html5") +markdown.markdownFromFile(output_format="html5", extensions=["markdown.extensions.fenced_code", "markdown.extensions.codehilite", "markdown.extensions.tables"], extension_configs={"markdown.extensions.codehilite":{"css_class":"highlight"}}) print("
")