cff_reader | R Documentation |
Citation File Format (cff) reader
cff_reader(x)
x |
(character) a file path or a yaml string |
CFF only supports one citation, so many
will always be
FALSE
.
Required fields:
CFF v1.1.0: cff-version
, version
, message
, date-released
,
title
, authors
.
CFF v1.2.0: cff-version
, message
, title
, authors
.
We'll stop with error if any of these are missing.
You can though have many references in your CFF file
associated with the citation. references
is an optional component in
cff files. If included, we check the following:
each reference must have the 3 required fields: type, authors, title
type must be in the allowed set, see cff_reference_types
the elements within authors must each be an entity or person object https://github.com/citation-file-format/citation-file-format#entity-objects https://github.com/citation-file-format/citation-file-format#person-objects
title must be a string
an object of class handl
; see handl for more
CFF format: https://github.com/citation-file-format/citation-file-format
Other readers:
bibtex_reader()
,
citeproc_reader()
,
codemeta_reader()
,
ris_reader()
Other cff:
cff_writer()
(z <- system.file("extdata/citation.cff", package = "handlr")) res <- cff_reader(x = z) res res$cff_version res$software_version res$message res$id res$doi res$title res$author res$references # no references (z <- system.file("extdata/citation-norefs.cff", package = "handlr")) out <- cff_reader(x = z) out out$references
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.