as_bibentry() now returns a bibentry object when x is NULL, using metadata from the package in the current working directory.as_cff.bibentry() now selects the first issn of each bibentry().as_cff.bibentry() now preserves single keywords and generic institutions, removes empty keyword values, restores collection-type: book-series for @book and @inbook series, preserves legal commas in URLs, removes duplicate URLs and extracts DOI resolver URLs only when their paths are valid DOI values. Partial BibLaTeX publication dates retain their available year and month, while unsupported date values remain available for CFF validation. Resolver query and fragment components are excluded from DOI values, while original URL metadata is retained.[.cff_ref_lst() and [.cff_pers_lst() now preserve their collection classes for subsets of any length.cff_create() no longer creates duplicate identifiers when merging inferred CRAN metadata with CITATION metadata.cff_create() now adds inferred CRAN DOIs only to packages available from CRAN. Dependency references retain extracted titles, abstracts, authors and citation years while adding their declared scope and version constraint, plus URLs and repository information from installed package metadata. A release date takes precedence over a citation year when available (#114).cff_create() now preserves every recognized alternative license from DESCRIPTION instead of limiting the CFF output to two SPDX identifiers.cff_create() now trims X-schema.org-keywords values, removes empty and duplicate values and preserves a single value as a one-item CFF keyword array.cff_read_cff_citation() now preserves YAML sequences with one element, including keywords, while retaining invalid scalar values for CFF validation.cff_read_citation() now makes every field supplied in meta, including custom DESCRIPTION fields, available to CITATION files and no longer retries with metadata from the base package when reading fails (#114).cff_read_description() now preserves characters in legacy non-UTF-8 DESCRIPTION files with R 4.7, including metadata used to read citations.cff_gha_update() now uses path when updating .Rbuildignore.cff_read_bib_text() now rejects vectors that mix BibTeX entries with .bib file paths.cff_write_bib() and cff_write_citation() now stop before modifying an existing file when its backup cannot be created, and backup numbering is no longer limited to 100 files.cff_write() now formats the inst/CITATION update message correctly.inst/CITATION url fields are detected, including those matching the pattern .*dx.doi.org/.website field in definitions.person and definitions.entity uses ROR as a fallback.cff_read() correctly handles a single languages value (#105).cff_validate() now uses the ajv validation engine through jsonvalidate::json_validate(), which returns more informative error messages.as_cff_person() improves comment detection and parsing across its function family.cff_gha_update() now runs in ubuntu-latest by default to save GitHub Actions quota (#90, thanks to @Pakillo).cff_write() gains a new r_citation argument. 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. Lowercase is still recommended 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 is extracted from RemoteSha.cran_to_spdx dataset was updated.cff_write() gains 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. The natural workflow (cff_create() → cff_write() →
cff_validate()) should not be affected.
cffr now implements a new class system for
definitions.reference,
definitions.person
and
definitions.entity
objects:
definitions.reference objects, such as references, has class cff_ref_lst, cff. Individual elements, such as preferred-citation or each member of references, have class cff_ref, cff.definitions.person or definitions.entity objects, such as authors or contact, has class cff_pers_lst, cff. Individual elements, such as publisher or each member of authors, have class cff_pers, cff.This change enables specific S3 methods and extends the capabilities of the package.
as_cff() is a new S3 generic that replaces as.cff() and 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 also coerce strings representing authors in BibTeX markup ("{von Neumen}, James"), which cannot be captured properly through methods.as_bibentry() is a new method for a variety of classes (character, list, NULL and classes defined by cffr).as_cff_person() is a new method.cff class:
as.data.frame.cff().as.person(), although only for definitions.person or definitions.entity, such as authors, contacts, editors or publisher.head.cff(), tail.cff().toBibtex.cff().The API has been completely revised to clarify function naming and simplify internal maintenance. This change only affects non-core functions. Each function now does fewer things but does them better. The old API has been deprecated and now warns when used, providing advice on the replacement function.
cff_to_bibtex() and cff_extract_to_bibtex(): replaced by the as_bibentry() S3 generic.cff_parse_person() and cff_parse_person_bibtex(): replaced by the as_cff_person() S3 generic.cff_parse_citation(): replaced by the 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() now reads only from external files. It is designed to fit all supported file types in a single entry point, along with more specific readers used internally by cff_read():
cff_read_cff_citation().cff_read_description().cff_read_citation().cff_read_bib().cff_modify() is a new function for updating and modifying cff objects easily.vignette("bibtex-cff", package = "cffr")), with corresponding changes in the mapping performed by toBibtex() and cff_parse_citation():
collection-type: book-series.cff_to_bibtex() and cff_extract_to_bibtex() have been merged. cff_extract_to_bibtex() is now soft-deprecated.write_citation() is a new function that can generate an inst/CITATION file from a cff object (#51).Additional authors of an R package can now be included based on roles in the DESCRIPTION file, through the authors_roles argument (#49).
The message interface now uses cli.
The invisible result of cff_validate() now includes the summary of errors (if any) as an attribute 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.
Improved extraction of date-released.
cff_validate() performance was improved.cff_from_bibtex().preferred-citation is only produced when inst/CITATION has been provided with the package (#37).cff_read(). This functionality was already implemented in cff(), but the new function provides clarity.schema.json for validation (#33).master or main branch.references key, using citation(auto = TRUE).
dependencies argument to cff_create() and cff_write().cff_parse_citation() include:
cff_parse_citation() extracts more information about authors, based on the fields provided in the DESCRIPTION file.cff_parse_citation() does a better job extracting information from bibentry()/BibTeX and mapping it to the preferred-citation and references CFF keys.cff_git_hook_install().cff_git_hook_remove().cff_extract_to_bibtex().cff_to_bibtex().cff_parse_person_bibtex().write_bib().pages to cff_parse_citation().gh_keywords argument to cff_create()/cff_write(). If TRUE, it includes GitHub repository topics as keywords.keys argument.cran_to_spdx dataset.citation().preferred-citation key is automatically generated from DESCRIPTION.cff_schema_definitions_reference() to cff_schema_definitions_refs().repository key is supported.vignette("r-cff", package = "cffr") vignette.cff_gha_update().