Discussion:
Example of python filter involving pandocfilters.Link
Ben White
2017-01-04 09:29:18 UTC
Permalink
I am using pandoc 1.16.0.2 with the python pandoc filters. I noticed that
the Link constructor now takes 3 parameters, so the above is not valid for
this version. Does anybody know what the parameters should be now? Thx
--
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+***@googlegroups.com.
To post to this group, send email to pandoc-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/f592c253-d183-4e7f-8424-d2c4ea861b35%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Sergio Correia
2017-01-04 11:18:03 UTC
Permalink
You can see the definitions here:
https://github.com/jgm/pandoc-types/blob/master/Text/Pandoc/Definition.hs#L264

So you would do *Link(attributes, label, target)*, with *attributes* the
new argument.

You can also see this with a quick call to pandoc:

*>echo [Link](url "title"){.class x=123 #id} | pandoc --to=native*
*[Para [Link ("id",["class"],[("x","123")]) [Str "Link"] ("url","title")]]*

I'm not 100% sure, but if you don't want anything in attributes, you could
just add

*attributes = ["",[],[]]*

And then create *Link(attributes, ...)*
Post by Ben White
I am using pandoc 1.16.0.2 with the python pandoc filters. I noticed that
the Link constructor now takes 3 parameters, so the above is not valid for
this version. Does anybody know what the parameters should be now? Thx
--
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+***@googlegroups.com.
To post to this group, send email to pandoc-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/dc036b87-28ca-42e8-8282-3952d7cd289f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Ben White
2017-01-04 11:39:06 UTC
Permalink
That's really useful, thanks a lot.

Spent some time digging about in the haddock docs to find the type defs,
but the source in the link is easier to figure out.
--
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+***@googlegroups.com.
To post to this group, send email to pandoc-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/bbf4a7b9-d2c9-4320-b5d8-b392ab2877c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...