From 8da11ba6b72abfb2b89e529a070e9c6ef1190075 Mon Sep 17 00:00:00 2001 From: mitchelloharawild Date: Wed, 4 Oct 2023 16:26:01 +1100 Subject: [PATCH] Update references to rjournal_web_article -> rjournal_article --- R/rj_article.R | 8 +++++++- R/rj_pdf_issue.R | 2 +- _pkgdown.yml | 2 ++ inst/paper-with-errors/paper-with-errors.Rmd | 2 +- inst/rmarkdown/templates/rjournal/skeleton/skeleton.Rmd | 2 +- inst/sample-article/article.Rmd | 2 +- man/create_article.Rd | 2 +- tests/bad-article/article.Rmd | 2 +- vignettes/create_article.Rmd | 2 +- vignettes/format-details.Rmd | 8 +++++--- 10 files changed, 21 insertions(+), 11 deletions(-) diff --git a/R/rj_article.R b/R/rj_article.R index cc64d69..f63af8b 100644 --- a/R/rj_article.R +++ b/R/rj_article.R @@ -122,7 +122,13 @@ rjournal_article <- function(toc = FALSE, self_contained = FALSE, if(!is.null(metadata$csl)) warning("Please do not use custom CSL formatting, if there is an issue with the default styling please contact r-journal@r-project.org") metadata$csl <- metadata$csl %||% system.file("rjournal.csl", package = "rjtools", mustWork = TRUE) - metadata$output <- replace_names(metadata$output, c("rjtools::rjournal_web_article" = "distill::distill_article")) + metadata$output <- replace_names( + metadata$output, + c( + "rjtools::rjournal_web_article" = "distill::distill_article", + "rjtools::rjournal_article" = "distill::distill_article" + ) + ) # Replace metadata with modified copy article_metadata <<- metadata diff --git a/R/rj_pdf_issue.R b/R/rj_pdf_issue.R index 84d2cdf..aa068fe 100644 --- a/R/rj_pdf_issue.R +++ b/R/rj_pdf_issue.R @@ -118,7 +118,7 @@ rjournal_pdf_issue <- function(..., render_all = FALSE) { callr::r(function(input){ rmarkdown::render( input, - output_format = "rjtools::rjournal_web_article" + output_format = "rjtools::rjournal_article" ) }, args = list(input = art_rmd)) } diff --git a/_pkgdown.yml b/_pkgdown.yml index f208a39..72a3e5d 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -16,7 +16,9 @@ reference: - title: R Markdown article format desc: Functions to build HTML and PDF R Journal articles contents: + - rjournal_article - rjournal_web_article + - rjournal_pdf_article - title: Prepare article submission desc: Functions to help building a zip file of relevant materials for submission contents: diff --git a/inst/paper-with-errors/paper-with-errors.Rmd b/inst/paper-with-errors/paper-with-errors.Rmd index e18dbf0..d26f5f6 100644 --- a/inst/paper-with-errors/paper-with-errors.Rmd +++ b/inst/paper-with-errors/paper-with-errors.Rmd @@ -23,7 +23,7 @@ author: - Somewhere, Australia type: package output: - rjtools::rjournal_web_article + rjtools::rjournal_article bibliography: RJreferences.bib --- diff --git a/inst/rmarkdown/templates/rjournal/skeleton/skeleton.Rmd b/inst/rmarkdown/templates/rjournal/skeleton/skeleton.Rmd index 1d864d2..db54edf 100644 --- a/inst/rmarkdown/templates/rjournal/skeleton/skeleton.Rmd +++ b/inst/rmarkdown/templates/rjournal/skeleton/skeleton.Rmd @@ -25,7 +25,7 @@ author: orcid: 0000-0002-0912-0225 type: package output: - rjtools::rjournal_web_article: + rjtools::rjournal_article: self_contained: yes toc: no bibliography: RJreferences.bib diff --git a/inst/sample-article/article.Rmd b/inst/sample-article/article.Rmd index 9038864..d173722 100644 --- a/inst/sample-article/article.Rmd +++ b/inst/sample-article/article.Rmd @@ -24,7 +24,7 @@ author: - Somewhere, Australia type: package output: - rjtools::rjournal_web_article + rjtools::rjournal_article bibliography: article.bib --- diff --git a/man/create_article.Rd b/man/create_article.Rd index 98cea3b..171e6c4 100644 --- a/man/create_article.Rd +++ b/man/create_article.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/rj_article.R +% Please edit documentation in R/rjournal_article.R \name{create_article} \alias{create_article} \title{Create an R Journal article with the existing template} diff --git a/tests/bad-article/article.Rmd b/tests/bad-article/article.Rmd index 50b18cc..04018be 100644 --- a/tests/bad-article/article.Rmd +++ b/tests/bad-article/article.Rmd @@ -24,7 +24,7 @@ author: - Somewhere, Australia type: package output: - rjtools::rjournal_web_article + rjtools::rjournal_article bibliography: article.bib --- diff --git a/vignettes/create_article.Rmd b/vignettes/create_article.Rmd index 43ce121..4575da2 100644 --- a/vignettes/create_article.Rmd +++ b/vignettes/create_article.Rmd @@ -60,7 +60,7 @@ install.packages(c("plotly", "ggplot2", "kableExtra", "palmerpenguins")) The R Journal uses `pandoc-citeproc` to handle the Citation Style Language (CSL) style. If you're knitting the document within RStudio (which we recommend), this is automatically handled. However, if you're using the command line, you'll need to ensure the `pandoc-citeproc` extension is installed properly on your system. -The `rjtools::rjournal_web_article` output specified in the article YAML will create the article in both html and pdf formats. Additional files created during the knit are (assuming file name of `quokka-bilby`): +The `rjtools::rjournal_article` output specified in the article YAML will create the article in both html and pdf formats. Additional files created during the knit are (assuming file name of `quokka-bilby`): - **quokka-bilby.html**: the html article - **quokka-bilby.pdf**: the pdf article diff --git a/vignettes/format-details.Rmd b/vignettes/format-details.Rmd index 230c363..9275950 100644 --- a/vignettes/format-details.Rmd +++ b/vignettes/format-details.Rmd @@ -31,7 +31,7 @@ This has these components: - output format lines should look like ``` output: - rjtools::rjournal_web_article + rjtools::rjournal_article ``` - `bibliography: RJreferences.bib` @@ -205,7 +205,7 @@ Custom `css` is discouraged, because all articles should look similar. However, If you are already writing your articles using Rmarkdown, and have written your article using the `rticles::rjournal_article` style it is straightforward to make the switch to the `rjtools` styling. These are the steps that you need to follow: -1. change output formats to `rjtools::rjournal_web_article` to switch to the new style, +1. change output formats to `rjtools::rjournal_article` to switch to the new style, 2. remove any latex specific functionality, 3. change figure, table references to `\@ref()` and 4. add the `rjournal.csl` and `rjournal.css` template files to your folder, updating YAML to utilise them, and @@ -237,7 +237,9 @@ Examples for your paper should be computed relatively quickly, which often means If you have a large file that you believe should be used for the paper, you could store the file elsewhere, on your own GitHub repo, or on a data file share service like [Figshare](https://help.figshare.com/article/guide-to-sharing-data-on-figshare-plus), and add download and handling code to your paper. -# Handling slow computations The editorial team needs to re-build your article to check that results are reproducible, and the editor will need to re-build your article when it is organised into an issue. Try to ensure that your code runs quickly. If you need to have a code chunk that takes several minutes or more to run, consider turning the chunk off, providing an intermediate state that is loaded into the next chunk. Generally, we advise against using the `cache` feature of Rmarkdown because when multiple articles are built in the issue construction it might render your article inadequately. +# Handling slow computations + +The editorial team needs to re-build your article to check that results are reproducible, and the editor will need to re-build your article when it is organised into an issue. Try to ensure that your code runs quickly. If you need to have a code chunk that takes several minutes or more to run, consider turning the chunk off, providing an intermediate state that is loaded into the next chunk. Generally, we advise against using the `cache` feature of Rmarkdown because when multiple articles are built in the issue construction it might render your article inadequately. # Trouble-shooting