Skip to content

Instantly share code, notes, and snippets.

@the-solipsist
Created October 7, 2023 08:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save the-solipsist/3a01a3712108b07099b2506b086dd780 to your computer and use it in GitHub Desktop.
Save the-solipsist/3a01a3712108b07099b2506b086dd780 to your computer and use it in GitHub Desktop.
Convert Pandoc reference footnotes to inline footnotes
-- copied from https://groups.google.com/g/pandoc-discuss/c/_5-8TRJhhqo/m/xkbSBz2wAgAJ
-- pandoc --lua notes_inline.lua temp.md | sed -e 's/%%opening%%/ /g' | sed -e 's/%%closing%%//g'
function Note(note)
if #note.content == 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment