Can you post the files which cause an issue ?

Le mercredi 19 juillet 2023 à 18:44:09 UTC+2, 'o-Dzin Tridral a écrit :
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 information 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,

'ö-Dzin

 
☸ 
Drala Jong Appeal
- creating a Buddhist retreat centre in Wales
:
https://www.drala-jong.org/


☸ Achos pan ddaw y Pedwar Marchog i ofyn a roist ti o dy gyfan - fydd gen ti ddim esgus - Meinir Gwilym ☸


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.  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 <input file> | sed -e 's/%%opening%%/\^\[/g' | sed -e 's/%%closing%%/\]/g' > <output file>

This works on my small example file.

Thank you once again.

'ö-Dzin

 
☸ 
Drala Jong Appeal
- creating a Buddhist retreat centre in Wales
:
https://www.drala-jong.org/


☸ Achos pan ddaw y Pedwar Marchog i ofyn a roist ti o dy gyfan - fydd gen ti ddim esgus - Meinir Gwilym ☸


On Wed, 19 Jul 2023 at 14:36, Christophe Demko <chd...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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 = "%%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-discus...@googlegroups.com.
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 "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/fdfa600a-c418-467e-a01b-2f8af160eba9n%40googlegroups.com.