fsfi

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit ba498ef4d82672767d5b37d007d55a060955f14a
parent 2287d4bcf51da75f74f89306e09ee1b79e518e98
Author: rsiddharth <s@ricketyspace.net>
Date:   Tue, 14 May 2019 20:38:04 -0400

bin/news: Add markdown.

* bin/news (markdown): New function.

Diffstat:
bin/news | 14++++++++++++++
1 file changed, 14 insertions(+), 0 deletions(-)

diff --git 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)