Closed mbojan closed 4 years ago
You can probably use a lua filter for that... I can't look into this at the moment. But if you ask on pandoc-discuss you'll most likely get helpful answers.
There is the bibexport filter, which collects the IDs as part of its operation. It shouldn't be too difficult to shorten it to just output the ID's.
If you don't mind using node (or want to port that logic to LUA), have a look at https://github.com/Zettlr/Citr — it includes a method precisely for extracting Pandoc-compatible citekeys
Thank you all for all the pointers. I saw some third-party tools but I was not trustful enough and thought of something closer to pandoc. I'll definitely have look at the lua filter. Thanks!
I'd love to see an option to
pandoc-citeproc
that will allow for extracting citation keys used in the Markdown document. It is not that straightforward to do so with regular expressions as one has make sure no false positive (e.g. use of@
within code blocks) will be picked up. On the other hand I imagine you already have the code that identifies only the relevant@citationkey
s.Apologies for not being more specific or constructive but I'm a Haskell-agnostic.
I will be obviously extremely grateful for suggestions if the goal above can be easily achieved using some existing tools/options.