From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/16827 Path: news.gmane.org!.POSTED!not-for-mail From: Guillermo Rodriguez Garcia Newsgroups: gmane.text.pandoc Subject: Re: How to write a filter that modifies existing Pandoc output for a given format Date: Fri, 27 Jan 2017 10:07:43 +0100 Message-ID: References: <057183b6-1f28-402c-b5be-2abd63bf9e16@googlegroups.com> <87384a6a-0d44-4c37-889f-2336df472b5d@googlegroups.com> <13e970b8-19e5-4cce-a72e-00e8d74f878c@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1485508079 24742 195.159.176.226 (27 Jan 2017 09:07:59 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 27 Jan 2017 09:07:59 +0000 (UTC) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDQ4FHFP44PRBYE3VTCAKGQEFYN5BWA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Jan 27 10:07:55 2017 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-wm0-f61.google.com ([74.125.82.61]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cX2VP-0004oh-8t for gtp-pandoc-discuss@m.gmane.org; Fri, 27 Jan 2017 10:07:39 +0100 Original-Received: by mail-wm0-f61.google.com with SMTP id f73sf61461043wmf.1 for ; Fri, 27 Jan 2017 01:07:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:mime-version:in-reply-to:references:from:date:message-id :subject:to:content-transfer-encoding:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=URE2mX5XbImCv/dL6mgtttI68vj/jO6nr8+Z+Yp8vck=; b=olwUltyVnPRcrW+RyZgNDmRO9kkLfo/80bEzqgW0dUWYl7T2h2XdyXrI+tNlbrP/K4 xjNMCxCGVCARCdtYuahMOCoL/y+PLOeS1luoduWmnnKFhj2NUSnwC4gtUpKuk6YhqROV dzl79hVfErZuvoeqxmdzW3FYMmdRrBTwYheZzHI4GOSPE9Q5aE4Wz0asnEJ4ORD/45bI T1VlN3/jnFTmcnp0ea66GVt5BWdqHLMti0Efa8FpVvJo/KqZo6leEmlTW9OMyXLIOZ4o yyQd91o34ElHJOQD4TO+jbKQ16DfKLeW0xTgHvkNjcKN2uuQHjKD5vmHsYhZK1H9tT1k shFA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-transfer-encoding:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=URE2mX5XbImCv/dL6mgtttI68vj/jO6nr8+Z+Yp8vck=; b=ZJQqhCEU5iqwTzq7V+qKz2Bjd5gFFgoYfgXt/FCVWSjVtoiLoYdizQgJtHOjFv2VOx ZWoWk8433+tpyqUhp2yLe5VF5Q/805g/obZRqwrD9pOb3JaXJAD+4u9Euua8IAE0cwc3 L1acfahyiDeOyRFJ6KbirSqFgs+xN+XUmywpB6O2KjSXgI8ilR+7QHQAP5vAvoeHDtga LDIbSw9BI5Krcp0XMkITpIMQgJ2LRyhWRPFMduqKx73pD9ovoUxL2QPSzDERG6UOCaF5 bPQguIaALdrRh3rIx58qaSZEvZokXDXo+4Gxgcw0m2CZcR2rbJNpcrP54k91C2YU+P8u HqKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:in-reply-to:references:from :date:message-id:subject:to:content-transfer-encoding :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=URE2mX5XbImCv/dL6mgtttI68vj/jO6nr8+Z+Yp8vck=; b=NGX36Q1X6o38SeuxXvUurY12rFSQWS8D9CLF17PT2mMObMhZnyKswBzbPFOtLHh/da oWhxiTtMALm1XG+IU/G4CaMVRbQfuSRMTjdulmCKD2V3d54ujQMBzXcgUk7AaOyWFJIx nzZppTQEeO0G5/2c474c/wxyUwAKSq2thtzE/Mj5EZuZAC1ZEO6eZNro0bHM7crpAuI2 DGrKsE8Fx4BlEdV7NNn6sGsoIhbYwhtmyhBaZ/syKTWgieWeh+oDU+dib4N6mWzucEHn HXYS4C2p2uWmrQPt3b37rOoO0Z2elCByCveBenJqJVW0BuEfnOGcPC4muiO0x8iE7+HP Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AIkVDXKPljxA8uijaRyzJZxtxWsqIIBWDFaaXvFOpBLM7xvNZZlhD2Q8EgNlgVLH1sOi4Q== X-Received: by 10.25.199.132 with SMTP id x126mr57720lff.19.1485508064930; Fri, 27 Jan 2017 01:07:44 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.46.80.6 with SMTP id e6ls43491ljb.28.gmail; Fri, 27 Jan 2017 01:07:44 -0800 (PST) X-Received: by 10.46.7.1 with SMTP id 1mr628653ljh.3.1485508064118; Fri, 27 Jan 2017 01:07:44 -0800 (PST) Original-Received: from mail-wm0-x234.google.com (mail-wm0-x234.google.com. [2a00:1450:400c:c09::234]) by gmr-mx.google.com with ESMTPS id d207si550364wmd.1.2017.01.27.01.07.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Jan 2017 01:07:44 -0800 (PST) Received-SPF: pass (google.com: domain of guille.rodriguez-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:400c:c09::234 as permitted sender) client-ip=2a00:1450:400c:c09::234; Original-Received: by mail-wm0-x234.google.com with SMTP id r126so107624611wmr.0 for ; Fri, 27 Jan 2017 01:07:44 -0800 (PST) X-Received: by 10.28.225.215 with SMTP id y206mr2036406wmg.138.1485508063670; Fri, 27 Jan 2017 01:07:43 -0800 (PST) Original-Received: by 10.28.99.138 with HTTP; Fri, 27 Jan 2017 01:07:43 -0800 (PST) In-Reply-To: <13e970b8-19e5-4cce-a72e-00e8d74f878c-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: guille.rodriguez-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com; spf=pass (google.com: domain of guille.rodriguez-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:400c:c09::234 as permitted sender) smtp.mailfrom=guille.rodriguez-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.org gmane.text.pandoc:16827 Archived-At: I think the use case I described is a good example of a context-dependent conversion. Pandoc handles image links differently depending on whether they are the only thing in a paragraph (in LaTeX this results in a float) or whether they are inline in the text. This is (a simplified example of) the kind of logic I don't want to duplicate... 2017-01-27 9:59 GMT+01:00 Kolen Cheung : > Ah, yes, it is actually possible to do that. e.g. if you use panflute, it= has a function convert_text that call pandoc to make the conversion. So yo= u could convert that element from "panflute AST" to LaTeX, then use the re = module to regex it to your liking. A potential issue is if a certain conver= sion is context-dependent (I can't name any example for the moment). Guillermo Rodriguez Garcia guille.rodriguez-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org --=20 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 e= mail 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/CABDcavbj898MDS1s02ZP_sakG_vgnW7eEyKDXUmPExeF1evhUA%40mail.g= mail.com. For more options, visit https://groups.google.com/d/optout.