From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/23045 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: pbeltran Newsgroups: gmane.text.pandoc Subject: Re: Conditional compilation - How to? Date: Wed, 26 Jun 2019 01:40:11 -0700 (PDT) Message-ID: <695a09ca-b37a-4cee-a9bc-a321c0477d95@googlegroups.com> References: <61bdaf46-d88a-4ef1-b145-71ad5900fed8@googlegroups.com> <44645f9a-1670-4f4e-93cc-e24394fa10f4@googlegroups.com> <5fc2de0f-82db-4d02-9dc9-ff5db8a8b9b4@googlegroups.com> <5a4d26a3-b9b7-dda1-d437-6e7cdd519dba@gmail.com> <1375b479-60d6-4514-8c72-db60f3355ab8@googlegroups.com> <9ab5d37d-74c0-4793-81fe-c6cdab9e253d@googlegroups.com> <4f0d389c-c21c-4069-a344-ef6ce1efb113@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_2410_102705439.1561538411735" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="256448"; mail-complaints-to="usenet@blaine.gmane.org" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDR3TD5H7MBRB3G6ZTUAKGQEDHS4U4Y-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Jun 26 10:40:14 2019 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-oi1-f190.google.com ([209.85.167.190]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1hg3TS-0014ZR-HG for gtp-pandoc-discuss@m.gmane.org; Wed, 26 Jun 2019 10:40:14 +0200 Original-Received: by mail-oi1-f190.google.com with SMTP id 186sf705816oid.17 for ; Wed, 26 Jun 2019 01:40:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:date:from:to:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=JNvzUS5i+hj3vxoILyPQRcBBq2yKi5lMXozbBD/4oDg=; b=IhoXUL2Vd9DG1LVgpmTuSabeXoBAfTKl/k1ppIFw/tbQ/UucPtRTPAPVQ8h2W3XOAr IUmVAdF3eeLmvMTEHEvZO8WX/2cB/dodQaY2tA3I6KsJnIFUkpHW+ru3vVTfFJ6aT99k YfuV1jQwGFEM65B1+ysX+dtSVie6oumx0fPti5yrCipCAwtY9P07G7ar+ELnJv4cWtLr DMEN2kAC6dMfyg7UJctfpJgXWBRa3T7CvM0i40wQh9YWvne0rY6vvWY8UDEmWS1HCsKx e95z8RNgR01qeSJwZ+Ww7sI3VsbF9J7Qa/zJbxC33oVbDY4ry5cXeiRvVGVE2/6xi7Hq KyWw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=JNvzUS5i+hj3vxoILyPQRcBBq2yKi5lMXozbBD/4oDg=; b=EQegcfCVDYNsuiig14ezgWv84waBcOGkT5NnnbEzkhJ03OT8nXrn+8/cHkUV8FQ+dA FAwbdAfXnjtICgT/HdxEc1DoxCjse0ohWgNyAdSiMT4X9rMH/A+013NMzod4rI/sO6kf ZG1onbM2Voj7bN1Dg/ZuxJSyN0tBMQEtVR8TEvf284qOY/pz1ZXQ2puX8Hn6+LhHW5/W OQjnTwZAauWUpthypIJJ4smp9+vWKepWZGWRpqbCWQGb9Lp04Ohn168GrHtuzSgs0CTv dMo/3qZ9SuDRb7MzskMdWm8xdHm9aDhCotSLuBIEaQ5Tu1FRDJxDgRvfqI+F6IUSYWUE oUNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:date:from:to:message-id:in-reply-to :references:subject:mime-version:x-original-sender:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=JNvzUS5i+hj3vxoILyPQRcBBq2yKi5lMXozbBD/4oDg=; b=DfJq+349TqEedwTTIGOO2dSiMVLEc2VPGQJODGFIoUSWE2qTM+kZNQ2ZUjPysjhlo5 kSjxzsMU3+DNB62uIcZxniwQn7hpyvobIVD3kBk9Lh95UBjA1V9PAQhhUzW4aECol3CK iYQEVAld603kmvSxzkSG5t/i5mwPaw+bt6g/UVmdxrUveJz3jONY5jhG2I40okyeiZAt N0hXbzJnVZldXvg96hXSvTZ2bmUBnjTgLgh8up3Qi7CUVH9FRLpP4SM//ue/00yDUlzY Zy+tVywBQGEiYEMoRhkLQv+Pvx4rRpLqSXfrn5f1UukQjQLSuJZGzoVWu3lEAccvKEO+ eAYA== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: APjAAAWD60Tbmg0sPTGNyiERJ86RvEWa7TX2mlHA/PIeUzD/x0NICc9W 0w54Scidk2Jm+iW+LWyCtNk= X-Google-Smtp-Source: APXvYqxvVj8xfmjL+HPdJcXh8o59rlqYe4K9mDvve6Wg1E04zuU7Rv2uBD72T95J8tssKvCSfqnYxQ== X-Received: by 2002:aca:c382:: with SMTP id t124mr1041114oif.9.1561538413232; Wed, 26 Jun 2019 01:40:13 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:aca:3fc3:: with SMTP id m186ls177665oia.15.gmail; Wed, 26 Jun 2019 01:40:12 -0700 (PDT) X-Received: by 2002:aca:d907:: with SMTP id q7mr999967oig.68.1561538412266; Wed, 26 Jun 2019 01:40:12 -0700 (PDT) In-Reply-To: <4f0d389c-c21c-4069-a344-ef6ce1efb113-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: pabelpe-Re5JQEeQqe8AvxtiuMwx3w@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:23045 Archived-At: ------=_Part_2410_102705439.1561538411735 Content-Type: multipart/alternative; boundary="----=_Part_2411_1516113150.1561538411735" ------=_Part_2411_1516113150.1561538411735 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Great!=20 I'll take a look. Thanks! El mi=C3=A9rcoles, 26 de junio de 2019, 10:31:16 (UTC+2), Hans Kunkell escr= ibi=C3=B3: > > Hi pbeltran, > > ok, I understand. My script is not limited to 2 versions but any number.= =20 > internal and external was just the choice I use. > > I guess a lua filter is better for your workflow, I just wanted to share= =20 > another possible method, it may help some other. > > Have a nice day! > > Hans > > Den onsdag 26 juni 2019 kl. 17:25:02 UTC+9 skrev pbeltran: >> >> Thanks, I'm working with the solution via lua filters, as I need not two= ,=20 >> but several versions. >> >> El mi=C3=A9rcoles, 26 de junio de 2019, 2:56:59 (UTC+2), Hans Kunkell es= cribi=C3=B3: >>> >>> Hi! >>> >>> Perhaps you are satisfied with the way discussed earlier. I have an=20 >>> alternative solution for those who are interested. >>> >>> I also had the need to make two versions of a document where most of th= e=20 >>> contents are the same. My solution was to have single file and where ne= eded=20 >>> write like this: >>> <<< internal >>> Contents here will be in *internal* version. You may include any valid= =20 >>> markdown here. >>> <<< external >>> ... For external version ... >>> >>> >>> >>> The attached bash script will parse the file and depending on targeting= =20 >>> internal or external version (or whatever identifiers you prefer) two= =20 >>> different intermediate files will be created and then processed by pand= oc. >>> >>> This is the way I solved it and if you find it useful for your needs,= =20 >>> please use it! >>> >>> Regards >>> Hans >>> >>> --=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/695a09ca-b37a-4cee-a9bc-a321c0477d95%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. ------=_Part_2411_1516113150.1561538411735 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Great!=C2=A0
I'll take a look. Thanks!

El m= i=C3=A9rcoles, 26 de junio de 2019, 10:31:16 (UTC+2), Hans Kunkell escribi= =C3=B3:
H= i pbeltran,

ok, I understand. My script is not lim= ited to 2 versions but any number. internal and external was just the choic= e I use.

I guess a lua filter is better for your w= orkflow, I just wanted to share another possible method, it may help some o= ther.

Have a nice day!

Ha= ns

Den onsdag 26 juni 2019 kl. 17:25:02 UTC+9 skrev pbeltran:<= blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border= -left:1px #ccc solid;padding-left:1ex">
Thanks, I'm wor= king with the solution via lua filters, as I need not two, but several vers= ions.

El mi=C3=A9rcoles, 26 de junio de 2019, 2:56:59 (UTC+2), Hans = Kunkell escribi=C3=B3:
Hi!

Perhaps you are satisfied with the w= ay discussed earlier. I have an alternative solution for those who are inte= rested.

I also had the need to make two versio= ns of a document where most of the contents are the same. My solution was t= o have single file and where needed write like this:
<<= ;< internal
Contents here will be in *internal* version. You may incl= ude any valid markdown here.
<<< external
... For external v= ersion ...
>>>

The attached ba= sh script will parse the file and depending on targeting internal or extern= al version (or whatever identifiers you prefer) two different intermediate = files will be created and then processed by pandoc.

This is the way I solved it and if you find it useful for your needs, ple= ase use it!

Regards
Hans

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-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/695a09ca-b37a-4cee-a9bc-a321c0477d95%40googlegroups.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_2411_1516113150.1561538411735-- ------=_Part_2410_102705439.1561538411735--