Hi John --

I am finally getting back to try writing such a filter. I am opting to use the python pandocfilters package to intercept this with toJSONFilter. But I don't seem to be getting it.

I think I have it close but don't know how to handle the lines in the metadata include-after before the start of the reference header.

But when I run pandoc with the filter, I get pandoc: The key "MetaList" was not found

How should I be handling the metadata lines in the jsonfilter? How do I prepend this before the reference Header object?

Thanks!

from pandocfilters import toJSONFilter, RawBlock, Header
import sys


def latex(x):
    return RawBlock('latex', x)


def references_includeafter(key, value, format, meta):
    if key == 'Header':
        [level, [ident, _, _], content] = value
        if ident == "references":
            if format == "latex":
                # insert include-after lines before start of reference header
                includeafter = meta.get('include-after', {})
                print >> sys.stderr, str(includeafter)
                return includeafter

if __name__ == "__main__":
    toJSONFilter(references_includeafter)



--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/7cc8e08e-14fd-4d56-b258-036540acba31%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.