summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rw-r--r--bin/feed12
-rw-r--r--bin/html12
2 files changed, 8 insertions, 16 deletions
diff --git a/bin/feed b/bin/feed
index 69dff74..dce595c 100644
--- a/bin/feed
+++ b/bin/feed
@@ -10,9 +10,8 @@ import datetime
import os
import os.path
import re
-import subprocess as subp
import sys
-
+import mistune
URL = 'http://fsf.org.in'
SECTIONS = ['news', 'article']
@@ -123,15 +122,12 @@ def time(c):
def markdown(c):
try:
- r = subp.run(['bin/markdown'],
- input=c,
- stdout=subp.PIPE,
- check=True,
- universal_newlines=True)
+ r = mistune.markdown(c, False, parse_block_html=True, parse_inline_html=True)
+
except Exception as e:
p('Markdown failed for {}'.format(c))
- return r.stdout
+ return r
def massage(c):
diff --git a/bin/html b/bin/html
index 627cd83..e071763 100644
--- a/bin/html
+++ b/bin/html
@@ -10,9 +10,8 @@ import os
import os.path
import re
import stat as st
-import subprocess as subp
import sys
-
+import mistune
SECTIONS = ['news', 'article']
@@ -128,15 +127,12 @@ def datefmt(d):
def markdown(c):
try:
- r = subp.run(['bin/markdown'],
- input=c,
- stdout=subp.PIPE,
- check=True,
- universal_newlines=True)
+ r = mistune.markdown(c, False, parse_block_html=True, parse_inline_html=True)
+
except Exception as e:
p('Markdown failed for {}'.format(c))
- return r.stdout
+ return r
def lhref(sec, s, l):