diff options
author | Jason A. Donenfeld | 2015-10-12 16:42:48 +0200 |
---|---|---|
committer | Jason A. Donenfeld | 2015-10-12 16:42:54 +0200 |
commit | ccb4254104ad6faa9225ce91b9a0610f24958022 (patch) | |
tree | 88e0e6dfd8d23db874e8903ea81d5550c63c0a04 /filters | |
parent | 76dc7a3371e487fdc9de7b3b4c991fe370598f0e (diff) | |
download | cgit-ccb4254104ad6faa9225ce91b9a0610f24958022.tar.gz cgit-ccb4254104ad6faa9225ce91b9a0610f24958022.tar.bz2 cgit-ccb4254104ad6faa9225ce91b9a0610f24958022.zip |
md2html: use pure python
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'filters')
-rwxr-xr-x | filters/html-converters/md2html | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/filters/html-converters/md2html b/filters/html-converters/md2html index 138713d..1488f48 100755 --- a/filters/html-converters/md2html +++ b/filters/html-converters/md2html | |||
@@ -1,5 +1,7 @@ | |||
1 | #!/bin/sh | 1 | #!/usr/bin/env python |
2 | cat <<_EOF | 2 | import markdown |
3 | import sys | ||
4 | print(''' | ||
3 | <style> | 5 | <style> |
4 | .markdown-body { | 6 | .markdown-body { |
5 | font-size: 14px; | 7 | font-size: 14px; |
@@ -277,7 +279,8 @@ cat <<_EOF | |||
277 | border: none; | 279 | border: none; |
278 | } | 280 | } |
279 | </style> | 281 | </style> |
280 | _EOF | 282 | ''') |
281 | echo "<div class='markdown-body'>" | 283 | print("<div class='markdown-body'>") |
282 | markdown_py -o html5 | 284 | # Note: you may want to run this through bleach for sanitization |
283 | echo "</div>" | 285 | markdown.markdownFromFile(input=sys.stdin, output_format="html5") |
286 | print("</div>") | ||