Skip to content

Commit

Permalink
Properly handle files too
Browse files Browse the repository at this point in the history
  • Loading branch information
TheoWinterhalter committed Oct 28, 2024
1 parent f681593 commit 29503b0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pandoc/paper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,17 @@ function yamldata(data)
-- A bit ridiculous to do this to get strings
newdata.venue = pandoc.write(pandoc.Pandoc{data["venue"]}, 'html')
newdata.year = pandoc.write(pandoc.Pandoc{data["year"]}, 'html')
newdata.files = data["files"] or pandoc.List()
local files = data["files"] or pandoc.List()

newdata.files = files:map(function(data)
local newfile = {}

newfile.text = pandoc.write(pandoc.Pandoc{data.text}, 'html')
newfile.type = pandoc.write(pandoc.Pandoc{data.type}, 'html')
newfile.src = pandoc.write(pandoc.Pandoc{data.src}, 'html')

return newfile
end)

return newdata

Expand Down
7 changes: 7 additions & 0 deletions src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ title: Yet another yaml parser
authors: Templato Urnehm
venue: Proceedings of Nihilism
year: 2025
files:
- text: Paper
type: pdf
scr: foo.pdf
- text: Bibtex
type: bib
src: foo.bib
```
``` paper
Expand Down

0 comments on commit 29503b0

Please sign in to comment.