diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/comments.py | 3 | ||||
-rwxr-xr-x | scripts/myemph.py | 7 | ||||
-rwxr-xr-x | scripts/tikz.py | 2 |
3 files changed, 7 insertions, 5 deletions
diff --git a/scripts/comments.py b/scripts/comments.py index 304af1a2d..ded21039c 100755 --- a/scripts/comments.py +++ b/scripts/comments.py @@ -15,8 +15,7 @@ incomment = False def comment(k,v,fmt): global incomment if k == 'RawBlock': - f, s = v - fmt = f['unFormat'] + fmt, s = v if fmt == "html": if re.search("<!-- BEGIN COMMENT -->", s): incomment = True diff --git a/scripts/myemph.py b/scripts/myemph.py index e527a0b2e..2a322b385 100755 --- a/scripts/myemph.py +++ b/scripts/myemph.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -from pandoc import toJSONFilter, rawInline +from pandoc import toJSONFilter """ Pandoc filter that causes emphasis to be rendered using @@ -7,9 +7,12 @@ the custom macro '\myemph{...}' rather than '\emph{...}' in latex. Other output formats are unaffected. """ +def latex(s): + return {'RawInline': ['latex', s]} + def myemph(k, v, f): if k == 'Emph' and f == 'latex': - return [rawInline("latex", "\\myemph{")] + v + [rawInline("latex","}")] + return [latex('\\myemph{')] + v + [latex('}')] if __name__ == "__main__": toJSONFilter(myemph) diff --git a/scripts/tikz.py b/scripts/tikz.py index 7e1ed7927..4ff8b2383 100755 --- a/scripts/tikz.py +++ b/scripts/tikz.py @@ -44,7 +44,7 @@ def tikz2image(tikz, filetype, outfile): def tikz(key, value, format): if key == 'RawBlock': [fmt, code] = value - if fmt['unFormat'] == "latex" and re.match("\\\\begin{tikzpicture}", code): + if fmt == "latex" and re.match("\\\\begin{tikzpicture}", code): outfile = imagedir + '/' + sha1(code) if format == "html": filetype = "png" |