diff options
author | Albert Krewinkel <albert@zeitkraut.de> | 2021-12-17 17:32:28 +0100 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2021-12-17 14:45:27 -0800 |
commit | 7a70b87facffe5f2daaaa58af9fadad89b81a9e9 (patch) | |
tree | 1ab71d75db228b178c5f9553105eae7b3c89b396 /doc | |
parent | 61ffa55835bf8ee0d86431e52d9a5d9482bd7bb3 (diff) | |
download | pandoc-7a70b87facffe5f2daaaa58af9fadad89b81a9e9.tar.gz |
Lua: add function `pandoc.utils.references`
List with all cited references of a document.
Closes: #7752
Diffstat (limited to 'doc')
-rw-r--r-- | doc/lua-filters.md | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/doc/lua-filters.md b/doc/lua-filters.md index 7b73dd9c5..93595a814 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -3301,6 +3301,38 @@ Usage: } local newblocks = pandoc.utils.make_sections(true, 1, blocks) +### references {#pandoc.references} + +`references (doc)` + +Get references defined inline in the metadata and via an external +bibliography. Only references that are actually cited in the +document (either with a genuine citation or with `nocite`) are +returned. URL variables are converted to links. + +The structure used represent reference values corresponds to that +used in CSL JSON; the return value can be use as `references` +metadata, which is one of the values used by pandoc and citeproc +when generating bibliographies. + +Parameters: + +`doc`: +: document ([Pandoc](#type-pandoc)) + +Returns: + +- list of references. (table) + +Usage: + + -- Include all cited references in document + function Pandoc (doc) + doc.meta.references = pandoc.utils.references(doc) + doc.meta.bibliography = nil + return doc + end + ### run\_json\_filter {#pandoc.utils.run_json_filter} `run_json_filter (doc, filter[, args])` |