neocgit

a more 'modern' version of cgit
Log | Files | Refs | Submodules | README | LICENSE | git clone https://git.ne02ptzero.me/git/neocgit

commit ccb4254104ad6faa9225ce91b9a0610f24958022
parent 76dc7a3371e487fdc9de7b3b4c991fe370598f0e
Author: Jason A. Donenfeld <Jason@zx2c4.com>
Date:   Mon, 12 Oct 2015 16:42:48 +0200

md2html: use pure python

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>

Diffstat:
Mfilters/html-converters/md2html | 15+++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/filters/html-converters/md2html b/filters/html-converters/md2html @@ -1,5 +1,7 @@ -#!/bin/sh -cat <<_EOF +#!/usr/bin/env python +import markdown +import sys +print(''' <style> .markdown-body { font-size: 14px; @@ -277,7 +279,8 @@ cat <<_EOF border: none; } </style> -_EOF -echo "<div class='markdown-body'>" -markdown_py -o html5 -echo "</div>" +''') +print("<div class='markdown-body'>") +# Note: you may want to run this through bleach for sanitization +markdown.markdownFromFile(input=sys.stdin, output_format="html5") +print("</div>")