diff --git a/NEWS.md b/NEWS.md index a5af4acf..b8045cb4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -15,7 +15,7 @@ old API [has been deprecated](https://lifecycle.r-lib.org/articles/stages.html#deprecated) and it would warn when used, providing advice on the replacement function. -#### Deprecations +#### Deprecation - `cff_to_bibtex()` and `cff_extract_to_bibtex()`: replaced by `as_bibentry()`. @@ -23,7 +23,7 @@ would warn when used, providing advice on the replacement function. `cff_read_bib_text()` (for character strings). - `write_bib()` and `write_citation()` : replaced by `cff_write_bib()` and `cff_write_citation()` respectively. -- `cff_parse_person()` and `cff_parse_person_bibtex()`: replacedy by +- `cff_parse_person()` and `cff_parse_person_bibtex()`: replaced by `as_cff_person()`. - The conversion from `cff` to `bibentry` is performed now by a new function `as_bibentry()`. Previous names of this function were `cff_to_bibtex()` and @@ -56,7 +56,7 @@ would warn when used, providing advice on the replacement function. - `head.cff()`, `tail.cff()`. - `toBibtex.cff()`. - Update of BibTeX crosswalk (see `vignette("bibtex_cff", package = "cffr")`) - and consecuently changes in the mapping performed by `as_bibtex()` + 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} diff --git a/R/cff_create.R b/R/cff_create.R index c30c59a0..785ae763 100644 --- a/R/cff_create.R +++ b/R/cff_create.R @@ -43,8 +43,8 @@ #' #' #' ``` -#' -#' `vignette("cffr", "cffr")` +#' See also [cff_write()] for creating a CFF file. `vignette("cffr", "cffr")` +#' shows an introduction on how manipulate `cff` objects. #' #' @details #' diff --git a/R/cff_parse_citation.R b/R/cff_parse_citation.R index 1a8671a0..620f5326 100644 --- a/R/cff_parse_citation.R +++ b/R/cff_parse_citation.R @@ -6,7 +6,7 @@ #' #' @export #' -#' @family parsers +#' @family coercing #' #' @param bib A `bibentry` object, either created with [bibentry()] #' (preferred) or [citEntry()]. diff --git a/R/cff_write.R b/R/cff_write.R index f1ff3b75..386f2a0c 100644 --- a/R/cff_write.R +++ b/R/cff_write.R @@ -10,8 +10,7 @@ #' [`cff`][cff-class] object and writes it out to a YAML-formatted file in #' one command. #' -#' @family core -#' @family write +#' @family writing #' #' @param x The source that would be used for generating #' the `CITATION.cff` file. It could be: @@ -50,6 +49,9 @@ #' #' #' ``` +#' This function unifies the workflow [cff_create()] + [cff_write()] + +#' [cff_validate()]. +#' #' @examples #' \donttest{ #' tmpfile <- tempfile(fileext = ".cff") diff --git a/R/cff_write_misc.R b/R/cff_write_misc.R index f59620ae..13187d58 100644 --- a/R/cff_write_misc.R +++ b/R/cff_write_misc.R @@ -23,7 +23,7 @@ #' @export #' @rdname cff_write_misc #' @family bibtex -#' @family write +#' @family writing #' #' @return #' Writes the corresponding file specified on the `file` parameter. diff --git a/R/data.R b/R/data.R index 3fbf9ac6..34096b41 100644 --- a/R/data.R +++ b/R/data.R @@ -4,6 +4,8 @@ #' on CRAN packages and its (approximate) match on the #' [SPDX License List](https://spdx.org/licenses/). #' +#' @family datasets +#' #' @format A data frame with `r nrow(cran_to_spdx)` rows and 2 variables: #' #' * `r names(cran_to_spdx)[1]`: A valid `License` string on CRAN. diff --git a/R/docs.R b/R/docs.R index 1a77ece0..547745fb 100644 --- a/R/docs.R +++ b/R/docs.R @@ -4,8 +4,14 @@ #' @aliases cff_class #' @keywords internal #' +#' @family s3method +#' #' @description #' #' ```{r child = "man/chunks/cffclass.Rmd"} #' ``` +#' +#' @seealso +#' +#' `vignette("cffr", "cffr")` for a hands-on example. NULL diff --git a/README.md b/README.md index 348f5085..255fe1ff 100644 --- a/README.md +++ b/README.md @@ -561,6 +561,26 @@ test <- cff_create("rmarkdown") - family-names: Chirico. given-names: Michael year: '2024' + - type: software + title: dygraphs + abstract: 'dygraphs: Interface to ''Dygraphs'' Interactive Time Series Charting + Library' + notes: Suggests + url: https://github.com/rstudio/dygraphs + repository: https://CRAN.R-project.org/package=dygraphs + authors: + - family-names: Vanderkam + given-names: Dan + website: http://dygraphs.com/ + - family-names: Allaire + given-names: JJ + - family-names: Owen + given-names: Jonathan + - family-names: Gromer + given-names: Daniel + - family-names: Thieurmel + given-names: Benoit + year: '2024' - type: software title: fs abstract: 'fs: Cross-Platform File System Operations Based on ''libuv''' @@ -577,6 +597,26 @@ test <- cff_create("rmarkdown") given-names: Gábor email: csardi.gabor@gmail.com year: '2024' + - type: software + title: rsconnect + abstract: 'rsconnect: Deploy Docs, Apps, and APIs to ''Posit Connect'', ''shinyapps.io'', + and ''RPubs''' + notes: Suggests + url: https://rstudio.github.io/rsconnect/ + repository: https://CRAN.R-project.org/package=rsconnect + authors: + - family-names: Atkins + given-names: Aron + email: aron@posit.co + - family-names: Allen + given-names: Toph + - family-names: Wickham + given-names: Hadley + - family-names: McPherson + given-names: Jonathan + - family-names: Allaire + given-names: JJ + year: '2024' - type: software title: downlit abstract: 'downlit: Syntax Highlighting and Automatic Linking' @@ -589,6 +629,19 @@ test <- cff_create("rmarkdown") email: hadley@posit.co year: '2024' version: '>= 0.4.0' + - type: software + title: katex + abstract: 'katex: Rendering Math to HTML, ''MathML'', or R-Documentation Format' + notes: Suggests + url: https://docs.ropensci.org/katex/ + repository: https://CRAN.R-project.org/package=katex + authors: + - family-names: Ooms + given-names: Jeroen + email: jeroen@berkeley.edu + orcid: https://orcid.org/0000-0002-4035-0289 + year: '2024' + version: '>= 1.4.0' - type: software title: sass abstract: 'sass: Syntactically Awesome Style Sheets (''Sass'')' @@ -699,6 +752,18 @@ test <- cff_create("rmarkdown") given-names: Davis email: davis@posit.co year: '2024' + - type: software + title: cleanrmd + abstract: 'cleanrmd: Clean Class-Less ''R Markdown'' HTML Documents' + notes: Suggests + url: https://pkg.garrickadenbuie.com/cleanrmd/ + repository: https://CRAN.R-project.org/package=cleanrmd + authors: + - family-names: Aden-Buie + given-names: Garrick + email: garrick@adenbuie.com + orcid: https://orcid.org/0000-0002-7111-0077 + year: '2024' - type: software title: withr abstract: 'withr: Run Code ''With'' Temporarily Modified Global State' diff --git a/codemeta.json b/codemeta.json index fc6f3580..1df75929 100644 --- a/codemeta.json +++ b/codemeta.json @@ -14,7 +14,7 @@ "name": "R", "url": "https://r-project.org" }, - "runtimePlatform": "R version 4.3.2 (2023-10-31)", + "runtimePlatform": "R version 4.3.2 (2023-10-31 ucrt)", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -200,7 +200,7 @@ }, "isPartOf": "https://ropensci.org", "keywords": ["attribution", "citation", "credit", "citation-files", "cff", "metadata", "r", "r-package", "citation-file-format", "rstats", "ropensci", "cran"], - "fileSize": "929.883KB", + "fileSize": "947.576KB", "citation": [ { "@type": "ScholarlyArticle", diff --git a/data/cran_to_spdx.rda b/data/cran_to_spdx.rda index 33fae299..0bd1435c 100644 Binary files a/data/cran_to_spdx.rda and b/data/cran_to_spdx.rda differ diff --git a/man/as_bibentry.Rd b/man/as_bibentry.Rd index 53317ed5..0c9e7019 100644 --- a/man/as_bibentry.Rd +++ b/man/as_bibentry.Rd @@ -126,10 +126,12 @@ Other functions for working with BibTeX format: \code{\link{encoded_utf_to_latex}()} Other functions for converting between \strong{R} classes: -\code{\link{as_cff_person}()} +\code{\link{as_cff_person}()}, +\code{\link{cff_parse_citation}()} Other S3 Methods for \code{cff}: -\code{\link{as_cff_person}()} +\code{\link{as_cff_person}()}, +\code{\link{cff-class}} } \concept{bibtex} \concept{coercing} diff --git a/man/as_cff_person.Rd b/man/as_cff_person.Rd index 9da93bc8..a4d8e05a 100644 --- a/man/as_cff_person.Rd +++ b/man/as_cff_person.Rd @@ -139,10 +139,12 @@ Examples in \code{vignette("cffr", "cffr")} and \code{\link[utils:person]{utils: \code{\link[utils:person]{utils::person()}} Other functions for converting between \strong{R} classes: -\code{\link{as_bibentry}()} +\code{\link{as_bibentry}()}, +\code{\link{cff_parse_citation}()} Other S3 Methods for \code{cff}: -\code{\link{as_bibentry}()} +\code{\link{as_bibentry}()}, +\code{\link{cff-class}} } \concept{coercing} \concept{s3method} diff --git a/man/cff-class.Rd b/man/cff-class.Rd index 87a02b5b..1d886499 100644 --- a/man/cff-class.Rd +++ b/man/cff-class.Rd @@ -178,4 +178,12 @@ as.person(the_cff$authors) }\if{html}{\out{}} } } +\seealso{ +\code{vignette("cffr", "cffr")} for a hands-on example. + +Other S3 Methods for \code{cff}: +\code{\link{as_bibentry}()}, +\code{\link{as_cff_person}()} +} +\concept{s3method} \keyword{internal} diff --git a/man/cff.Rd b/man/cff.Rd index cdce2784..b835c587 100644 --- a/man/cff.Rd +++ b/man/cff.Rd @@ -106,7 +106,6 @@ cffobj \seealso{ Other core functions of \CRANpkg{cffr}: \code{\link{cff_create}()}, -\code{\link{cff_validate}()}, -\code{\link{cff_write}()} +\code{\link{cff_validate}()} } \concept{core} diff --git a/man/cff_create.Rd b/man/cff_create.Rd index 44ac7d40..ea829a90 100644 --- a/man/cff_create.Rd +++ b/man/cff_create.Rd @@ -107,12 +107,11 @@ cff_create(demo_file, keys = list("contact" = new_contact)) } \seealso{ \href{https://github.com/citation-file-format/citation-file-format/blob/main/schema-guide.md}{Guide to Citation File Format schema version 1.2.0}. - -\code{vignette("cffr", "cffr")} +See also \code{\link[=cff_write]{cff_write()}} for creating a CFF file. \code{vignette("cffr", "cffr")} +shows an introduction on how manipulate \code{cff} objects. Other core functions of \CRANpkg{cffr}: \code{\link{cff}()}, -\code{\link{cff_validate}()}, -\code{\link{cff_write}()} +\code{\link{cff_validate}()} } \concept{core} diff --git a/man/cff_parse_citation.Rd b/man/cff_parse_citation.Rd index a9b1891a..ae8a90a9 100644 --- a/man/cff_parse_citation.Rd +++ b/man/cff_parse_citation.Rd @@ -80,5 +80,9 @@ cff_parse_citation(citation("rmarkdown")) } \seealso{ \code{\link[=cff_create]{cff_create()}}, \code{vignette("bibtex_cff", "cffr")}, \code{\link[=bibentry]{bibentry()}} + +Other functions for converting between \strong{R} classes: +\code{\link{as_bibentry}()}, +\code{\link{as_cff_person}()} } -\concept{parsers} +\concept{coercing} diff --git a/man/cff_validate.Rd b/man/cff_validate.Rd index 174928a2..d3ed8aa0 100644 --- a/man/cff_validate.Rd +++ b/man/cff_validate.Rd @@ -52,7 +52,6 @@ try(cff_validate(system.file("CITATION", package = "cffr"))) Other core functions of \CRANpkg{cffr}: \code{\link{cff}()}, -\code{\link{cff_create}()}, -\code{\link{cff_write}()} +\code{\link{cff_create}()} } \concept{core} diff --git a/man/cff_write.Rd b/man/cff_write.Rd index 2ad4167f..bf4a6daf 100644 --- a/man/cff_write.Rd +++ b/man/cff_write.Rd @@ -79,14 +79,10 @@ file.remove(tmpfile) } \seealso{ \href{https://github.com/citation-file-format/citation-file-format/blob/main/schema-guide.md}{Guide to Citation File Format schema version 1.2.0}. - -Other core functions of \CRANpkg{cffr}: -\code{\link{cff}()}, -\code{\link{cff_create}()}, -\code{\link{cff_validate}()} +This function unifies the workflow \code{\link[=cff_create]{cff_create()}} + \code{\link[=cff_write]{cff_write()}} + +\code{\link[=cff_validate]{cff_validate()}}. Other functions for creating external files: \code{\link{cff_write_bib}()} } -\concept{core} -\concept{write} +\concept{writing} diff --git a/man/cff_write_misc.Rd b/man/cff_write_misc.Rd index 06cc23ed..37030074 100644 --- a/man/cff_write_misc.Rd +++ b/man/cff_write_misc.Rd @@ -122,4 +122,4 @@ Other functions for creating external files: \code{\link{cff_write}()} } \concept{bibtex} -\concept{write} +\concept{writing} diff --git a/man/cran_to_spdx.Rd b/man/cran_to_spdx.Rd index 5ad515ee..9ad8e40f 100644 --- a/man/cran_to_spdx.Rd +++ b/man/cran_to_spdx.Rd @@ -31,4 +31,5 @@ head(cran_to_spdx, 20) \seealso{ \emph{Writing R Extensions}, \href{https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Licensing}{Licensing section}. } +\concept{datasets} \keyword{datasets} diff --git a/man/roxygen/meta.R b/man/roxygen/meta.R index 32178d85..54a0daf6 100644 --- a/man/roxygen/meta.R +++ b/man/roxygen/meta.R @@ -3,7 +3,7 @@ list( core = "Other core functions of \\CRANpkg{cffr}:", reading = "Other functions for reading external files:", coercing = "Other functions for converting between \\strong{R} classes:", - write = "Other functions for creating external files:", + writing = "Other functions for creating external files:", bibtex = "Other functions for working with BibTeX format:", schemas = "Other CFF schemas:", git = "Other Git/GitHub helpers:", diff --git a/pkgdown/_pkgdown.yml b/pkgdown/_pkgdown.yml index 60e9eab7..dca1dbd3 100644 --- a/pkgdown/_pkgdown.yml +++ b/pkgdown/_pkgdown.yml @@ -1,50 +1,64 @@ url: 'https://docs.ropensci.org/cffr' + template: opengraph: twitter: creator: '@dhernangomez' card: summary_large_image + repo: branch: main development: mode: auto -# reference: -# - title: Main function -# desc: >- -# The main function of the package and likely to be the only one you would -# need. -# contents: -# - cff_write -# - title: Other core functions -# desc: 'Create, write and manipulate files and objects.' -# contents: -# - has_concept("Core functions") -# - title: Citation File Format schema -# desc: >- -# These functions provides lists of valid keys and fields as defined by the -# CFF schema.json **(v1.2.0)**. -# contents: -# - has_concept("Schemas") -# - title: Parsers -# desc: Helper functions to parse information. -# contents: -# - has_concept("Parsers") -# - title: BibTeX -# desc: Convert CFF to BibTeX and viceversa -# contents: -# - has_concept("BibTeX helpers") -# - cff_parse_citation -# - title: Datasets -# contents: -# - has_keyword("datasets") -# - title: Continuous Integration -# contents: -# - has_concept("Git helpers") -# - title: About the package -# contents: -# - cffr-package +home: + title: cffr | Generate Citation File Format (CFF) files for R packages + description: >- + Utilities to generate and validate CFF files with R. + +reference: + - title: The whole game + - subtitle: The function + desc: >- + The main function of the package and likely to be the only one you would + need. + contents: cff_write + - subtitle: Other core functions + desc: 'Create, modify and write and `cff` objects.' + contents: has_concept("core") + - subtitle: The `cff` class + desc: Brief introduction to the `cff` class and S3 Methods available. + contents: + - cff-class + - has_concept("s3method") + - subtitle: Citation File Format schema + desc: >- + These functions provides lists of valid keys and fields as defined by the + CFF schema.json **(v1.2.0)**. + contents: has_concept("schemas") + - title: Continuous Integration + contents: has_concept("git") + - title: Additional features + - subtitle: Read and write files + desc: >- + Read and write local files on different formats (CFF files, BibTeX, + etc.). + contents: + - has_concept("reading") + - has_concept("writing") + - subtitle: Coercing objects + desc: >- + Coerce **R** objects into different classes (`cff`, `person`, `bibentry`) + and more: + contents: has_concept("coercing") + - subtitle: BibTeX helpers + desc: Functions that works with BibTeX markup language. + contents: has_concept("bibtex") + - title: Datasets + contents: has_concept("datasets") + - title: About the package + contents: cffr-package navbar: structure: @@ -69,12 +83,14 @@ navbar: href: 'https://ropensci.org/blog/2021/11/23/how-i-test-cffr/' - text: '---' - text: Blogs - - text: 'How To Call Package Citations in R programming' - href: 'https://medium.com/analytics-vidhya/how-to-call-package-citations-in-r-programming-6f01f1176301' + - text: How To Call Package Citations in R programming + href: >- + https://medium.com/analytics-vidhya/how-to-call-package-citations-in-r-programming-6f01f1176301 - text: '---' - text: Podcasts - text: 'R Weekly Highlights: Issue 2021-W48 Highlights' href: 'https://share.fireside.fm/episode/87RSVeFz+4R-j8_xW' + authors: Diego Hernangómez: href: 'https://dieghernan.github.io/' diff --git a/vignettes/bibtex_cff.Rmd b/vignettes/bibtex_cff.Rmd index a4e27540..247e6ed7 100644 --- a/vignettes/bibtex_cff.Rmd +++ b/vignettes/bibtex_cff.Rmd @@ -4,9 +4,8 @@ subtitle: A potential crosswalk bibliography: REFERENCES.bib author: Diego Hernangómez description: >- - This article presents a crosswalk between BibTeX and Citation File Format - [@druskat_citation_2021], as it is performed by the **cffr** package - [@hernangomez2021]. + This article presents a crosswalk between BibTeX and Citation File Format, as + it is performed by the cffr package. abstract: >- This article introduces a crosswalk between **BibTeX** and the Citation File Format (CFF) [@druskat_citation_2021], as implemented by the **cffr** package diff --git a/vignettes/crosswalk.Rmd b/vignettes/crosswalk.Rmd index de1cf9bf..cf0bdbd8 100644 --- a/vignettes/crosswalk.Rmd +++ b/vignettes/crosswalk.Rmd @@ -1,8 +1,9 @@ --- title: "From R to CFF" subtitle: "Crosswalk" -description: > - A comprehensive description of the internal mappings performed by **cffr**. +description: >- + A comprehensive description of the internal mappings performed by + the cffr package. author: Diego Hernangómez bibliography: REFERENCES.bib link-citations: yes