diff options
| author | John MacFarlane <[email protected]> | 2013-08-13 23:11:33 -0700 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2013-08-13 23:11:33 -0700 |
| commit | f6b5735d095dcfe2b0ef4aab02ff85acb47140c6 (patch) | |
| tree | fbfb22b2c47c934796a7f79bdafab57326cf5d53 /scripts/comments.py | |
| parent | bd73d73a28acc2863bd52bdc6f0f9d850fa34d84 (diff) | |
Added module for writing python scripts, with several examples.
See scripts subdirectory.
Diffstat (limited to 'scripts/comments.py')
| -rwxr-xr-x | scripts/comments.py | 23 |
1 files changed, 23 insertions, 0 deletions
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("<!-- BEGIN COMMENT -->", s): + incomment = True + return [] + elif re.search("<!-- END COMMENT -->", s): + incomment = False + return [] + if incomment: + return [] # suppress anything in a comment + +if __name__ == "__main__": + toJSONFilter(comment) |
