From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32970 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 06:36:09 -0700 (PDT) Message-ID: References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_11484_841470397.1689773769951" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37165"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDN5TJEC4AEBBS6N36SQMGQE56IRD7A-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Jul 19 15:36:16 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oa1-f58.google.com ([209.85.160.58]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1qM7Lj-0009PP-5w for gtp-pandoc-discuss@m.gmane-mx.org; Wed, 19 Jul 2023 15:36:15 +0200 Original-Received: by mail-oa1-f58.google.com with SMTP id 586e51a60fabf-1b4685de17asf10919309fac.0 for ; Wed, 19 Jul 2023 06:36:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20221208; t=1689773774; x=1690378574; 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=GfPinkUFV4bmKe1MPr0H388yKs3STLaxlDZE/SJV0b0=; b=E29vkfbnJwhE1Ueokaicg9JrcYEfCTPz+SxLNoX+cCthYQOH3/tSi9mvuyUz24f5QF Cf51FKlljICSeBGGxP0wY+R3puV2DF18VaT9WStYAGkl/d9blBpVBpu1QMNZL0c9Qy5G OIMogvcbMguc+/PnhB3qqDCxnoyKJ22pN78kVgkTKy0xWbPWCr4Yi6LQZvQ11K0mpJLe VK9UZMZOEN9e5E2ee43q0cjbKl4+J01+MnhtL5bvmo/iKAl4SQiuF7Gopoajtvrg9j8Y a0n7sTQ9UMbIEiEtcm0rn3UPzPuOJE8AtWXgd0xhfLvoij854S+bsJRvGLmD1l1Aufzh TKBw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689773774; x=1690378574; 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=GfPinkUFV4bmKe1MPr0H388yKs3STLaxlDZE/SJV0b0=; b=GPouZlclaQ3BiemAGlCfATY6Qv7PZrvVhXPmuiXOYsCXkWmRzWJeolupgUjCzPMUdw NHZoaATXa6ldtI6u8nLENlc9BKfMZSprqeKNqJJHiMaBzDSx9lIZdtWJs/uIDdqPkGpd uGxb+i9g+PKwF2WPW5vJJTiEyHm33k2/mJUS3gusA/kohLDOm7V/og0PKPrGpDIC/Rmc HttkQjdN0gAvadWdnli5BdXE/p6mvicPllCwGcaJajaAjS2OtlAe5Bn4Hv98r9nxvti+ kOuaEOwHxnvOLcPsOlL3AWdhSN+tPVE43xC8KdVP5l/wptsoI8umcrELb1nf40Ct5bsk Mjsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689773774; x=1690378574; 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=GfPinkUFV4bmKe1MPr0H388yKs3STLaxlDZE/SJV0b0=; b=DiOsTe6jGocRZ/famQkzg+ZqcuYSir/glNJHQ0qgeIaeNK2sce8BzymsfYwpWYbJDm ROXQrTAsSH1bxFY/3OtAMhC5GOehMxHl+PFJk9UDdubHPAts4Jy3QZ+J5q87HIh6NyFF R8PWZQIR/P4kpCr4oMEpGX+DbrNCodCrMle0GllNN+YRs49L+AbqHkHgAjsY85rbuhcC mGIv9XZw+xAmviLP56gC+nyYpqikj9QAouI9Q/PE6GlxJXYpxmm59+BYnYaAmT9OW9ws n6kqqFPu1F7FgUhpCYMaeK7+aGbx8oeoGXzFpGFUVmFiG9CyoK Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: ABy/qLYd0KtRtno/573bkwSWpQ5K/BsTjHyHpJDPsE/pZmVUEdEfzy9K DEuXnBYcPNuQ3oAftNUBoPA= X-Google-Smtp-Source: APBJJlEJL6TVJ8M6kCw6pQ4G1hGwJhNKzRjPLxazobf5ORb1ssoqVn9Q7jApY61KLV0Gtr3pDE9bNg== X-Received: by 2002:a05:6870:4412:b0:1b0:2686:5b31 with SMTP id u18-20020a056870441200b001b026865b31mr6487017oah.48.1689773773770; Wed, 19 Jul 2023 06:36:13 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6870:a109:b0:1ad:11bf:4f09 with SMTP id m9-20020a056870a10900b001ad11bf4f09ls4249798oae.2.-pod-prod-05-us; Wed, 19 Jul 2023 06:36:11 -0700 (PDT) X-Received: by 2002:a05:6870:35c5:b0:1b0:460c:548b with SMTP id c5-20020a05687035c500b001b0460c548bmr17288379oak.3.1689773770747; Wed, 19 Jul 2023 06:36:10 -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:32970 Archived-At: ------=_Part_11484_841470397.1689773769951 Content-Type: multipart/alternative; boundary="----=_Part_11485_738633606.1689773769951" ------=_Part_11485_738633606.1689773769951 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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/dabd9a50-de23-47d9-971e-cfc8d1b92e0dn%40googlegroups.com. ------=_Part_11485_738633606.1689773769951 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
You can use a lua filter:

$ pandoc --lua-fi= lter note.lua -t markdown | sed -e 's/%%opening%%/\^\[/g' | sed -e 's/%%clo= sing%%/\]/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 note.= content[1].content[#note.content[1].content].text =3D note.content[1].conte= nt[#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 -= just by going from md -> md, but failing that via another format.
=

I have a file containing reference footnotes like this<= /div>
----
=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^[Exampl= e footnote] 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 pand= oc-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-cfc8d1b92e0dn%40googlegroups.= com.
------=_Part_11485_738633606.1689773769951-- ------=_Part_11484_841470397.1689773769951--