mirror of
https://github.com/tildeclub/site.git
synced 2026-01-23 21:40:18 +00:00
Generate plain text versions of wiki articles, with links in footnotes
This commit is contained in:
18
wiki/link_footnote.lua
Normal file
18
wiki/link_footnote.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
links = {}
|
||||
|
||||
function Link (el)
|
||||
table.insert(links,
|
||||
pandoc.Para({
|
||||
pandoc.Str("[" .. (#links + 1) .. "]"),
|
||||
pandoc.Space(),
|
||||
pandoc.Str(el.target),
|
||||
})
|
||||
)
|
||||
table.insert(el.content, pandoc.Str("[" .. #links .. "]"))
|
||||
return el.content
|
||||
end
|
||||
|
||||
function Pandoc (doc)
|
||||
table.insert(doc.blocks, pandoc.Div(links))
|
||||
return pandoc.Pandoc(doc.blocks, doc.meta)
|
||||
end
|
||||
Reference in New Issue
Block a user