cff_parse_citation {cffr}R Documentation

Parse a bibentry to cff

Description

Parse a bibentry object to a valid format for a CITATION.cff file.

Usage

cff_parse_citation(bib)

Arguments

bib

A bibentry object, either created with bibentry() (preferred) or citEntry().

Details

This is a helper function designed to help on adding or replacing the auto-generated authors of the package. See Examples.

This function tries to adapt a bibentry object (generated with bibentry() or citEntry()) to the CFF standard.

Entry types considered

Note that Conference is not implemented in bibentry(), however is equivalent to InProceedings (Patashnik (1988)).

Fields considered

annote and crossref fields are ignored.

Value

A cff object ready to be used on cff_create().

References

See Also

cff_create(), vignette("cffr", "cffr"), bibentry()

Other parsers: cff_parse_person()

Examples


bib <- citation("base")
bib


# To cff
bib_to_cff <- cff_parse_citation(bib)
bib_to_cff

# Create the object
new_cff <- cff()

full <- cff_create(new_cff, keys = list("preferred-citation" = bib_to_cff))

full
# Validate
cff_validate(full)

# Several citations

cff_parse_citation(citation("rmarkdown"))


[Package cffr version 0.2.0 Index]