summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2019-05-14 20:38:04 -0400
committerrsiddharth <s@ricketyspace.net>2019-05-14 20:38:04 -0400
commitba498ef4d82672767d5b37d007d55a060955f14a (patch)
tree7482e966b8fd5f02ae674ee468e36f224d1dd246 /bin
parent2287d4bcf51da75f74f89306e09ee1b79e518e98 (diff)
bin/news: Add markdown.
* bin/news (markdown): New function.
Diffstat (limited to 'bin')
-rw-r--r--bin/news14
1 files changed, 14 insertions, 0 deletions
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)