From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32977 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 22:32:17 +0100 Message-ID: References: <7d7d33f9-dc97-4b3e-b3f0-efcaac2bd324n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000d711520600ddc49b" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18040"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBD4N5VPWTMERB4NM4GSQMGQEB7WM4KI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Jul 19 23:32:39 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-lj1-f183.google.com ([209.85.208.183]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1qMEmk-0004Rb-N7 for gtp-pandoc-discuss@m.gmane-mx.org; Wed, 19 Jul 2023 23:32:38 +0200 Original-Received: by mail-lj1-f183.google.com with SMTP id 38308e7fff4ca-2b701c82e83sf603251fa.1 for ; Wed, 19 Jul 2023 14:32:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1689802358; cv=pass; d=google.com; s=arc-20160816; b=Yn5qQqL3EC6hIjvV3WIWNyNRos32dY7YEbNdQVdLXjDjcVHkmRNOQZh1HBlGhZNGn0 au8jAm7Ew27ZQ6H7ZFzTsYBvhDOGwFEyiuJRPPVz42+t/gpmsfL56VWk9slO2+hV8/c+ nNnqUPSYJDclNflp9K544unPFs52e97dwbAFWhOJnmf6fTIYGc9ASP8eo7kTEfw5qrEg gjnbezjVtObd2WJmv7idP/Gp/QOow5grgS24imTZ+2ONy1qPyizq7y0BF5DL1ELAQn1d KpnocBMGfJ26ex9xli5uR4ZsBNqh0c/w8qk0Gc11vylHXSOsz6vI0pMCj0H8HQNx/07S Gnsw== 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=6ZVFyIbKYrkaB3Uc9oncYYTd8YjWLxwKjZD/rNujT88=; fh=Cqt4aIadhm6/qo0kgMpi25wkX1ZeQyw3MiiUKw6Rs8I=; b=G9L0d+PDrNAyRb8JUw36a2Vs4Uv1fBkV6iH6IbN+hozAJfvTH+DKyOJh9D6cdnyGY/ fbhsGCFylxV8yyzvQUHbn/hdxY9ZXzr48Ka/HD2sm9qlV/z0dzyjwlPWhZ3DV7nieoCs KkRjUUDi6lTQ12kX7h3NPe4isydggGn8mx9lex3OkfaIZhkKVSWZD6kUchjC3s8ueltN KcYDF0vaEm7YTDbHuOhE0+9KnFKi9XmBp9gUIskT0XSTBxaTh4GvsTEC3UpEUSCf4W2k kEowXImOLbeiiGubEVNgcrN7yXm/u15l9+3bvItgGg3XmpmDQ7zTyP9SpgfHJH0drfxz Zd1w== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=qqEP5GzR; spf=pass (google.com: domain of tridral-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::235 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=1689802358; x=1690407158; 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=6ZVFyIbKYrkaB3Uc9oncYYTd8YjWLxwKjZD/rNujT88=; b=Ph/V+m51AnAnI6L4ysnEvf1SZ0g7sdTl1wyN3qIiGfOKExy/TduOZdmCI9nSWb3Dc8 U2Rqjh1S896o3NwOXW1227qqOUYTI2nVzqAUUGeUtFyn98tgliDYknFdR0x1GrCpekZ+ WydhrT67RIfUZyZ34nTD+r9sEOfS5+FQioGUyWMzw/klGDTA+Tg0bB2W7QqqUjBs3+cp u/eFYF2tZJ+LNO1hyg/3WD2REac4C7sMEUsxtCoypyk0tMpP4iy4uEfN153MXA+NHTbX rmQFfiwsamHxDSONFhLaFD2aaqI0f5gs8+vJvWE5MtGXs0dbW8wp4eU42siMW2ck+ROt DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689802358; x=1690407158; 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=6ZVFyIbKYrkaB3Uc9oncYYTd8YjWLxwKjZD/rNujT88=; b=jDfRyAF5Y0/8e1sOSNiGaO5afyTKlslf4mzMytguqdPdw3iEg9lXWoModrW/vzcctt ilAeMXCL5Gle1q3qIhBy5qvTMzGX1wEXvW0DxN/v6sHBnKeSsZwgmDee5pT6pwQwj5G2 XcxJTbPYQ6ghp+KLZQMGMVwflEBZnyveB2GmuSOGqWvjccyToP0xtObN7NBB0M6eZwGM YIJD1DWexkklE6pN0rcjN7TZoNaJlhxteZE5M4EOUj3/L6H+/JRtM3hKSTD8dKsAvQUH iXrYJjEHNsJ1ke/wPJaMiC7bII3oTrfwgNYMMBe8PZWJGVgRxtRjTe83Un1D5nhVv8DV tThA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689802358; x=1690407158; 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=6ZVFyIbKYrkaB3Uc9oncYYTd8YjWLxwKjZD/rNujT88=; b=XsoAdd4c+/vQpdC7k1l+7tM2XMFzKPgm/nVPzdJNLQJKYCI4PWnOL5+9aWt4qhUELn jEGPBpEnut5D58H/wTVcSveb3diBZ/qHsGczHjnGvzFEkFm5vMwz35dL4bXQBkWNylw0 XGgBaATMUXiqTbwnHdTXQrVtQmBP926DelU/1AroeiIjqebnaweGjMN/6jQRWP37k+Wl j3xpiHO8rKNB8ue3SzXbmfulIHnLJMJlkSbcUR1EbiYzLv7t4QJOlteCb3V+pbSPU9cr fpIO8V Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: ABy/qLaJ+DFXLSNLaeNhxSPKScsvAoR9mDJhkagxwcePAPA3cRwiwhq7 gngO+7WFj0BngyBjcnIjnp0= X-Google-Smtp-Source: APBJJlGJrmuQvDx63Pph2ou00fG3A4xh0NyFWfrbVIZP/NkrdoYn6KwOU7THJzOG18WCcJ2QNDjCqA== X-Received: by 2002:a2e:320e:0:b0:2b9:3db7:322a with SMTP id y14-20020a2e320e000000b002b93db7322amr768157ljy.29.1689802357688; Wed, 19 Jul 2023 14:32:37 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a2e:bc1f:0:b0:2b8:417f:3f09 with SMTP id b31-20020a2ebc1f000000b002b8417f3f09ls55188ljf.1.-pod-prod-09-eu; Wed, 19 Jul 2023 14:32:32 -0700 (PDT) X-Received: by 2002:a2e:95d4:0:b0:2b7:33b9:8809 with SMTP id y20-20020a2e95d4000000b002b733b98809mr762071ljh.16.1689802352065; Wed, 19 Jul 2023 14:32:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689802352; cv=none; d=google.com; s=arc-20160816; b=wmyq2+9pcMmntM7y0KCn54tcEUm1DAqRFT48RNVDWqaHfQVUBJTCCv3CKeqZ8j5A5G sKPoC/Mlhhy1UO5rzvbsUbPm5m1E17wmUKCxx4ltdgQ4/9DO7HADWSNKkRaugQdGOp5X ZNGU32MidlWX9m251HwjVJyRLJM1Rt0rdxdHoXIsVxLBM+VTeD7JbTzftPpUlTVIVEF4 uCUXe1j0ukrN5TV9v0Uz/+VfOu8B2jWiCZovKEIU9LrNi1LTYBNi8ViRKmGadCxw0fIk WaKJMM2X0OCXYpVlm+ZkrhXgP2GffRU2MDqqVOw7anGG5Hil70LkALPf0G4km86cNvP7 4h0w== 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=5NjHO0546ckuDwKzXX9d03FRISGCMtm60Nc0qqoNUdc=; fh=Cqt4aIadhm6/qo0kgMpi25wkX1ZeQyw3MiiUKw6Rs8I=; b=OWRfQY6eu1YazbQl4WxJIBakE/bs1Y12zwWhRz5NGY6NcTgfT7OqeQLuspmMMI+D+l 1zw6zKLPF55tDsgi+dtF9XOFVXCU6qV5Tx/J3CAwDpbmQCVMVLTyKbMh2pjaBvgxb2K/ 1CaaNLKMQeSSzCEjsRbVnvI+eqT0l+o2tdAfc9C97Q0eFTgZOi4Vb1U0eI86lHU9Ya9y OuNsGCQ3z0c+uTxPQCsBiY1qvCZmp8OiYDXtE4ThQc2wh+9qVkCi+sqlHgTn6ifl7ZsF 2egnxzcDU288jKZDs2DKYX/o570H5Ycw05pr60bVLXU98YVA4E9IZBNJzwtCeley5mpE HXqA== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=qqEP5GzR; spf=pass (google.com: domain of tridral-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::235 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-lj1-x235.google.com (mail-lj1-x235.google.com. [2a00:1450:4864:20::235]) by gmr-mx.google.com with ESMTPS id q124-20020a2e5c82000000b002b83c645687si537941ljb.1.2023.07.19.14.32.32 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Jul 2023 14:32:32 -0700 (PDT) Received-SPF: pass (google.com: domain of tridral-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::235 as permitted sender) client-ip=2a00:1450:4864:20::235; Original-Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2b7430bda8bso1361711fa.0 for ; Wed, 19 Jul 2023 14:32:32 -0700 (PDT) X-Received: by 2002:a05:651c:d7:b0:2b4:6eb0:2a27 with SMTP id 23-20020a05651c00d700b002b46eb02a27mr873157ljr.17.1689802350463; Wed, 19 Jul 2023 14:32:30 -0700 (PDT) In-Reply-To: <7d7d33f9-dc97-4b3e-b3f0-efcaac2bd324n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 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=qqEP5GzR; spf=pass (google.com: domain of tridral-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::235 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:32977 Archived-At: --000000000000d711520600ddc49b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Christoph, Thank you very much. I'm working on a book and I cut it down to the smallest file that would reproduce the error. I've tried this with you new code and it works...! So the next thing was to try your new code with the entire book - and I get a different error message Error running filter lua_filter_note_complex.lua: Inline, list of Inlines, or string expected, got List I can try the process of chopping the file down to see if I can get the same error with a smaller file. If you're happy to continue looking at this I'll let you know how it goes. I'm going to be away until Monday. If you have any advice I'll pick it up then. Thank you 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 19:43, Christophe Demko wrote: > May be you have some complex content in your footnotes. > Try this note.lua file: > > function Note(note) > if #note.content =3D=3D 1 then > table.insert(note.content[1].content, 1, pandoc.Str "%%opening%%") > table.insert(note.content[1].content, pandoc.Str "%%closing%%") > return note.content[1].content > end > return note > end > > Le mercredi 19 juillet 2023 =C3=A0 19:59:23 UTC+2, Christophe Demko a =C3= =A9crit : > >> Can you post the files which cause an issue ? >> >> Le mercredi 19 juillet 2023 =C3=A0 18:44:09 UTC+2, 'o-Dzin Tridral a =C3= =A9crit : >> >>> Hi Christophe, >>> >>> I'm sorry to follow up again, but I get an error with my large md file >>> >>> The filter fails with the error >>> >>> attempt to concatenate a nil value (field 'text') >>> >>> The error doesn't mention where the failure happens or what text is >>> causing the problem. If you have any advice re how to get more informa= tion >>> from pandoc or lua I would very much appreciate it. >>> >>> I entirely understand if you don't have time to look at this of course. >>> >>> best regards, >>> >>> '=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 = - fydd >>> gen ti ddim esgus - Meinir Gwilym =E2=98=B8 >>> >>> >>> On Wed, 19 Jul 2023 at 17:19, 'o-Dzin Tridral wrote: >>> >>>> Hi Christophe, >>>> >>>> Thank you very much for your reply. >>>> >>>> I've not used lua filters before. It took me a while to realise how t= o >>>> 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 novice= s >>>> 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= - fydd >>>> 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 referenc= e >>>>>> 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, sen= d >>>>> an email to pandoc-discus...-/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-9= 71e-cfc8d1b92e0dn%40googlegroups.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 view this discussion on the web visit > https://groups.google.com/d/msgid/pandoc-discuss/7d7d33f9-dc97-4b3e-b3f0-= efcaac2bd324n%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%3DRATZXBr4t64RtbUXtCnFLOMfEWENC7zGn-ozL51wNUWSw%40mail= .gmail.com. --000000000000d711520600ddc49b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Christoph,

Thank you very much.

I'm working on a book and I cut it down= to the smallest file that would reproduce the error.

I've tried this with you new code and= it works...!

So the= next thing was to try your new code with the entire book - and I get a dif= ferent error message

Error runnin= g filter lua_filter_note_complex.lua:
Inline, list of Inlines, or string expected, got= List

I can try the process of chopping the file down to see if I can get t= he same error with a smaller file. If you're happy to continue looking = at this I'll let you know how it goes.

I'm going to be= away until Monday. If you have any advice I'll pick it up then.=

Thank = you again,

'=C3=B6-Dzin

=C2=A0
<= table style=3D"margin:0px;padding:0px;border:0px none;outline:currentcolor = none 0px;font-weight:inherit;font-style:inherit;vertical-align:baseline" ce= llspacing=3D"0" cellpadding=3D"0" border=3D"0">

=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<= br>
'=C3=B6-Dzin Tridral
3D"https://"ab= out.me/tridral
=E2=98=B8=C2=A0
Dr= ala Jong Appeal
- creating a Buddhist retreat centre in Wa= les
:
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 19:43, Christ= ophe Demko <chdemko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org&g= t; wrote:
M= ay be you have some complex content in your footnotes.
Try this n= ote.lua file:

function Note(note)
=C2=A0 if #no= te.content =3D=3D 1 then
=C2=A0 =C2=A0 table.insert(note.content[1].cont= ent, 1, pandoc.Str "%%opening%%")
=C2=A0 =C2=A0 table.insert(n= ote.content[1].content, pandoc.Str "%%closing%%")
=C2=A0 =C2= =A0 return note.content[1].content
=C2=A0 end
=C2=A0 return note
e= nd

Le mercredi 19 juillet 2023 =C3=A0 19:59:23 UTC+2, Christophe Demko = a =C3=A9crit=C2=A0:
Can you post the files which cause an issue ?

Le mercredi 19 juillet 2023= =C3=A0 18:44:09 UTC+2, 'o-Dzin Tridral a =C3=A9crit=C2=A0:
Hi Christophe,

I'm sorry to follow up again, but I get an error= with my large md file

The filter fails with the error

=C2= =A0 attempt to concatenate a nil value (field 'text')
<= br>
The error doesn't mention where the failure happ= ens or what text is causing the problem.=C2=A0 If you have any advice re ho= w to get more information from pandoc or lua I would very much appreciate i= t.

I entirely understand = if you don't have time to look at this of course.

best regards,

= 9;=C3=B6-Dzin

=E2=98=B8=C2=A0
Drala Jong Appeal - creating a Buddhist retreat centre in Wales:
<= /i> 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 17:19, 'o= -Dzin Tridral <tri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Hi Christophe,

Thank you very much for your reply.

I've not used = lua filters before.=C2=A0 It took me a while to realise how to make a comma= nd line with the input file and output file.

I thought I'd write back and inclu= de 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 out= put redirection '>'=C2=A0 for the output file

=C2=A0=C2=A0 pandoc --lua-filter note.lua -t markdown -i = <input file> | sed -e 's/%%opening%%/\^\[/g' | sed -e = 9;s/%%closing%%/\]/g' > <output file>
=

This works on my small = example file.

Thank you once again.

<= font size=3D"4" face=3D"georgia, serif" color=3D"#274e13">'=C3=B6-Dzin<= /font>

=C2=A0

= =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
3D"https://"about.me/tridral
=
=C2=A0
<= /font>
=E2=98=B8=C2=A0
=
Drala Jong Appeal
- creating a Buddhist retreat cent= re in Wales
:
https://www.drala-jong.org/
=E2=98=B8

<= /span>
=E2=98=B8=C2=A0Achos pa= n ddaw y Pedwar Marchog i ofyn a roist ti o dy gyfan - fydd gen ti d= dim esgus - Meinir Gwilym=C2=A0=E2=98=B8
=


<= div class=3D"gmail_quote">
On Wed, 19 = Jul 2023 at 14:36, Christophe Demko <chd...-Re5JQEeQqe8@public.gmane.org= m> wrote:
You can use a lua filter:

$ pandoc --lua-fil= ter note.lua -t markdown | sed -e 's/%%opening%%/\^\[/g' | sed -e &= #39;s/%%closing%%/\]/g'

with this note.lua fil= e

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

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

=C2=A0=C2=A0=C2=A0 [^1]: E= xample footnote
----

I would like to con= vert them all to inline footnotes like this

----
=C2=A0=C2=A0=C2=A0 Example^[Example footnote] line of text.
<= div>----

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-discus...-/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.

--
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/7d7d33f9-dc97-4b3e-b3f0-efcaac2= bd324n%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://group= s.google.com/d/msgid/pandoc-discuss/CAD3c%3DRATZXBr4t64RtbUXtCnFLOMfEWENC7z= Gn-ozL51wNUWSw%40mail.gmail.com.
--000000000000d711520600ddc49b--