From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/18269 Path: news.gmane.org!.POSTED!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: How to add raw Markdown in filter? Date: Sun, 8 Oct 2017 20:50:26 -0700 Message-ID: <20171009035026.GF20728@Johns-MacBook-Pro.local> References: 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"; format=flowed X-Trace: blaine.gmane.org 1507521044 28203 195.159.176.226 (9 Oct 2017 03:50:44 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 9 Oct 2017 03:50:44 +0000 (UTC) User-Agent: Mutt/1.6.2 (2016-07-01) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCJZJHG45QDBBD7E5PHAKGQE46P3RZI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon Oct 09 05:50:40 2017 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-it0-f61.google.com ([209.85.214.61]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e1P5N-0005jl-9S for gtp-pandoc-discuss@m.gmane.org; Mon, 09 Oct 2017 05:50:33 +0200 Original-Received: by mail-it0-f61.google.com with SMTP id 72sf2705495itl.1 for ; Sun, 08 Oct 2017 20:50:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1507521040; cv=pass; d=google.com; s=arc-20160816; b=NDV5dYsI+AqeDFiIz4wZhtzzGFVd1LCYarGeT9R/DKSy6tPYi4kfC7Rkw5PshWHM5A ii3AF2s27d9ngrPR9XbLZE8wzjXaQ9skEiw1v+RWWHT2mcFvENGAxldMouCzPJeSMXaP C/INyXeR1fggl5ik9TCvIL5iTYfQQRClUdqYRGCPUm2SE2zZDjv2/upatdqc2la1luJ4 TjjRK/+6VRtCxI6WuOalO/PlztwLio/01A7D1uDIy0vR+MArTJDllayzpaOmK52l2LHJ SWiBaNFLZbgfRxMjwZdjPh3IYPItm4c4slpMz5xC7vP1j88NkDcb2lYdltligrkiKmjt KqNA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:to :date:from:arc-authentication-results:arc-message-signature:sender :dkim-signature:arc-authentication-results; bh=MQ8vxx1+zjXHNfswCe/h0YMTKTQjW7YU4Nozr+BJnE0=; b=wArKHde0lCydNRtjs2p/UmF3zVf/5rsHt5PwUVvb8NhKrYlzUBL1reYR1xlgMpDMcV oCBEnHy4EBItLNdznn3jjxVkFLNSV9okSlNKMAOiejbU5HfmmhT61LRnXumVQ1R9b1a/ SFoYoDaRAPdPa73AwpYdqQeu1TKhBsbklEJYGMGrTF7jGGOCpN8EwQ0bJi0nLh1iBlyR htWbP8lPDjm/ekEKHqjQcZ7FurnYrFXR20+LmI7raTuNIBGNo6PbtIoskQeSbCO/qJcl EFvGfl83xI2rgunmYwZ86Y6bC5m2s7gLXyUcnKtjGNBrYksLXEVALdT7lhjZMhWbqr0t ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=vczyPZy+; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:400e:c00::231 as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:date:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=MQ8vxx1+zjXHNfswCe/h0YMTKTQjW7YU4Nozr+BJnE0=; b=BEPn1KwEztupTXn77b49ezHOSsafiD0C0Wo6CLmsuKfjsgEBWyikY2/zkha/m0JXY9 w2Z91V69HPvuaE/L9gjxtHluPqnQBZJmFyVoEEcSMlYk33QWXJNEBlcLAh/HSB7n8Wtl qAdVpE5ljFlFS/CSsG0ZnBW0Z3uR4hWS1m2htnzAWdInc6tX/MaKI5iBSgZsml7XTG3P 4s4aB2QMczCULAGPgycTh80LjP+1WRmZiaJwhzqg9QzwxpJBNaL3cTRB5pbesYGtClsL jp+L5lp7cGq1YaSNwf5n1FVYsFAsXELRtbIgLM4Kmoek34TsKn4xLkLv/RzAI2TyPCQL JL6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:date:to:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent :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=MQ8vxx1+zjXHNfswCe/h0YMTKTQjW7YU4Nozr+BJnE0=; b=kSthGjXsIXME0+mk+cz5WUXQiAsN9IgA1wGse0e/QgWLo836sujCAtHYooj79mVuVN t2C+uOGip24NN2CkBBuqoXNoXdQsHX8/QINsrEESESd4CaUbppk2v45qvaeUJ73EIWtj nZ8S1RNkyE+GmXWQPG3b8GpPgtFGsKMa4JcV05MygABr56wXBIt3gCACtHtZAAek1OiI E+bcQstF+rce/Fq3lcsLUC1wEXLBjFZ4UKVlTyILYJntG6ZpQEkQMsHd1DE20mFBAXCd dN4znoXn4sFPx1tlVDpPpzNre6MJyRBZPAuEDQvIVvZ0ItybrwVnQ/KSt8MPJJuT7t3Z Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AMCzsaWrTt+UFcinhg4mXFZDpWAg2bZVMRo3s2ShuSU8xHk5ro9DCt5K lNuQpyaK/tu+I+NrvD8HrJo= X-Google-Smtp-Source: AOwi7QCWj3/GfSjgB+aQjHKVwGz1rQpMm9AQ+flMcX16SDVYAdjzBVwm5g2Wd+rC7BEBixb4g1lCPQ== X-Received: by 10.36.116.141 with SMTP id o135mr763itc.0.1507521040526; Sun, 08 Oct 2017 20:50:40 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.99.96.72 with SMTP id u69ls878880pgb.14.gmail; Sun, 08 Oct 2017 20:50:39 -0700 (PDT) X-Received: by 10.99.114.29 with SMTP id n29mr687897pgc.15.1507521039429; Sun, 08 Oct 2017 20:50:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507521039; cv=none; d=google.com; s=arc-20160816; b=OriWFq6bTlgLNp7CxzB5d0rRgCvQCYhzs9i/ZSxqevfp5FNaIyoUCpyILx7MlRNoVG ubPu8WUzUtfC1POKsKF/C0phP0zOf3YtFNoTxUSjUq8wwfmgMy0lBuDbbEslcJnb2Ifi 45WRsS+TuTQdXSQbXyFbAw/kpRoH2T2f0xEcaeJgW9iBzJUiOAztGexOAd9+SPIbkcF+ IliaRyYCbKZRisrroUQVPMjDDfbg9t4XN0f96U8B9WKEX+n27NCWoCwldbOqcrHVQSOl sSpQhwoqRjZfBpQuXE0rvYiOiJ1XV57FFzI8Ek3jatFdc1/DodoSPfqID1DrycdfIdL5 5ybw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:to:date:from:dkim-signature :arc-authentication-results; bh=F7ryTavAe7UAvCOw9vCgm08bllsue4jQWoe/k5eZE2I=; b=UU91KaS+532242/iJAll/CYSgWX2/7KfKkFooFW0htoX/oAirxdTXrke+NshbIjyyl JfSeQ6R9ZXFyERZnhwDfeLrpL4yWTvrk8lP6eDEtqV90NB5HwQ/A4/OlDdUn0hOFMnAz ABLOSUfouLzyh/BqTd9Nt4SVbuAEUu4xjdu816VZTUBKsyuy4Agu3le1dTvUhrFOogWw n3lZnfGUNUXKMJbBGLQgkarFG5jFKmIbPov89An5h3jYdkT/alw8qSScHThl9KDY0vHW UvnW63UCnGe274BUEfN9BiwUjKTBot94qwoU6JERG3GugjHJKbIAe9MMwHuV3i6BTCUC xAsQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=vczyPZy+; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:400e:c00::231 as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org Original-Received: from mail-pf0-x231.google.com (mail-pf0-x231.google.com. [2607:f8b0:400e:c00::231]) by gmr-mx.google.com with ESMTPS id u89si819041pfi.27.2017.10.08.20.50.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Oct 2017 20:50:39 -0700 (PDT) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:400e:c00::231 as permitted sender) client-ip=2607:f8b0:400e:c00::231; Original-Received: by mail-pf0-x231.google.com with SMTP id n73so5825139pfg.10 for ; Sun, 08 Oct 2017 20:50:39 -0700 (PDT) X-Received: by 10.98.35.194 with SMTP id q63mr8792188pfj.15.1507521038809; Sun, 08 Oct 2017 20:50:38 -0700 (PDT) Original-Received: from johnmacfarlane.net (li55-134.members.linode.com. [74.82.3.134]) by smtp.gmail.com with ESMTPSA id m9sm11305086pgt.49.2017.10.08.20.50.37 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 08 Oct 2017 20:50:37 -0700 (PDT) Original-Received: by johnmacfarlane.net (Postfix, from userid 1000) id AEC28A1ED; Sun, 8 Oct 2017 23:50:26 -0400 (EDT) Content-Disposition: inline In-Reply-To: X-PGP-Key: http://johnmacfarlane.net/jgm.asc X-Original-Sender: jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=vczyPZy+; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:400e:c00::231 as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org 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:18269 Archived-At: If you write the filter in Haskell, you can simply use the readMarkdown file from Text.Pandoc to parse the Markdown. Note that the lua filters functionality in the dev version also provides access to the parsers, so you can do this in lua also. In other languages you'd have to shell out to pandoc. +++ Ivan Lazar Miljenovic [Oct 09 17 12:38 ]: >Is there any way using a filter to be able to inject markdown into a >document using a filter and have it be parsed/processed when >converting? Ideally, I'd like to be able to generate PDF from the >result (`pandoc --read=markdown --write=latex --output=foo.pdf >--filter=./myFilter input.md`). > >Using `RawBlock "markdown"` doesn't work as the rest of the document >has already been parsed, so the contents of those blocks are then >ignored. > >As such, as far as I'm aware my options are: > >* Try and write my own mini-parser that handles a subset of Markdown >and thus the filter can inject the correct Haskell representation of >the intended Markdown > >* Use a 2-stage process for Pandoc to first apply the filter and write >out to Markdown, then pipe the results into Pandoc to convert to PDF >(not ideal as this is for a library that should be able to just >generate whatever results you want). > >Is there anything else I can try and do? > >-- >Ivan Lazar Miljenovic >Ivan.Miljenovic-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org >http://IvanMiljenovic.wordpress.com > >-- >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/CA%2Bu6gbxdqnG3Ok00OmZiC1V4kW6GyAZKnuS2robnJNq%2Bz_Z2AQ%40mail.gmail.com. >For more options, visit https://groups.google.com/d/optout.