Skip to content

Commit

Permalink
Merge branch 'main' into use_python
Browse files Browse the repository at this point in the history
  • Loading branch information
milanmlft authored Nov 1, 2024
2 parents 7143242 + 46f3db7 commit e070c7d
Show file tree
Hide file tree
Showing 76 changed files with 1,096 additions and 595 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ jobs:
- {os: macOS-latest, cache: '~/Library/Application Support/renv', r: 'release'}

- {os: windows-latest, r: 'release'}

# Use 3.6 to trigger usage of RTools35
- {os: windows-latest, cache: '~\AppData\Local\renv', r: '3.6'}
# As of 2024-06, downlit now requires R >4.0.0 so this should be deprecated.
# - {os: windows-latest, cache: '~\AppData\Local\renv', r: '3.6'}

# use 4.1 to check with rtools40's older compiler
- {os: windows-latest, r: '4.1'}

Expand Down Expand Up @@ -59,7 +62,7 @@ jobs:
run: git config --global core.autocrlf false
shell: bash

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

Expand All @@ -85,7 +88,7 @@ jobs:

- name: "Restore {renv} cache"
if: runner.os != 'Windows'
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ env.RENV_PATHS_ROOT }}
key: ${{ runner.os }}-${{ env.OS_VERSION }}-renv-${{ runner.r }}-${{ hashFiles('.github/workflows/R-CMD-check.yaml') }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr-commands.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/pr-fetch@v2
with:
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/pr-fetch@v2
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
OS_VERSION: 1

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
needs: coverage

- name: Restore {renv} cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ env.RENV_PATHS_ROOT }}
key: ${{ runner.os }}-${{ env.OS_VERSION }}-renv-${{ runner.r }}-${{ hashFiles('.github/workflows/R-CMD-check.yaml') }}
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
28 changes: 17 additions & 11 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
Package: sandpaper
Title: Create and Curate Carpentries Lessons
Version: 0.16.5.9000
Version: 0.16.9
Authors@R: c(
person(given = "Robert",
family = "Davey",
role = c("aut", "cre"),
email = "[email protected]",
comment = c(ORCID = "0000-0002-5589-7754")),
person(given = "Erin",
family = "Becker",
role = c("aut"),
email = "[email protected]",
comment = c(ORCID = "0000-0002-6832-0233")),
person(given = "Zhian N.",
family = "Kamvar",
role = c("aut", "cre"),
role = c("aut"),
email = "[email protected]",
comment = c(ORCID = "0000-0003-1458-7108")),
person(given = "Julien",
Expand All @@ -27,18 +37,10 @@ Authors@R: c(
family = "Barnes",
role = c("ctb"),
email = "[email protected]"),
person(given = "Erin",
family = "Becker",
role = c("ctb"),
email = "[email protected]"),
person(given = "Hugo",
family = "Gruson",
role = c("ctb"),
email = "[email protected]"),
person(given = "Rob",
family = "Davey",
role = c("ctb"),
email = "[email protected]"),
person(given = "Milan",
family = "Malfait",
role = c("ctb"),
Expand All @@ -53,6 +55,10 @@ Authors@R: c(
family = "Bellini Saibene",
role = c("ctb", "trl"),
comment = c(ORCID = "0000-0002-4522-7466")),
person(given = "Martin",
family = "Raden",
role = c("ctb", "trl"),
comment = c(ORCID = "0000-0002-7926-5911")),
person())
Description: We provide tools to build a Carpentries-themed lesson repository
into an accessible standalone static website. These include local tools and
Expand Down Expand Up @@ -108,7 +114,7 @@ Config/testthat/parallel: false
Config/Needs/check: rstudio/renv
Config/potools/style: explicit
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
URL: https://carpentries.github.io/sandpaper/, https://github.com/carpentries/sandpaper/, https://carpentries.github.io/workbench/
BugReports: https://github.com/carpentries/sandpaper/issues/
VignetteBuilder: knitr
56 changes: 55 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,58 @@
# sandpaper 0.16.5.9000 (2024-04-19)
# sandpaper 0.16.9 (2024-10-15)

## BUG FIXES

* Pin remaining workflows to ubuntu-22.04 instead of ubuntu-latest
(@froggleston #610)
* Add compiled potools translation for German


# sandpaper 0.16.8 (2024-10-11)

## BUG FIXES

* Pin workflow to ubuntu-22.04 instead of ubuntu-latest
(reported @chrbknudsen #605, fixed @froggleston #606)
* Update notes to remove excessive build warnings
(@milanmlft #599)

## LANGUAGES

* Add `R-de.po` for German translations of lesson elements
(@martin-raden #607)

## MISC

* Added @martin-raden as a contributor and translator - welcome!


# sandpaper 0.16.7 (2024-09-04)

## BUG FIXES

* Add overwrite option to pr workflow to fix change in default from
[update-artifact action v3 to v4](https://github.com/actions/upload-artifact#breaking-changes)
(@milanmlft #602)


# sandpaper 0.16.6 (2024-08-23)

## BUG FIXES

* Regression fix for update to pkgdown resulting in
duplicated untranslated h2 anchors for sections (@froggleston #600)
* Fix various action warnings and issues relating to
old Node.js versions (@jhlegarreta #596)
* Update core actions to v4 (@Bisaloo #577)

## NEW FEATURES

* Allow custom carpentry config types, and associated alt-text descriptions to
support alternative logos/theming of lessons (@milanmlft #585, @ErinBecker)
* Add support for French translations of core lesson components/sections (@Bisaloo #595)


# sandpaper 0.16.5 (2024-06-18)

## BUG FIXES

Expand Down
4 changes: 2 additions & 2 deletions R/build_episode.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' Build a single episode html file
#'
#' This is a Carpentries-specific wrapper around [pkgdown::render_page()] with
#' templates from {varnish}. This function is largely for internal use and will
#' templates from `{varnish}`. This function is largely for internal use and will
#' likely change.
#'
#' @param path_md the path to the episode markdown (not RMarkdown) file
Expand Down Expand Up @@ -165,7 +165,7 @@ get_nav_data <- function(path_md, path_src = NULL, home = NULL,
#' @param workenv an environment to use for evaluation. Defaults to the global
#' environment, which evaluates to the environment from [callr::r()].
#' @param quiet if `TRUE`, output is suppressed, default is `FALSE` to show
#' {knitr} output.
#' `{knitr}` output.
#' @param error if `TRUE` (default) errors do not make an invalid build.
#' This can be set to false to cause the build to fail if an error occurs.
#' This is generally controlled via the `fail_on_error` config option.
Expand Down
2 changes: 1 addition & 1 deletion R/build_home.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#' 2. learners/setup.md
#'
#' This function uses [render_html()] to convert the page into HTML, which gets
#' passed on to the "syllabus" or "overview" templates in {varnish} (via the
#' passed on to the "syllabus" or "overview" templates in `{varnish}` (via the
#' [build_html()] function as the `{{{ readme }}}` and `{{{ setup }}}` keys.
build_home <- function(pkg, quiet, next_page = NULL) {
page_globals <- setup_page_globals()
Expand Down
6 changes: 3 additions & 3 deletions R/build_html.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Build instructor and learner HTML page
#'
#' @param template the name of the {varnish} template to use. Defaults to
#' @param template the name of the `{varnish}` template to use. Defaults to
#' "chapter"
#' @param pkg an object created from [pkgdown::as_pkgdown()]
#' @param nodes an `xml_document` object. `nodes` will be a list of two
Expand All @@ -9,7 +9,7 @@
#' and learner page, it will be a single `xml_document` object.
#' @param global_data a list store object that contains copies of the global
#' variables for the page, including metadata, navigation, and variables for
#' the {varnish} templates.
#' the `{varnish}` templates.
#' @param path_md the path (absolute, relative, or filename) the current
#' markdown file being processed.
#' @param quiet This parameter is passed to [pkgdown::render_page()] and will
Expand All @@ -20,7 +20,7 @@
#'
#' @details This function is a central workhorse that connects the global
#' lesson metadata and the global variables for each page to the rendering
#' engine: {pkgdown}. It will perform the global operations that includes
#' engine: `{pkgdown}`. It will perform the global operations that includes
#' setting up the navigation (via [update_sidebar()]), adding metadata, and
#' building both the instructor and learner versions of the page (via
#' [pkgdown::render_page()]).
Expand Down
4 changes: 2 additions & 2 deletions R/build_lesson.R
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ build_lesson <- function(path = ".", rebuild = FALSE, quiet = !interactive(), pr
#
# Once we know we have all of the lesson components, we can build the markdown
# sources and store them in `site/built`. Only the markdown sources that have
# changed in content will be rebuilt with {knitr}.
# changed in content will be rebuilt with `{knitr}`.
built <- build_markdown(path = path, rebuild = rebuild, quiet = quiet, slug = slug)

# Building the HTML ----------------------------------------------------------
#
# This step uses the contents of `site/built` to build the website in
# `site/docs` with {whisker} and {pkgdown}
# `site/docs` with {whisker} and `{pkgdown}`
build_site(path = path, quiet = quiet, preview = preview, override = override, slug = slug, built = built)

}
Expand Down
6 changes: 3 additions & 3 deletions R/build_markdown.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' Build plain markdown from the RMarkdown episodes
#'
#' In the spirit of {hugodown}, This function will build plain markdown files
#' as a minimal R package in the `site/` folder of your {sandpaper} lesson
#' In the spirit of `{hugodown}`, This function will build plain markdown files
#' as a minimal R package in the `site/` folder of your `{sandpaper}` lesson
#' repository tagged with the hash of your file to ensure that only files that
#' have changed are rebuilt.
#'
Expand Down Expand Up @@ -114,7 +114,7 @@ build_markdown <- function(path = ".", rebuild = FALSE, quiet = FALSE, slug = NU
}
cli::cli_end()

# Update hash of {renv} file if it exists ------------------------------------
# Update hash of `{renv}` file if it exists ------------------------------------
if (getOption("sandpaper.use_renv")) {
hash <- renv_lockfile_hash(path, db_path)
lf_hash <- fs::path_file(db$new$file) == "renv.lock"
Expand Down
2 changes: 1 addition & 1 deletion R/ci_build.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#' - `ci_build_site()`: defaults to `gh-pages`, corresponds to `site_branch`
#' in [ci_deploy()]
#' @note `ci_build_markdown()` will set the `sandpaper.use_renv`
#' option to TRUE, which means that it will _always_ use the {renv}
#' option to TRUE, which means that it will _always_ use the `{renv}`
#' package cache if the lesson uses R Markdown.
#' @returns
#' - `ci_build_markdown()`: an [expression()] that is evaluated to tear down
Expand Down
2 changes: 1 addition & 1 deletion R/create_episode.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#' @param make_prefix a logical. When `TRUE`, the prefix for the file will be
#' automatically determined by the files already present. When `FALSE`
#' (default), it assumes no prefix is needed.
#' @param path the path to the {sandpaper} lesson.
#' @param path the path to the `{sandpaper}` lesson.
#' @param add (logical or numeric) If numeric, it represents the position the
#' episode should be added. If `TRUE`, the episode is added to the end of the
#' schedule. If `FALSE`, the episode is added as a draft episode.
Expand Down
2 changes: 1 addition & 1 deletion R/create_lesson.R
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ create_lesson <- function(path, name = fs::path_file(path), rmd = TRUE, rstudio

cli::cli_status_update("{cli::symbol$arrow_right} Committing ...")
gert::git_add(".", repo = path)
gert::git_commit(message = "Initial commit [via {sandpaper}]", repo = path)
gert::git_commit(message = "Initial commit [via `{sandpaper}`]", repo = path)
enforce_main_branch(path)
reset_git_user(path)

Expand Down
2 changes: 1 addition & 1 deletion R/get_drafts.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Show files in draft form
#'
#' By default, {sandpaper} will use the files in alphabetical order as they are
#' By default, `{sandpaper}` will use the files in alphabetical order as they are
#' presented in the folders, however, it is **strongly** for authors to specify
#' the order of the files in their lessons, so that it's easy to rearrange or
#' add, split, or rearrange files.
Expand Down
4 changes: 2 additions & 2 deletions R/manage_deps.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
#' projects on their computer where the package versions are necessary for
#' their work, it's important that those environments are respected.
#'
#' Our flavor of {renv} applies a package cache explicitly to the content of
#' the lesson, but does not impose itself as the default {renv} environment.
#' Our flavor of `{renv}` applies a package cache explicitly to the content of
#' the lesson, but does not impose itself as the default `{renv}` environment.
#'
#' This provisioner will do the following steps:
#'
Expand Down
10 changes: 5 additions & 5 deletions R/options.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,20 @@
#' ### sandpaper.use_renv
#'
#' **Default: variable** This option should not be modified by the user. It
#' determines if {renv} should be used locally for R-based lessons. It is set
#' determines if `{renv}` should be used locally for R-based lessons. It is set
#' by [use_package_cache()] and unset by [no_package_cache()]. If a local user
#' has never consented to using {renv} previously, then it defaults to `FALSE`,
#' but if {renv} has previously been used, it will be `TRUE`.
#' has never consented to using `{renv}` previously, then it defaults to `FALSE`,
#' but if `{renv}` has previously been used, it will be `TRUE`.
#'
#' ### sandpaper.package_cache_trigger
#'
#' **Default: FALSE locally/TRUE on GitHub** this tells R Markdown lessons to
#' rebuild everything if the {renv} lockfile changes.
#' rebuild everything if the `{renv}` lockfile changes.
#'
#' ### sandpaper.test_fixture
#'
#' **Default: NULL** This is ONLY for internal use for testing interactive
#' components non-interactively and for setting {renv} to behave correctly while
#' components non-interactively and for setting `{renv}` to behave correctly while
#' testing.
#'
#' @name sandpaper.options
Expand Down
6 changes: 3 additions & 3 deletions R/package_cache.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
#'
#' ## I have used \pkg{renv} before; how do I turn it off before sandpaper loads?
#'
#' You can set `options(sandpaper.use_renv = FALSE)` before loading {sandpaper}.
#' You can set `options(sandpaper.use_renv = FALSE)` before loading `{sandpaper}`.
#'
#' @param prompt if `TRUE` (default when interactive), a prompt for consent
#' giving information about the proposed modifications will appear on the
Expand All @@ -68,7 +68,7 @@
#' inside the package cache.
#' @examples
#' if (!getOption("sandpaper.use_renv") && interactive()) {
#' # The first time you set up {renv}, you will need permission
#' # The first time you set up `{renv}`, you will need permission
#' use_package_cache(prompt = TRUE)
#' # The package cache trigger is FALSE, by default
#' default <- package_cache_trigger()
Expand All @@ -79,7 +79,7 @@
#' }
#'
#' if (getOption("sandpaper.use_renv") && interactive()) {
#' # If you have previously used {renv}, permission is implied
#' # If you have previously used `{renv}`, permission is implied
#' use_package_cache(prompt = TRUE)
#'
#' # You can temporarily turn this off
Expand Down
Loading

0 comments on commit e070c7d

Please sign in to comment.