From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32972 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Christophe Demko Newsgroups: gmane.text.pandoc Subject: Re: Converting reference footnotes to inline footnotes (md -> md if poss.) Date: Wed, 19 Jul 2023 08:57:40 -0700 (PDT) Message-ID: References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_12780_512625808.1689782260247" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11349"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDN5TJEC4AEBB5MP4CSQMGQEOYBL3YA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Jul 19 17:57:48 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oa1-f56.google.com ([209.85.160.56]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1qM9Yf-0002a0-IC for gtp-pandoc-discuss@m.gmane-mx.org; Wed, 19 Jul 2023 17:57:45 +0200 Original-Received: by mail-oa1-f56.google.com with SMTP id 586e51a60fabf-187959a901esf11616489fac.0 for ; Wed, 19 Jul 2023 08:57:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20221208; t=1689782264; x=1690387064; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :sender:from:to:cc:subject:date:message-id:reply-to; bh=HvquTgaGoVy3xDFOiXVRT6rwC1caHxPFwEQEdhmamB8=; b=mh5gxkGxqsJXDGFDi9S7+y4GW10k6tyHBcf9rNsT7PgZ9XojOQDlgcE062gBO2m1zO tmb1v9ddW10LVSRBo/OjymVJkdcr2TxFz4znj4GO2FcdQ4dXLVHP/zDBUkR4VSGJNh/w HIXva1UpPPVLx9ixTqeM16o2UYVdc7h7KWByg/K4NwGanO58C3X0cEmBgacy9FMVGfhj I9tJQm4EtBMFk+NaKn0tQxhsLkluyitKQtL8mDNyxwh/QjC9Sne/ZuXA+gAzUAbYEG3v 8YP17IAUJ1HCVj1H45PkREyxpysJwjfzFyt2VfFAH8q/N2uBa24vzkP8SV7OP6x+0riq DyuA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689782264; x=1690387064; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=HvquTgaGoVy3xDFOiXVRT6rwC1caHxPFwEQEdhmamB8=; b=GUYd4FhRPINcaTYluah/8hf3RTY2837eVvcv3wzieYH5I3pooNLrg6B/rqRkPkOVtW D93nu6OG2Alg6cprLjgxw4ssLCu48QxSqGeCy+6/wIPYKqKGV8Ird4CJxUMoQppS+jyo jL1X9mdrna4Q4yWEDfw2VkvQuuz6O+U9ks5Fl1syRbxwcd+mj1rCG2h/LbmjlaF9bBeK UmN0a/ogS2JVDQsfcOVP0AHy2+1K585CP/hhlZqlG6Jccxevsza8x/MQnyfYXmhe6MpB 01YtxTCyV+ziHmdR1a2zse0D/toYV3LzzgTM3DQ8KYqInDjOWI2RRVz/zexd0TgP2Yc6 9S+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689782264; x=1690387064; 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-sender:mime-version:subject:references:in-reply-to :message-id:to:from:date:x-beenthere:x-gm-message-state:sender:from :to:cc:subject:date:message-id:reply-to; bh=HvquTgaGoVy3xDFOiXVRT6rwC1caHxPFwEQEdhmamB8=; b=JE2XcHPpHzq1Ks5LSkhgxpVpR1QPUrTCZpsHVuUhsGTScVamp9wFRd8JtQn57ywdW1 H7XLt32HoSA9MjlHdHu1GLkUFBp6aZmvQ9tjUMXv+XnOzkT8gWj8QFryka3E/VXSJass P3XxwtF6wOGaURqnJY1GD3SQ6it7CYb2EYBvvXwsRfOgo7ZX2uIgpRhs82txAHHORCxz EGQWkMI/XOJPoOCe9gitsdR4MT8FYrxv1UhyACw7wSvoUZ9RV0hue7vVgXZQm3SAnaff f6ozmXYhp5k/JhM8uMH2tMckVCQfNUH1eL0Ikb2G7wYgCP7Og2 Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: ABy/qLa3TZokYaU1RVu+mLMAWJ1Ra20BbkV+ovUwEJ9M3dmmR95kq68H /FQ3sQQ9y9yObCUjxRIAvto= X-Google-Smtp-Source: APBJJlHxD1M3e6J44FR0KA7ZaRCmPRNZZ8cqPCH5OmWAiI3bKym3R/Dbkxk1tDiHSvYdnWkN/gk2bg== X-Received: by 2002:a05:6871:b28:b0:1b3:e896:9bfc with SMTP id fq40-20020a0568710b2800b001b3e8969bfcmr3109293oab.4.1689782264377; Wed, 19 Jul 2023 08:57:44 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6870:9a20:b0:1ba:cb89:5d05 with SMTP id fo32-20020a0568709a2000b001bacb895d05ls1722513oab.2.-pod-prod-00-us; Wed, 19 Jul 2023 08:57:41 -0700 (PDT) X-Received: by 2002:a05:6871:4684:b0:1b3:ecdb:ff21 with SMTP id ni4-20020a056871468400b001b3ecdbff21mr3689774oab.3.1689782260822; Wed, 19 Jul 2023 08:57:40 -0700 (PDT) In-Reply-To: X-Original-Sender: chdemko-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.io gmane.text.pandoc:32972 Archived-At: ------=_Part_12780_512625808.1689782260247 Content-Type: multipart/alternative; boundary="----=_Part_12781_914072142.1689782260247" ------=_Part_12781_914072142.1689782260247 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable If you want to adress only footnotes with one paragraph: function Note(note) if #note.content =3D=3D 1 then note.content[1].content[1].text =3D "%%opening%%" ..=20 note.content[1].content[1].text note.content[1].content[#note.content[1].content].text =3D=20 note.content[1].content[#note.content[1].content].text .. "%%closing%%" return note.content[1].content end return note end Le mercredi 19 juillet 2023 =C3=A0 15:36:10 UTC+2, Christophe Demko a =C3= =A9crit : > You can use a lua filter: > > $ pandoc --lua-filter note.lua -t markdown | sed -e 's/%%opening%%/\^\[/g= '=20 > | sed -e 's/%%closing%%/\]/g' > > with this note.lua file > > function Note(note) > note.content[1].content[1].text =3D "%%opening%%" ..=20 > note.content[1].content[1].text > note.content[1].content[#note.content[1].content].text =3D=20 > 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=20 >> footnotes to one that has inline footnotes - just by going from md -> md= ,=20 >> 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 >> > --=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/b680c4f7-0c33-4a3c-9607-1d0fad225ab8n%40googlegroups.com. ------=_Part_12781_914072142.1689782260247 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
If you want to adress only footnotes with one paragraph:
function Note(note)
=C2=A0 if #note.content =3D=3D 1 the= n
=C2=A0 =C2=A0 note.content[1].content[1].text =3D "%%opening%%" .. n= ote.content[1].content[1].text
=C2=A0 =C2=A0 note.content[1].content[#= note.content[1].content].text =3D note.content[1].content[#note.content[1].= content].text .. "%%closing%%"
=C2=A0 =C2=A0 return note.content[1].co= ntent
=C2=A0 end
=C2=A0 return note
end

Le mercredi = 19 juillet 2023 =C3=A0 15:36:10 UTC+2, Christophe Demko a =C3=A9crit=C2=A0:=
You can= use a lua filter:

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

with this note.lua file
<= br>
function Note(note)
=C2=A0 note.content[1].content[1].text= =3D "%%opening%%" .. note.content[1].content[1].text
=C2=A0 n= ote.content[1].content[#note.content[1].content].text =3D note.content[1].c= ontent[#note.content[1].content].text .. "%%closing%%"
=C2=A0 = return note.content[1].content
end
<= div dir=3D"auto" class=3D"gmail_attr">Le dimanche 16 juillet 2023 =C3=A0 17= :35:38 UTC+2, tri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org a =C3=A9crit=C2=A0:



--
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://groups.google.com/d= /msgid/pandoc-discuss/b680c4f7-0c33-4a3c-9607-1d0fad225ab8n%40googlegroups.= com.
------=_Part_12781_914072142.1689782260247-- ------=_Part_12780_512625808.1689782260247--