public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Christophe Demko <chdemko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: Converting reference footnotes to inline footnotes (md -> md if poss.)
Date: Wed, 19 Jul 2023 08:57:40 -0700 (PDT)	[thread overview]
Message-ID: <b680c4f7-0c33-4a3c-9607-1d0fad225ab8n@googlegroups.com> (raw)
In-Reply-To: <dabd9a50-de23-47d9-971e-cfc8d1b92e0dn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>


[-- Attachment #1.1: Type: text/plain, Size: 2022 bytes --]

If you want to adress only footnotes with one paragraph:

function Note(note)
  if #note.content == 1 then
    note.content[1].content[1].text = "%%opening%%" .. 
note.content[1].content[1].text
    note.content[1].content[#note.content[1].content].text = 
note.content[1].content[#note.content[1].content].text .. "%%closing%%"
    return note.content[1].content
  end
  return note
end

Le mercredi 19 juillet 2023 à 15:36:10 UTC+2, Christophe Demko a écrit :

> 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 = "%%opening%%" .. 
> note.content[1].content[1].text
>   note.content[1].content[#note.content[1].content].text = 
> note.content[1].content[#note.content[1].content].text .. "%%closing%%"
>   return note.content[1].content
> end
> Le dimanche 16 juillet 2023 à 17:35:38 UTC+2, tri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org a écrit :
>
>> 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
>>
>> 'ö-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/b680c4f7-0c33-4a3c-9607-1d0fad225ab8n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 3058 bytes --]

  parent reply	other threads:[~2023-07-19 15:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-16 15:35 tri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
     [not found] ` <fa3d8615-1ad8-4034-adb3-5e7daeaa8dden-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-07-19 13:36   ` Christophe Demko
     [not found]     ` <dabd9a50-de23-47d9-971e-cfc8d1b92e0dn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-07-19 15:57       ` Christophe Demko [this message]
2023-07-19 16:19       ` 'o-Dzin Tridral
     [not found]         ` <CAD3c=RBZ3r8sXRSebMD2hpX-mbLPubS7NF8nur=sr-z+tf--aQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2023-07-19 16:43           ` 'o-Dzin Tridral
     [not found]             ` <CAD3c=RDmb_AG=OeuZomhhokhHD0KWOwgZkjm--imw3akac6RhQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2023-07-19 17:59               ` Christophe Demko
     [not found]                 ` <fdfa600a-c418-467e-a01b-2f8af160eba9n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-07-19 18:43                   ` Christophe Demko
     [not found]                     ` <7d7d33f9-dc97-4b3e-b3f0-efcaac2bd324n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-07-19 21:32                       ` 'o-Dzin Tridral

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b680c4f7-0c33-4a3c-9607-1d0fad225ab8n@googlegroups.com \
    --to=chdemko-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).