From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32973 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "'o-Dzin Tridral" Newsgroups: gmane.text.pandoc Subject: Re: Converting reference footnotes to inline footnotes (md -> md if poss.) Date: Wed, 19 Jul 2023 17:19:21 +0100 Message-ID: References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000aefc880600d9652b" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9151"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBD4N5VPWTMERBGM24CSQMGQECYM23NY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Jul 19 18:19:46 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-wm1-f63.google.com ([209.85.128.63]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1qM9tu-00022l-Vd for gtp-pandoc-discuss@m.gmane-mx.org; Wed, 19 Jul 2023 18:19:43 +0200 Original-Received: by mail-wm1-f63.google.com with SMTP id 5b1f17b1804b1-3fbdde92299sf37403555e9.3 for ; Wed, 19 Jul 2023 09:19:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1689783581; cv=pass; d=google.com; s=arc-20160816; b=m5e1N2Qg9mXeHqaIgsIgTo6uEt1a7FcugsllppcrLF02FrGUhVn81DbVBu6ymSrL54 gxjVwJ6HDhMf3/o/eR5FgoUqcF0GtdGIKS4jv31VwCwvl//K7tCV6uDmtzlV1bw52xIq PIZqGYCHuv5UbvOULzIlH1+3Bt/lfjfROGTY4Fxrk7Sd//x21ku+wdTdah2csEGhp6US zXMIspAhhYjMqYbuSP+vT+NVAf+UAS7VumXUqInOAUBRRCBzRtHWy8BmRb7+Zk/KNIus yW9s67HydMhiaVjck6/9Z3hGdjy433V7d6u/J5T+fjRGqtHVHzD/pS+qWG1wPInjWn+t SCNg== 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:to:subject:message-id:date :from:in-reply-to:references:mime-version:sender:dkim-signature :dkim-signature; bh=lGEYw1AT4KNounpVoU7Da3a2f0HSojecfdmAbYEBXxs=; fh=Cqt4aIadhm6/qo0kgMpi25wkX1ZeQyw3MiiUKw6Rs8I=; b=s1UZyFmHpFHAPDznt4bq+F4eI06rItUtJTsMi4f3ZGFKZTNAWv3lVaIm0L0q0Q+P5S Rw2Fz12ZlAemhVyowqoFRvAfnyXdDGa++46kXyh5ONFoHH7x5p7BupjYSGNQn9eiGCKy wifa7yqIppmbieoLNLFalmP7rpDyOPw5uzYx58pIcq2SoS8pLKQ5q6DvX5n6oqLjTY3m XgGgBRXFAp+lD+r0n68Ff+TnT7iZyiId0AiCcLX25UaDIEzo5w21ezCMWVJIb1S1cRmi cYGsQNlxLkttIyrDs8UtXjnzPZCRk7KepPpRrjKF5mpjuabG98wTdJrVQ3A9C7Inpt9q Wxdg== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=d4OlW7Pr; spf=pass (google.com: domain of tridral-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::52a as permitted sender) smtp.mailfrom=tridral-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20221208; t=1689783581; x=1690388381; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:to:subject :message-id:date:from:in-reply-to:references:mime-version:sender :from:to:cc:subject:date:message-id:reply-to; bh=lGEYw1AT4KNounpVoU7Da3a2f0HSojecfdmAbYEBXxs=; b=PjcmfWrXqqZlLWa11FiDjmVe5hAslWgoiC0DQr5GDhM1xnsZRieUkBRn2YP0+A9+28 PqqhmZ2sdaLQ7cSkP4OxBfyP2nKkO7pOFX6adQwtcfQseH39GsH/dzALeVsKAjegt6Kk y9/QNj2OLdpeeCXz1FuDKzrOFecnPYzuaCw9Yb9gvPk6Vmi5N8Md/QUV3F5ZkkL5oxRP 4wHDT/0j8QvvrB/lcT0cj9BV8WGULb4iqzjM4dnhL56uixVqvIGD5RNE4DAMAZnIWITV wXB/GMY5uIxagyC5yZSNs3cYU7VmGcXIJv7+WdxQmkQPoF7LaNxs4fKYDwAZci+KlPFZ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689783581; x=1690388381; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:to:subject :message-id:date:from:in-reply-to:references:mime-version:from:to:cc :subject:date:message-id:reply-to; bh=lGEYw1AT4KNounpVoU7Da3a2f0HSojecfdmAbYEBXxs=; b=D/Qicdo9YhEdXMUTxm+yuhN4PXm6Vm3C7uGTAv+6rgI4r5JGnxzu/UE5crdWngr37U 01sVQwUtdGeW79I9GH19y6tIbCrdcL+XV8HqAuPRNlJaE2DHa5hreHFAnAnDkAQDbBmd 0ZTvTWwRA5+j1YWjph7pNHw8czgblLNa95M2fCJNukx7K76iB6saTnHsIVVhkpPiPI3E cBd1gs9M7MqiSyI9mpCOYq501pMn/H14dzNf/qknqwJiO6tnpvkEGL8KqQ7d88xjL7nk NUmt2ysC7qK73Cm4AjaAW3tVrlmrXGg6hK2ZPewlMeoflP/SrRAk1g5EYvSlkv+WdOi5 7zSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689783581; x=1690388381; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:to:subject :message-id:date:from:in-reply-to:references:mime-version :x-beenthere:x-gm-message-state:sender:from:to:cc:subject:date :message-id:reply-to; bh=lGEYw1AT4KNounpVoU7Da3a2f0HSojecfdmAbYEBXxs=; b=kP7JuLUt/6LSVAeDOjJ95jFZ96V6Nk0cZwRoiDgotxPeopS2fKiY4fSsLKceBHS5mi iI1ZIL24pObYABm3Vw+F8kntCwz4FtYFpva2baMa8HPyc49+PyDgZXMnPMHfzj4kp5pl /hw7qwRoY+3ZdfDl8ly5MNqmK5wasUcmM3V1/Dh7MF5YaZP0GYPRRirN0r9NJnfElGxU j73+PmN4QNYUMSSiI2dh1liVToJlBipvP5Z9yNgdC0mFVY4vvU4Sc9NRi4lJQq0vDXQb yAHXbQ Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: ABy/qLY9MVljN0ZFs3nlv6FykZChEq3+FMluq3M0xRxXAUAFE+sWDXtX Pr/0j9DfuDiJfhapA3XuHiE= X-Google-Smtp-Source: APBJJlH/WPKET1p4a9uEYtCOUTZ4SRBXvzagTWauVddR98XUC4yawpkKmwGyj6QFGWosYXCzKQTkag== X-Received: by 2002:a7b:cd16:0:b0:3fb:b34f:6cd6 with SMTP id f22-20020a7bcd16000000b003fbb34f6cd6mr4851257wmj.41.1689783581161; Wed, 19 Jul 2023 09:19:41 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:adf:e2d0:0:b0:312:831a:3c19 with SMTP id d16-20020adfe2d0000000b00312831a3c19ls38965wrj.2.-pod-prod-01-eu; Wed, 19 Jul 2023 09:19:35 -0700 (PDT) X-Received: by 2002:adf:e710:0:b0:314:4db:e0b2 with SMTP id c16-20020adfe710000000b0031404dbe0b2mr321117wrm.15.1689783575781; Wed, 19 Jul 2023 09:19:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689783575; cv=none; d=google.com; s=arc-20160816; b=Iu0IfGQ8agV9SdnRup6RR7lNWVwtm7EU8PGeKp+MiLZHJFiUuxaeQUFih90rRhfXDa H2SlHan41s16TI3ikp4hn+5H/16Jo7m4cTWAM4eK4oh6HX/mvufz8vRE0LEkDEAFlKHD GE123xH1RQCZPeGvWB5kLTtg/pqB1MXFS9vwvR3mapeOlILSFQSF59kzrSifFKekpSHT uWn3hSrznn+3i1lIr8KfHOlSy1T2GMFCHCEACAOD80J3WUOGvFI2xvZcES/St4QI9WBD HwGvpcsuG74lrOSdeReBmWLpSdt3sIOdnVzbhqo+5H/bXI0Xumr5pBmAOnN0KIknTk0W 7bFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Ir0Mdg3qiuPTJQ3YVZOKbdHVOltbkLTAkcAgtQE1SRM=; fh=Cqt4aIadhm6/qo0kgMpi25wkX1ZeQyw3MiiUKw6Rs8I=; b=pEMIRniOxLgU2Dr5yhjMwGzazbx1ht/DRnb91WW7DkSU3pKw40L6LswDBTBZWJK1rN FxZsh7pm94uU3iglRrcmcVZxj/Xv3USNfCO0zPDcupnYhf/svsbYAv4/zc3+Xr1sFHeC abfTvk/C9acKZREOGmjtA56KaqduALwU91lDmC5F9fS1FS0bw+f9nceISRHz1d+SXctN 0yxdtHuzpD9RiphUHHCw+7zrjBjFBNmM8+CWnGoVR2WcqlQ9fRF5alYjtO87VCenv/P0 iRhYKhta103sCxsZZrZP3gQv2UVZv6YOMJw3kK85qVZ+R1XEm8thO54QOaC6YdeIU+09 wxiA== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=d4OlW7Pr; spf=pass (google.com: domain of tridral-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::52a as permitted sender) smtp.mailfrom=tridral-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Original-Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com. [2a00:1450:4864:20::52a]) by gmr-mx.google.com with ESMTPS id ba14-20020a0560001c0e00b0031597ce1881si274375wrb.6.2023.07.19.09.19.35 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Jul 2023 09:19:35 -0700 (PDT) Received-SPF: pass (google.com: domain of tridral-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::52a as permitted sender) client-ip=2a00:1450:4864:20::52a; Original-Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-51e526e0fe4so10629210a12.3 for ; Wed, 19 Jul 2023 09:19:35 -0700 (PDT) X-Received: by 2002:a17:906:224b:b0:994:555a:e49f with SMTP id 11-20020a170906224b00b00994555ae49fmr3102939ejr.31.1689783574132; Wed, 19 Jul 2023 09:19:34 -0700 (PDT) In-Reply-To: X-Original-Sender: tridral-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=d4OlW7Pr; spf=pass (google.com: domain of tridral-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::52a as permitted sender) smtp.mailfrom=tridral-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE 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.io gmane.text.pandoc:32973 Archived-At: --000000000000aefc880600d9652b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Christophe, Thank you very much for your reply. I've not used lua filters before. It took me a while to realise how to make a command line with the input file and output file. I thought I'd write back and include tis for the benefit of any novices like me. I've now done this with your script, inserting the* '-i' *for the input file and using output redirection '*>' *for the output file pandoc --lua-filter note.lua -t markdown -i ** | sed -e 's/%%opening%%/\^\[/g' | sed -e 's/%%closing%%/\]/g' > ** This works on my small example file. Thank you once again. '=C3=B6-Dzin =E0=BD=A0=E0=BD=BC=E0=BD=91=E0=BC=8B=E0=BD=A0=E0=BD=9B=E0=BD=B2=E0=BD=93=E0= =BC=8B=E0=BD=91=E0=BE=B2=E0=BD=B2=E0=BC=8B=E0=BD=96=E0=BE=B2=E0=BD=A3 '=C3=B6-Dzin Tridral [image: https://]about.me/tridral =E2=98=B8 *Drala Jong Appeal - creating a Buddhist retreat centre in Wales: https://www.drala-jong.org/ *=E2=98=B8 =E2=98=B8 Achos pan ddaw y Pedwar Marchog i ofyn a roist ti o dy gyfan - fy= dd gen ti ddim esgus - Meinir Gwilym =E2=98=B8 On Wed, 19 Jul 2023 at 14:36, Christophe Demko wrote: > You can use a lua filter: > > $ pandoc --lua-filter note.lua -t markdown | sed -e 's/%%opening%%/\^\[/g= ' > | sed -e 's/%%closing%%/\]/g' > > with this note.lua file > > function Note(note) > note.content[1].content[1].text =3D "%%opening%%" .. > note.content[1].content[1].text > note.content[1].content[#note.content[1].content].text =3D > note.content[1].content[#note.content[1].content].text .. "%%closing%%" > return note.content[1].content > end > Le dimanche 16 juillet 2023 =C3=A0 17:35:38 UTC+2, tri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org a =C3= =A9crit : > >> Is it possible to use Pandoc to convert an md file that has reference >> footnotes to one that has inline footnotes - just by going from md -> md= , >> but failing that via another format. >> >> I have a file containing reference footnotes like this >> ---- >> Example[^1] line of text. >> >> [^1]: Example footnote >> ---- >> >> I would like to convert them all to inline footnotes like this >> >> ---- >> Example^[Example footnote] line of text. >> ---- >> >> Thank you for any help >> >> '=C3=B6-Dzin >> > -- > 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 view this discussion on the web visit > https://groups.google.com/d/msgid/pandoc-discuss/dabd9a50-de23-47d9-971e-= cfc8d1b92e0dn%40googlegroups.com > > . > --=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 view this discussion on the web visit https://groups.google.com/d/msgid/= pandoc-discuss/CAD3c%3DRBZ3r8sXRSebMD2hpX-mbLPubS7NF8nur%3Dsr-z%2Btf--aQ%40= mail.gmail.com. --000000000000aefc880600d9652b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Christophe,

Thank you very much for your reply.

I've not used lua filte= rs before.=C2=A0 It took me a while to realise how to make a command line w= ith the input file and output file.

I thought I'd write back and include tis for the benefi= t of any novices like me.

I've now done this with your script, inserting the '-i= ' for the input file and using output redirection '>'= =C2=A0 for the output file

=C2=A0=C2=A0 pandoc --lua-fil= ter note.lua -t markdown -i <input file> | sed -e 's/%%ope= ning%%/\^\[/g' | sed -e 's/%%closing%%/\]/g' > <output= file>

This= works on my small example file.

Thank you once again.

=
'=C3=B6-Dzin

<= tr style=3D"margin:0px;padding:0px;border:0px none;outline:currentcolor non= e 0px;font-weight:inherit;font-style:inherit;vertical-align:baseline">
=C2=A0
<= /td>
=E2=98=B8=C2=A0
D= rala Jong Appeal
- creating a Buddhist retreat centre in W= ales
:
https://www.drala-jong.org/
=E2=98=B8

=E2= =98=B8=C2=A0Achos pan ddaw y Pedwar Ma= rchog i ofyn a roist ti o dy gyfan - fydd gen ti ddim esgus - Meinir Gwilym= =C2=A0=E2=98=B8
<= /div>


On Wed, 19 Jul 2023 at 14:36, Christ= ophe Demko <chdemko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org&g= t; wrote:
Y= ou can use a lua filter:

$ pandoc --lua-filter not= e.lua -t markdown | sed -e 's/%%opening%%/\^\[/g' | sed -e 's/%= %closing%%/\]/g'

with this note.lua file
=

function Note(note)
=C2=A0 note.content[1].content[1= ].text =3D "%%opening%%" .. note.content[1].content[1].text
= =C2=A0 note.content[1].content[#note.content[1].content].text =3D note.cont= ent[1].content[#note.content[1].content].text .. "%%closing%%"=C2=A0 return note.content[1].content
end
Le dimanche 16 juillet 2023 = =C3=A0 17:35:38 UTC+2, tri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org a =C3=A9crit=C2=A0:
Is it possible to use Pandoc to convert an = md file that has reference footnotes to one that has inline footnotes - jus= t by going from md -> md, but failing that via another format.

I have a file containing reference footnotes like this
----
=C2=A0=C2=A0=C2=A0 Example[^1] line of text.
=C2=A0=C2=A0=C2=A0 [^1]: Example footnote
----

I would like to convert them all to inline footnotes like this

----
=C2=A0=C2=A0=C2=A0 Example^[Example fo= otnote] line of text.
----

Thank you= for any help

'=C3=B6-Dzin

--
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 pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https= ://groups.google.com/d/msgid/pandoc-discuss/dabd9a50-de23-47d9-971e-cfc8d1b= 92e0dn%40googlegroups.com.

--
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 view this discussion on the web visit https://g= roups.google.com/d/msgid/pandoc-discuss/CAD3c%3DRBZ3r8sXRSebMD2hpX-mbLPubS7= NF8nur%3Dsr-z%2Btf--aQ%40mail.gmail.com.
--000000000000aefc880600d9652b--