diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 118ce80b4..83c3f26bc 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -32,7 +32,7 @@ jobs: extra-packages: local::. - name: Render book - run: Rscript -e 'rOpenScidevguide::orchestrate()' + run: Rscript -e 'babelquarto::render_book()' env: # Set the secret as an input AIRTABLE_API_KEY: ${{ secrets.AIRTABLE_API_KEY }} ZENODO_TOKEN: ${{ secrets.ZENODO_TOKEN }} @@ -41,7 +41,7 @@ jobs: run: Rscript -e 'file.copy(from = "_book/rOpenSci-Packages--Development,-Maintenance,-and-Peer-Review.pdf", to = "_book/ropensci-dev-guide.pdf")' -e 'purrr::walk(list.files("images", full.names = TRUE), file.copy, to = "_book/images")' - name: Move Spanish files - run: Rscript -e 'file.copy(from = "_book/es/rOpenSci-Packages--Development,-Maintenance,-and-Peer-Review.pdf", to = "_book/es/ropensci-dev-guide.pdf")' -e 'purrr::walk(list.files("images", full.names = TRUE), file.copy, to = "_book/es/images")' + run: Rscript -e 'file.copy(from = "_book/es/Paquetes-de-rOpenSci--Desarrollo,-mantenimiento-y-revisión-por-pares.pdf", to = "_book/es/ropensci-dev-guide.pdf")' -e 'purrr::walk(list.files("images", full.names = TRUE), file.copy, to = "_book/es/images")' - name: git config run: | diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 89d0c8725..da91510b6 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -35,7 +35,7 @@ jobs: extra-packages: local::. - name: Render book - run: Rscript -e 'rOpenScidevguide::orchestrate()' + run: Rscript -e 'babelquarto::render_book()' env: # Set the secret as an input AIRTABLE_API_KEY: ${{ secrets.AIRTABLE_API_KEY }} ZENODO_TOKEN: ${{ secrets.ZENODO_TOKEN }} @@ -44,7 +44,7 @@ jobs: run: Rscript -e 'file.copy(from = "_book/rOpenSci-Packages--Development,-Maintenance,-and-Peer-Review.pdf", to = "_book/ropensci-dev-guide.pdf")' -e 'purrr::walk(list.files("images", full.names = TRUE), file.copy, to = "_book/images")' - name: Move Spanish files - run: Rscript -e 'file.copy(from = "_book/es/rOpenSci-Packages--Development,-Maintenance,-and-Peer-Review.pdf", to = "_book/es/ropensci-dev-guide.pdf")' -e 'purrr::walk(list.files("images", full.names = TRUE), file.copy, to = "_book/es/images")' + run: Rscript -e 'file.copy(from = "_book/es/Paquetes-de-rOpenSci--Desarrollo,-mantenimiento-y-revisión-por-pares.pdf", to = "_book/es/ropensci-dev-guide.pdf")' -e 'purrr::walk(list.files("images", full.names = TRUE), file.copy, to = "_book/es/images")' - name: Deploy to Netlify id: netlify-deploy diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0b105419b..d3d5dc065 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,7 +27,7 @@ jobs: extra-packages: local::. - name: Render book - run: Rscript -e 'rOpenScidevguide::orchestrate()' + run: Rscript -e 'babelquarto::render_book()' env: # Set the secret as an input AIRTABLE_API_KEY: ${{ secrets.AIRTABLE_API_KEY }} ZENODO_TOKEN: ${{ secrets.ZENODO_TOKEN }} diff --git a/.github/workflows/scheduled-manual-main.yml b/.github/workflows/scheduled-manual-main.yml index 4a8f76514..30474fe86 100644 --- a/.github/workflows/scheduled-manual-main.yml +++ b/.github/workflows/scheduled-manual-main.yml @@ -29,6 +29,9 @@ jobs: - uses: r-lib/actions/setup-tinytex@v2 - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: | + any::bookdown - name: Render book html run: Rscript -e 'bookdown::render_book("index.Rmd", "bookdown::bs4_book", params = list(AIRTABLE_API_KEY = ${{ secrets.AIRTABLE_API_KEY }}))' diff --git a/DESCRIPTION b/DESCRIPTION index 38db69af6..1f3e5cf07 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -5,33 +5,18 @@ Description: rOpenSci Packages: Development, Maintenance, and Peer Review Version: 0.8.1 Imports: airtabler, - htmltools, - quarto, - purrr, + babeldown (>= 0.0.0.9000), + babelquarto, + gert, humaniformat, - bslib, - downlit, - xml2, rvest, usethis, - rlang (>= 0.4.11.9000), - yaml, - fs, - withr, - brio, - gert, - tinkr (>= 0.1.0), - httr2, - memoise, - babeldown (>= 0.0.0.9000) -Remotes: + withr +Remotes: bergant/airtabler, - rstudio/htmltools, - r-lib/downlit, - r-lib/rlang, - ropensci/tinkr, - ropensci-review-tools/babeldown + ropensci-review-tools/babeldown, + ropensci-review-tools/babelquarto URL: https://github.com/ropensci/dev_guide -RoxygenNote: 7.2.1 +RoxygenNote: 7.2.3 Roxygen: list(markdown = TRUE) Encoding: UTF-8 diff --git a/NAMESPACE b/NAMESPACE index cb7733a04..6ae926839 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,3 +1,2 @@ # Generated by roxygen2: do not edit by hand -export(orchestrate) diff --git a/R/orchestrate.R b/R/orchestrate.R deleted file mode 100644 index 32a555c85..000000000 --- a/R/orchestrate.R +++ /dev/null @@ -1,83 +0,0 @@ -#' Render both book versions -#' -#' @export -#' -orchestrate <- function() { - - # start from blank slate - if (fs::dir_exists("_book")) fs::dir_delete("_book") - - # render the English book - quarto::quarto_render(as_job = FALSE) - - # create temporary directory to render Spanish book - temporary_directory <- withr::local_tempdir() - fs::dir_copy(getwd(), temporary_directory) - - # change language in temporary config - config <- yaml::read_yaml(file.path(temporary_directory, "dev_guide", "_quarto.yml")) - config$lang <- "es" - - # change chapter names in temporary config - # to Spanish chapter names if they exist - fix_chapters <- function(chapters_list) { - if (is.list(chapters_list)) { - chapters_list$chapters <- gsub("\\.Rmd", ".es.Rmd", chapters_list$chapters) - if (any(!fs::file_exists(chapters_list$chapters))) { - chapters_list$chapters[!fs::file_exists(chapters_list$chapters)] <- - gsub("\\.es\\.Rmd", ".Rmd", chapters_list$chapters[!fs::file_exists(chapters_list$chapters)]) - } - chapters_list - } else { - gsub("\\.Rmd", ".es.Rmd", chapters_list) - } - } - config$book$chapters <- purrr::map(config$book$chapters, fix_chapters) - yaml::write_yaml(config, file.path(temporary_directory, "dev_guide", "_quarto.yml")) - - # fix for Boolean that is yes and should be true - config_lines <- brio::read_lines(file.path(temporary_directory, "dev_guide", "_quarto.yml")) - config_lines[grepl("code-link", config_lines)] <- sub("yes", "true", config_lines[grepl("code-link", config_lines)]) - config_lines[grepl("reader-mode", config_lines)] <- sub("yes", "true", config_lines[grepl("reader-mode", config_lines)]) - brio::write_lines(config_lines, file.path(temporary_directory, "dev_guide", "_quarto.yml")) - - # Render Spanish book - quarto::quarto_render(file.path(temporary_directory, "dev_guide"), as_job = FALSE) - # Copy it to local not temporary _book/es - fs::dir_copy(file.path(temporary_directory, "dev_guide", "_book"), file.path("_book", "es")) - - # Add the language switching link to the sidebar - add_link <- function(path, lang = "en") { - html <- xml2::read_html(path) - sidebar_action_links <- xml2::xml_find_all(html, "//div[@class='action-links']") - - if (lang == "en") { - new_path <- sub("\\...\\.html", ".html", basename(path)) - xml2::xml_add_child( - sidebar_action_links, - "a", - sprintf("Version in English", lang), - class = "toc-action", - href = sprintf("/%s", new_path) - ) - } else { - new_path <- fs::path_ext_set(basename(path), sprintf(".%s.html", lang)) - xml2::xml_add_child( - sidebar_action_links, - "a", - sprintf("Versión en español", lang), - class = "toc-action", - href = sprintf("/%s/%s", lang, new_path) - ) - } - a <- xml2::xml_children(sidebar_action_links)[length(xml2::xml_children(sidebar_action_links))] - xml2::xml_add_parent(a, "p") - - - xml2::write_html(html, path) - } - - purrr::walk(fs::dir_ls("_book", glob = "*.html"), add_link, lang = "es") - purrr::walk(fs::dir_ls("_book/es", glob = "*.html"), add_link, lang = "en") - -} diff --git a/_quarto.yml b/_quarto.yml index ad4cba833..640c2cd23 100644 --- a/_quarto.yml +++ b/_quarto.yml @@ -1,6 +1,23 @@ project: type: book + +title-es: "Paquetes de rOpenSci: Desarrollo, mantenimiento y revisión por pares" +author-es: "Equipo editorial para la revisión de software de rOpenSci (actuales y pasados): Brooke Anderson, Scott Chamberlain, Laura DeCicco, Julia Gustavsen, Jeff Hollister, Anna Krystalli, Mauro Lepore, Lincoln Mullen, Mark Padgham, Karthik Ram, Emily Riederer, Noam Ross, Maëlle Salmon, Adam Sparks, Melina Vidoni" +description-es: | + Versión extendida de la guía de empaquetado de rOpenSci. + Este libro es una guía para autoras/es, encargadas/os, revisoras/es y editoras/es de rOpenSci. + La primera sección del libro contiene + nuestras recomendaciones para crear y probar los paquetes de R. + La segunda sección está dedicada al proceso de revisión por pares de software de rOpenSci: + qué es, nuestras políticas y guías específicas para orientar + a quienes crean, mantienen, revisan y editan a lo largo del proceso. + La tercera y última sección presenta nuestras buenas prácticas para hacer crecer + su paquete una vez que ha sido incorporado a rOpenSci: cómo colaborar con otras/os desarrolladoras/es, + cómo documentar cada versión de tu paquete y cómo aprovechar GitHub como plataforma de desarrollo. + La tercera sección también incluye un capítulo para cualquiera que desee + comenzar a contribuir a los paquetes de rOpenSci. + book: favicon: images/apple-touch-icon.png title: "rOpenSci Packages: Development, Maintenance, and Peer Review" @@ -30,12 +47,14 @@ book: - preface.Rmd - part: Building Your Package + part-es: Construyendo tu paquete chapters: - pkg_building.Rmd - pkg_ci.Rmd - pkg_security.Rmd - part: Software Peer Review of Packages + part-es: Revisión por pares de software de paquetes chapters: - softwarereview_intro.Rmd - softwarereview_policies.Rmd @@ -45,6 +64,7 @@ book: - softwarereview_editor_management.Rmd - part: Maintaining Packages + part-es: Manteniendo paquetes chapters: - maintenance_cheatsheet.Rmd - maintenance_collaboration.Rmd @@ -57,6 +77,7 @@ book: - maintenance_contributing.Rmd - part: Appendix + part-es: Apéndice chapters: - booknews.Rmd - reviewtemplate.Rmd @@ -76,3 +97,7 @@ format: pdf: include-in-header: "preamble.tex" output-file: "ropensci-dev-guide" +babelquarto: + mainlanguage: en + languages: es +lang: en diff --git a/man/orchestrate.Rd b/man/orchestrate.Rd deleted file mode 100644 index afeb4168d..000000000 --- a/man/orchestrate.Rd +++ /dev/null @@ -1,11 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/orchestrate.R -\name{orchestrate} -\alias{orchestrate} -\title{Render both book versions} -\usage{ -orchestrate() -} -\description{ -Render both book versions -}