Skip to content

cffr 1.0.0

Compare
Choose a tag to compare
@dieghernan dieghernan released this 12 Mar 12:38

This is a major release with some notable changes. The change mainly affects to non-core functions, hence the natural workflow (cff_create()cff_write()cff_validate()) shouldn't be affected.

Major changes

Classes and methods

Now cffr implements a new class system for definitions.reference, definitions.person and definitions.entity objects:

  • List of definitions.reference (e.g, references) has class cff_ref_lst, cff and individual elements (e.g preferred-citation or each
    member of references) has class cff_ref, cff.
  • List of definitions.person or definitions.entity (e.g. authors, contact) has class cff_pers_lst, cff and individual elements (e.g publisher or each member of authors) has class cff_pers, cff.

This change allow to write specific S3
Methods
and extend the capabilities of the
package.

  • New 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 string representing authors in BibTeX markup ("{von Neumen}, James"), that can't be captured properly via methods.
  • New as_bibentry() method for a variety of classes (character, list,
    NULL and classes defined by cffr).
  • New as_cff_person() method.
  • The following base and utils methods supports now 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().

API

The API has been completely reviewed to provide more clarity on functions naming and to facilitate internal maintenance. This change only affects to non-core functions. Now each function does less things but does it better. The old API has been deprecated and it would warn when used, providing advice on the replacement function.

Deprecation

  • 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.
  • Argument path in cff() is also deprecated, use cff_read() instead.

New capabilities

  • Now reading from external files is performed exclusively by 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().
  • New cff_modify() function for updating and modifying cff objects easily.

Other changes

  • Minimum R version required now is 4.0.0.
  • Update of BibTeX crosswalk (see vignette("bibtex_cff", package = "cffr")) and consequently changes in the mapping performed by as_bibtex()
    cff_parse_citation():
    • @inBook and @book gains a new value on [CFF]{.underline} when
      series is provided: [collection-type: book-series.]{.underline}
    • Can handle BibLaTeX @inBook, that differs significantly from BibTeX
      @inBook.

What's Changed

New Contributors

Full Changelog: v0.5.0...v1.0.0