A test was failing on my PC. I think it is due to the test design: I tried to make it more robust, not requiring a specific BibTex entry type, but just that the information is present.
Related Issue
Closes #24
Example
library(handlr)
# Minimal cff with v1.2.0 required keys only
file <- system.file("extdata/citation_1.2.0.cff", package = "handlr")
new <- cff_reader(file)
cat(cff_writer(new))
#> cff-version: 1.2.0
#> message: If you use this software, please cite it as below.
#> title: My Research Software
#> authors:
#> - family-names: Druskat
#> given-names: Stephan
#> orcid: https://orcid.org/0000-0003-4925-7248
#> doi: 10.5281/zenodo.1234
#> keywords:
#> - McAuthor's algorithm
#> - linguistics
#> - nlp
#> - parser
#> references:
#> - type: book
#> authors:
#> - family-names: Doe
#> given-names: Jane
#> - name: Foo Bar Working Group
#> website: https://foo-bar.com
#> title: The science of citation
#> - type: software
#> authors:
#> - family-names: Doe
#> given-names: John
#> title: Software Citation Tool
cat(bibtex_writer(new), sep = "\n")
#> @misc{10.5281/zenodo.1234,
#> doi = {10.5281/zenodo.1234},
#> author = {Stephan Druskat},
#> title = {My Research Software},
#> pages = {},
#> }
# When switched to cff_v1 it would still fail
zy <- yaml::yaml.load_file(file)
zy$`cff-version` <- "1.1.0"
tf <- tempfile(fileext = ".yml")
yaml::write_yaml(zy, tf)
cff_reader(tf)
#> Error: 'date-released' is required
This PR adds support for the latest version of CFF (v1.2.0). It is also compatible with v1.1.0.
Description
cff-version
oncff_writer()
is now v1.2.0.Related Issue
Closes #24
Example
Created on 2021-09-20 by the reprex package (v2.0.1)