Skip to content
Discussion options

You must be logged in to vote

Fortunately, I got the answer here. In addition to your suggestions, my script was lacking the right function at the beginning.. ;) As it is function(args, kwargs, meta), the data is in args, not in meta...
The working lua script looks like this now:

local str = pandoc.utils.stringify

return {
  ['orcid'] = function(args, kwargs, meta)
    local author_id = str(args[1])
    local authors = meta.authors or meta['by-author']

    if authors then
      for _, author in ipairs(authors) do
        if author.id == author_id then
          if author.orcid then
            local orcid_value = str(author.orcid)
            local orcid_link = "<a href=\"https://orcid.org/" .. orcid_value .. "\">or…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@mcanouil
Comment options

@produnis
Comment options

Answer selected by produnis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lua Issues related to the lua codebase, filter chain, etc
3 participants