From f6b5735d095dcfe2b0ef4aab02ff85acb47140c6 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 13 Aug 2013 23:11:33 -0700 Subject: Added module for writing python scripts, with several examples. See scripts subdirectory. --- scripts/comments.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 scripts/comments.py (limited to 'scripts/comments.py') diff --git a/scripts/comments.py b/scripts/comments.py new file mode 100755 index 000000000..3767f973a --- /dev/null +++ b/scripts/comments.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python +from pandoc import toJSONFilter +import re + +incomment = False + +def comment(k,v,format=""): + global incomment + if k == 'RawBlock': + f, s = v + fmt = f['unFormat'] + if fmt == "html": + if re.search("", s): + incomment = True + return [] + elif re.search("", s): + incomment = False + return [] + if incomment: + return [] # suppress anything in a comment + +if __name__ == "__main__": + toJSONFilter(comment) -- cgit v1.2.3