-
-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add handout options #527
Add handout options #527
Conversation
I have no clue why the checks are not starting. @froggleston, could you merge in the main branch, add NEWS, and bump the version number to devel as described in https://carpentries.github.io/workbench-dev/releases.html? |
I've added you to the DESCRIPTION and also fixed some tests that were breaking because of things. At the moment Windows is failing for weird reasons: ══ Failed tests ════════════════════════════════════════════════════════════════
── Failure ('test-build_markdown.R:173:3'): Artifacts are accounted for ────────
fs::path_file(a) (`actual`) and c(figs, b, "code-handout.R") (`expected`) don't have the same values.
* Only in `actual`: "code-handout.R"
[ FAIL 1 | WARN 0 | SKIP 24 | PASS 1005 ]
Error: Error: Test failures
ℹ 'D:/a/_temp/RtmpysTSvn/working_dir/RtmpEVreqL/file15c4ce49f6/lesson-example' successfully removed
Error in vapply(X, FUN, FUN.VALUE = character(1), ..., USE.NAMES = USE.NAMES) :
values must be type 'character',
but FUN(X[[1]]) result is type 'logical'
Calls: test_check ... test_dir -> test_files -> test_files_serial -> <Anonymous>
Execution halted There are two things to notice:
|
This is one of the weird litte things that I need to get better at controlling. When we test these things, the global metdata is affected, but it's not possible (at the moment) to _remove_ metadata without resetting everything, so instead, we need to set the global metadata option for "handout" to NULL. In the words of the author of a C++ library that I rewrote in R for my Ph. D.: > This is a bloody awful nasty hack ... and will give us grief > elsewhere. Find a better way to do this
I have finally figured out why the windows tests have been failing: there is a weird bug in gert where it's apparently having trouble removing a bare repository (that we use as the remote) because of a pack file with incorrect permissions:
In any case, this is not going to be a big problem because this is explicitly in the context of tests and not in production code (i.e. we do not delete our remote in production). |
Thank you @froggleston and @klbarnes20! |
This PR adds a new option in the
config.yaml
to support configuration of whether a handout should be included.This removes the need to supply
sandpaper.handout = TRUE
in the options() function, but keeps the functionality to either specifyhandout: true
orhandout: "/path/to/handout_file.R"