From ba498ef4d82672767d5b37d007d55a060955f14a Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Tue, 14 May 2019 20:38:04 -0400 Subject: bin/news: Add markdown. * bin/news (markdown): New function. --- bin/news | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/bin/news b/bin/news index 09a57f8..6b75443 100644 --- a/bin/news +++ b/bin/news @@ -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) -- cgit v1.2.3