public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* How to write a filter that modifies existing Pandoc output for a given format
@ 2017-01-26 18:36 Guillermo Rodriguez Garcia
       [not found] ` <057183b6-1f28-402c-b5be-2abd63bf9e16-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Guillermo Rodriguez Garcia @ 2017-01-26 18:36 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1344 bytes --]

Hello all,

I have written simple Pandoc filters that do some modifications on Pandoc's 
AST -- for example, to generate certain LaTeX environments/constructs when 
a Div with certain classes is used in the input file. This worked fine.

However I am not sure how to write a filter that will only make some minor 
changes to the output for a given writer. Here's an example: I would like 
to write a filter so that if an image link contains a ".framed" class, then 
if generating LaTeX output, the \includegraphics command should include a 
[frame] option (this requires the adjustbox package to work).

I am not sure how to do this without replicating all the code Pandoc 
already uses to write out an image link in LaTeX.

Is there a way to do this?

Best, 

Guillermo


-- 
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/057183b6-1f28-402c-b5be-2abd63bf9e16%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 1941 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-01-27 17:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-26 18:36 How to write a filter that modifies existing Pandoc output for a given format Guillermo Rodriguez Garcia
     [not found] ` <057183b6-1f28-402c-b5be-2abd63bf9e16-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2017-01-27  8:02   ` Kolen Cheung
     [not found]     ` <87384a6a-0d44-4c37-889f-2336df472b5d-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2017-01-27  8:12       ` Guillermo Rodriguez Garcia
     [not found]         ` <CABDcavaTvmTwhO8ZxLALO-m5XpmHQ7e_KC1C2eEQm+hVBzTKcQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-01-27  8:59           ` Kolen Cheung
     [not found]             ` <13e970b8-19e5-4cce-a72e-00e8d74f878c-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2017-01-27  9:07               ` Guillermo Rodriguez Garcia
     [not found]                 ` <CABDcavbj898MDS1s02ZP_sakG_vgnW7eEyKDXUmPExeF1evhUA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-01-27 17:33                   ` Kolen Cheung

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).