Determine current file being processed in lua filter (when input_files
> 1)
#10684
Unanswered
dude-at-RA
asked this question in
Q&A
Replies: 1 comment 3 replies
-
If your document can be parsed as commonmark or a variant (gfm, commonmark_x) then you could enable the |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
tl;dr, Is there a way to know which file in
input_files
a lua filter is currently operating on?I am attempting to use pandoc to build multiple markdown files into a revealjs presentation. The presentation has a visible doc info footer with copyright info and a document ID. Each markdown file has a document ID in the YAML frontmatter, e.g:
in Lua, I'm adding the doc.id to each slide as it's built, essentially:
I've written the necessary javscript to update the footer div when a new slide is revealed that has doc ID, and it works for a single document (when doc id is added to the revealjs html template). As expected, when passing in multiple files, the last file wins and instead of getting changing doc ids as I navigate through the slidedeck, it's whatever the last markdown file's ID was.
I'm not sure if there's a better way to use the revealjs html template to accomplish this; it looks like all of the converted html content (minus the title content) gets put in to the html document in the
$body$
placeholder - so I'm not sure how to pull each file's doc id there.If I could see which file is being processed, then I could side load that markdown file temporarily in the lua filter and get the metadata out of that file.
Beta Was this translation helpful? Give feedback.
All reactions