diff options
Diffstat (limited to 'bin')
-rw-r--r-- | bin/news | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -8,6 +8,7 @@ import datetime import os import re +import subprocess as subp import sys @@ -78,6 +79,19 @@ def datefmt(d): return datetime.datetime.strptime(d, '%Y%m%d').strftime('%B %d, %Y') +def markdown(c): + try: + r = subp.run(['bin/markdown'], + input=c, + stdout=subp.PIPE, + check=True, + universal_newlines=True) + except Exception as e: + p('Markdown failed for {}'.format(c)) + + return r.stdout + + def process(f): c = read(f.path) |