cff_validate(): migrated to the ajv validation engine
via jsonvalidate::json_validate(). Error messages are now
more informative.definitions.person and
definitions.entity, the website field uses ROR
as a fallback.doi: DOIs in inst/CITATION
url fields are detected, including those matching the
pattern .*dx.doi.org/.cff_read() correctly handles a single
languages value (#105).cff_gha_update() action now runs in
ubuntu-latest by default to save GitHub
Actions quota (#90, thanks to @Pakillo).as_cff_person() function family.r_citation in cff_write().
When it is set to TRUE, an R citation file
(inst/CITATION) is generated or updated with the
information from the generated CITATION.cff file.
No backup copy is created, for more control use
cff_write_citation() (#79).repository-code now also recognizes Codeberg as a valid repository
(#88).repository-code recognizes repositories regardless of
casing. It is still advised to use lowercase as a good practice for
R developers.CITATION file providing a DOI, the
CITATION DOI is used as the main CITATION.cff
doi and the CRAN DOI is added as an
identifier.doi.cff_create(dependencies = TRUE)) and the package
dependency is on CRAN, the CRAN DOI is
used for the dependency in the references key.commit from RemoteSha.cran_to_spdx dataset.cff_write() to add a new encoding
argument to make it work with different encodings, see
iconv().This is a major release with some notable changes. The main change
affects non-core functions, hence the natural workflow
(cff_create() → cff_write() →
cff_validate()) shouldn’t be affected.
Now cffr implements a new class system for definitions.reference,
definitions.person
and definitions.entity
objects:
definitions.reference objects
(e.g. references) has class cff_ref_lst, cff,
and individual elements (e.g. preferred-citation or each
member of references) have class
cff_ref, cff.definitions.person or
definitions.entity objects (e.g. authors,
contact) has class cff_pers_lst, cff, and
individual elements (e.g. publisher or each member of
authors) have class cff_pers, cff.This change allows writing specific S3 Methods and extends the capabilities of the package.
as_cff() S3 generic method (replacing
as.cff()): This method coerces R objects
to cff class format. Current methods provided are:
as_cff.Bibtex().as_cff.bibentry(), replacing
cff_parse_citation().as_cff.person(), similar to
as_cff_person() but only for person objects.
We recommend using as_cff_person() since it can coerce also
strings representing authors in BibTeX markup
("{von Neumen}, James"), which cannot be captured properly
via methods.as_bibentry() method for a variety of classes
(character, list, NULL and
classes defined by cffr).as_cff_person() method.cff class:
as.data.frame.cff().as.person(), although only for
definitions.person or definitions.entity
(e.g. authors, contacts, editors,
publisher, etc.).head.cff(), tail.cff().toBibtex.cff().The API has been completely reviewed to provide more clarity on function naming and to facilitate internal maintenance. This change only affects non-core functions. Now each function does fewer things but does them better. The old API has been deprecated and it warns when used, providing advice on the replacement function.
cff_to_bibtex() and
cff_extract_to_bibtex(): replaced by
as_bibentry() S3 generic.cff_parse_person() and
cff_parse_person_bibtex(): replaced by
as_cff_person() S3 generic.cff_parse_citation(): replaced by as_cff()
S3 generic.cff_from_bibtex(): replaced by
cff_read_bib() (for *.bib files) and
cff_read_bib_text() (for character strings).write_bib() and write_citation() :
replaced by cff_write_bib() and
cff_write_citation() respectively.path in cff() is also deprecated,
use cff_read() instead.cff_read() (that is designed to fit all supported file
types on a single entry point) and the new specific readers (that are
used under the hood by cff_read()), namely:
cff_read_cff_citation(),cff_read_description(),cff_read_citation()cff_read_bib().cff_modify() function for updating and modifying
cff objects easily.vignette("bibtex_cff", package = "cffr")) and consequently
changes in the mapping performed by as_bibtex()
cff_parse_citation():
cff_to_bibtex() and
cff_extract_to_bibtex() have been merged, the latter
(cff_extract_to_bibtex()) is now soft-deprecated.write_citation() that can generate a
inst/CITATION file from a cff object (#51).Additional authors of a R package can be now
included based on the role on the DESCRIPTION file, via the
argument authors_roles (#49).
New message interface based on cli capabilities.
Now the (invisible) result of cff_validate()
includes the summary of errors (if any) as an attributes()
named "error", as
jsonvalidate::json_validate() does when
verbose = TRUE:
Be verbose? If
TRUE, then an attribute"errors"will list validation failures as a data.frame
Improvements in the extraction of
`date-release`.
cff_validate().cff_from_bibtex().preferred-citation is only produced when a
CITATION R file has been provided with the
package (#37).cff_read() function. This functionality was already
implemented on cff() but new function added in order to
provide clarity.master or
main branch.references field, using citation(auto = TRUE).
dependencies argument on cff_create()
and cff_write().cff_parse_citation():
cff_parse_citation() extracts more information of
authors, based on the fields provided on the DESCRIPTION
file.cff_parse_citation() does a better job extracting
information from bibentry() /BibTeX and mapping it to
preferred-citation/references fields of CFF.cff_git_hook_install()cff_git_hook_remove()cff_extract_to_bibtex()cff_to_bibtex()cff_parse_person_bibtex()write_bib()lifecycle.pages on cff_parse_citation()
.gh_keywords argument on cff_create()
/cff_write(). If TRUE, it includes GitHub repo
topics as keywords.keys argument.cran_to_spdx.citation().preferred-citation key from
DESCRIPTION.cff_schema_definitions_reference() to
cff_schema_definitions_refs().repository key is supported.vignette("crosswalk", package = "cffr").cff_gha_update().