Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
76bbc79
bump to v0.8.2
hansvancalster May 26, 2025
549e3e4
remove not needed html layout
hansvancalster May 26, 2025
3528097
fix keywords parsing
hansvancalster Jul 15, 2025
512cd47
fix issue #137
hansvancalster Dec 2, 2025
6411f8d
fix issue #134
hansvancalster Dec 2, 2025
65783f9
fixes for checklist
hansvancalster Dec 2, 2025
e2e9198
use bsplus instead of slickR for image carousel
hansvancalster Dec 2, 2025
bb0fb83
avoid linter
hansvancalster Dec 3, 2025
37b02c9
update citation and description
hansvancalster Dec 3, 2025
331187d
avoid linter
hansvancalster Dec 3, 2025
5ed4e5b
add license to yaml
hansvancalster Dec 3, 2025
bd20fd2
remove not needed check for gert
hansvancalster Dec 3, 2025
1fe6c59
require checklist >=0.5.1
hansvancalster Dec 4, 2025
42a6344
add missing yaml tags (checklist 0.5.1)
hansvancalster Dec 4, 2025
2116998
add fake inbo organisation remotes to unit tests
hansvancalster Dec 4, 2025
880881f
updates by checklist
hansvancalster Dec 4, 2025
359bc03
update to ubuntu 24.04
hansvancalster Dec 4, 2025
b1854e7
update release GHA
hansvancalster Dec 4, 2025
b1606d9
update contributing.md
hansvancalster Dec 4, 2025
4b58bca
attempt fix GHA checklist
hansvancalster Dec 4, 2025
840e132
another attempt
hansvancalster Dec 4, 2025
49f49fc
check for more possibly missing tex packages
hansvancalster Dec 4, 2025
bc4969d
remove two packages not in package manager
hansvancalster Dec 4, 2025
2f67010
fix citation_meta warning
hansvancalster Dec 4, 2025
a26f288
simplify index.Rmd listing
hansvancalster Dec 5, 2025
9854fa2
catch NULL case
hansvancalster Dec 5, 2025
a4d9777
consistency
hansvancalster Dec 5, 2025
b48aa90
make sure source folder exists
hansvancalster Dec 5, 2025
b5b01bb
further simplify getting indexpaths
hansvancalster Dec 5, 2025
a174a78
to aid debugging GHA
hansvancalster Dec 5, 2025
85b5c5d
rename testthat files (logical order)
hansvancalster Dec 5, 2025
31a000f
extra GHA debugging
hansvancalster Dec 5, 2025
7d1fba1
debugging GHA
hansvancalster Dec 8, 2025
1eaf2a3
another debug attempt
hansvancalster Dec 8, 2025
477d7b9
more cat statements
hansvancalster Dec 8, 2025
ad5ef0e
more debugging and potential fix
hansvancalster Dec 8, 2025
7e61ca8
unname new_version
hansvancalster Dec 8, 2025
50ee00a
remove cat statements
hansvancalster Dec 8, 2025
953a144
swith to check_pkg@devel
hansvancalster Dec 8, 2025
fc26dc7
Revert "swith to check_pkg@devel"
hansvancalster Dec 8, 2025
77f3dc7
wrap in expect_no_error
hansvancalster Dec 8, 2025
b1c813c
remove tlgpg from list of tex packages
hansvancalster Dec 8, 2025
11e11fc
update protocol tex template
hansvancalster Dec 8, 2025
0e86091
remove bsplus dependency
hansvancalster Dec 8, 2025
4fc25c2
catch failure getting zenodo deposition
hansvancalster Dec 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
^data-raw$
^docs$
^man-roxygen$
^organisation.yml$
^pkgdown$
^protocolhelper\.Rproj$
^publish$
Expand Down
4 changes: 2 additions & 2 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ Instances of abusive, harassing, or otherwise unacceptable behaviour may be repo
opening an issue or contacting one or more of the project maintainers.

This Code of Conduct is adapted from the Contributor Covenant
(https://www.contributor-covenant.org), version 1.0.0, available at
https://contributor-covenant.org/version/1/0/0/.
(http://contributor-covenant.org), version 1.0.0, available at
http://contributor-covenant.org/version/1/0/0/
32 changes: 14 additions & 18 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
# Contributing to protocolhelper

This outlines how to propose a change to protocolhelper. For more detailed
info about contributing to this package, please see the
[**development contributing guide**](https://rstd.io/tidy-contrib).
# CONTRIBUTING #

### Fixing typos

Small typos or grammatical errors in documentation may be edited directly using
the GitHub web interface, so long as the changes are made in the _source_ file.

* YES: you edit a roxygen comment in a `.R` file below `R/`.
* NO: you edit an `.Rd` file below `man/`.
Small typos or grammatical errors in documentation may be edited directly using the GitHub web interface, so long as the changes are made in the _source_ file.
E.g. edit a `roxygen2` comment in a `.R` file below `R/`, not in an `.Rd` file below `man/`.

### Prerequisites

Before you make a substantial pull request, you should always file an issue and
make sure someone from the team agrees that it’s a problem. If you’ve found a
bug, create an associated issue and illustrate the bug with a minimal
[reprex](https://www.tidyverse.org/help/#reprex).
Before you make a substantial pull request, you should always file an issue and make sure someone from the team agrees that it’s a problem.
If you’ve found a bug, create an associated issue and illustrate the bug with a minimal [reproducible example](https://www.tidyverse.org/help/#reprex).

### Pull request process

Expand Down Expand Up @@ -97,13 +88,18 @@ To do this, you can use the following code:
version_number = version_number, theme = "water", language = "nl"
)
```
### Code of Conduct

Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md).
By contributing to this project you agree to abide by its terms.

### Prefer to Email?

Email the person listed as maintainer in the `DESCRIPTION` file of this repo.

### Code of Conduct
Though note that private discussions over email don't help others - of course
email is totally warranted if it's a sensitive problem of any kind.

Please note that the protocolhelper project is released with a
[Contributor Code of Conduct](CODE_OF_CONDUCT.md). By contributing to this
project you agree to abide by its terms.
### Thanks for contributing!

This contributing guide is adapted from the `tidyverse` contributing guide available at https://raw.githubusercontent.com/r-lib/usethis/master/inst/templates/tidy-contributing.md
18 changes: 7 additions & 11 deletions .github/workflows/check_on_branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,12 @@ name: "check package with checklist"
jobs:
check-package:
runs-on: ubuntu-latest
name: "check package"
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ZENODO_SANDBOX: ${{ secrets.ZENODO_SANDBOX }}
permissions:
contents: read
steps:
- uses: r-lib/actions/setup-pandoc@v2
with:
pandoc-version: '3.1.11'

- uses: inbo/actions/check_pkg@main
with:
path: "."
# aptget: "" (optional)
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ZENODO_SANDBOX: ${{ secrets.ZENODO_SANDBOX }}
4 changes: 2 additions & 2 deletions .github/workflows/check_on_different_r_os.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
config:
- {os: macOS-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-22.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest"}
- {os: ubuntu-22.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest"}
- {os: ubuntu-24.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/noble/latest"}
- {os: ubuntu-24.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/noble/latest"}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
Expand Down
25 changes: 9 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,21 @@ on:
- completed

jobs:
prepare:
publish:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.gettag.outputs.tag }}
body: ${{ steps.gettag.outputs.body }}
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Get tag
run: |
git fetch --tags --force
TAG=$(git tag --contains $(git rev-parse HEAD))
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
echo "body=$TAG_BODY" >> "$GITHUB_OUTPUT"
id: gettag
publish:
runs-on: ubuntu-latest
permissions:
contents: write
needs: prepare
steps:
TAG_BODY=$(git tag --contains $(git rev-parse HEAD) --format='%(contents)')
echo "tag=$TAG" >> $GITHUB_ENV
echo "$TAG_BODY" > body.md
- uses: ncipollo/release-action@v1
with:
name: Release ${{needs.prepare.outputs.tag}}
tag: ${{needs.prepare.outputs.tag}}
body: ${{needs.prepare.outputs.body}}
name: Release ${{ env.tag }}
tag: ${{ env.tag }}
bodyFile: body.md
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

!source/**/_extensions/**
# Example code in package build process
# OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3
# Output files from R CMD build
Expand All @@ -11,20 +12,29 @@
# knitr and R markdown default cache directories
# produced vignettes
*-Ex.R
*.[rR][dD]ata
*.[rR]ds
*.dbf
*.doc*
*.eps
*.gddoc
*.gdsheet
*.gpkg
*.html
*.knit.md
*.mdb
*.pdf
*.shp*
*.shx
*.sty
*.tex
*.utf8.md
*.xls*
*_cache
*_cache/
*_files
*_freeze
*_libs
.DS_Store
.RData
.Rapp.history
Expand All @@ -34,6 +44,7 @@
.Rproj.user/
.Ruserdata
.httr-oauth
.quarto
/*.Rcheck/
/*.tar.gz
/cache/
Expand Down
2 changes: 1 addition & 1 deletion .zenodo.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "protocolhelper: Helper Functions to Manage Protocols",
"version": "0.8.1",
"version": "0.8.2",
"license": "GPL-3.0",
"upload_type": "software",
"description": "<p>Helper functions to manage INBO protocols.<\/p>",
Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ abstract: "Helper functions to manage INBO protocols."
identifiers:
- type: url
value: https://inbo.github.io/protocolhelper/
version: 0.8.1
version: 0.8.2
12 changes: 6 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: protocolhelper
Title: Helper Functions to Manage Protocols
Version: 0.8.1
Version: 0.8.2
Authors@R: c(
person("Hans", "Van Calster", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0001-8595-8426", affiliation = "Research Institute for Nature and Forest (INBO)")),
Expand All @@ -10,19 +10,20 @@ Authors@R: c(
comment = c(ORCID = "0000-0002-6378-6229", affiliation = "Research Institute for Nature and Forest (INBO)")),
person("Els", "Lommelen", , "[email protected]", role = "ctb",
comment = c(ORCID = "0000-0002-3481-5684", affiliation = "Research Institute for Nature and Forest (INBO)")),
person("Research Institute for Nature and Forest (INBO)", , , "[email protected]", role = c("cph", "fnd"))
person("Research Institute for Nature and Forest (INBO)", , , "[email protected]", role = c("cph", "fnd"),
comment = c(ROR = "https://ror.org/00j54wy13"))
)
Description: Helper functions to manage INBO protocols.
License: GPL-3
URL: https://inbo.github.io/protocolhelper/,
https://github.com/inbo/protocolhelper
BugReports: https://github.com/inbo/protocolhelper/issues
Depends:
R (>= 3.6)
R (>= 4.1.0)
Imports:
assertthat,
bookdown,
checklist (>= 0.4.1),
checklist (>= 0.5.1),
cli,
commonmark,
fs,
Expand All @@ -47,7 +48,6 @@ Suggests:
png,
reactable,
rlang,
slickR,
testthat (>= 2.1.0),
tinytex,
zen4R
Expand All @@ -59,5 +59,5 @@ Encoding: UTF-8
Language: en-GB
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
RoxygenNote: 7.3.3
SystemRequirements: Pandoc (>= 2.0.0)
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ importFrom(xml2,xml_find_all)
importFrom(xml2,xml_text)
importFrom(yaml,as.yaml)
importFrom(yaml,read_yaml)
importFrom(yaml,write_yaml)
importFrom(ymlthis,as_yml)
importFrom(ymlthis,use_index_rmd)
importFrom(ymlthis,use_yml_file)
Expand Down
11 changes: 11 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# protocolhelper 0.8.2

## Enhancement

* Fixed a layout issue in the html version (DOI appearing in wrong place)
* Handle multiple reviewers in metadata table (#134)

## Bug fix

* Fix `render_release` failure in case of multiple reviewers (#137)

# protocolhelper 0.8.1

## Bug fix
Expand Down
2 changes: 1 addition & 1 deletion R/add_subprotocols.R
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ add_subprotocols <-
prm_na <- map_lgl(prm, is.na)
assert_that(all(prm_list | prm_na))

for (i in seq_len(length(yml$params$dependencies$value))) {
for (i in seq_along(yml$params$dependencies$value)) {
if (yml$params$dependencies$value[[i]]$appendix) {
add_one_subprotocol(
code_subprotocol = yml$params$dependencies$value[[i]]$protocol_code,
Expand Down
3 changes: 2 additions & 1 deletion R/check_frontmatter.R
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,14 @@ check_frontmatter <- function(
]
)

vn <- get_version_number()
problems <- c(
problems,
paste0(
"version number in the YAML of index.Rmd needs to be updated.\n",
"Please use protocolhelper::update_version_number()."
)[
!identical(get_version_number(), yml_protocol$version_number)
!identical(vn, yml_protocol$version_number)
]
)

Expand Down
2 changes: 1 addition & 1 deletion R/convert_docx.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' @title Convert a docx-file (a protocol) to an (R)markdown file
#'
#' @description This function is derived from the
#' [`redoc::dedoc()`](https://noamross.github.io/redoc/reference/dedoc.html)
#' `redoc::dedoc()`
#' function and uses `pandoc` to convert between docx and markdown.
#' Several options are preset to end-up with a markdown document that is in
#' syntax as close as possible to Rmarkdown files in RStudio.
Expand Down
15 changes: 15 additions & 0 deletions R/create_protocol.R
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,10 @@ create_protocol <- function(
yaml <- c(
yaml,
paste("language:", language),
paste(
"lang:",
paste0(language, "-BE"[language == "nl"], "-GB"[language == "en"])
),
paste("date:", "\"`r Sys.Date()`\""),
paste("protocol_code:", protocol_code),
paste0("version_number: \"", version_number, "\""),
Expand All @@ -272,10 +276,21 @@ create_protocol <- function(
paste("project_name:", project_name)[!is.null(project_name)],
"community: \"inbo\"", # required by citation_meta
paste0("publisher: ", inbo_affiliation[[language]]),
"rightsholder:",
" - name:",
paste0(" given: ", inbo_affiliation[[language]]),
" email: [email protected]",
" ror: https://ror.org/00j54wy13",
"funder:",
" - name:",
paste0(" given: ", inbo_affiliation[[language]]),
" email: [email protected]",
" ror: https://ror.org/00j54wy13",
"site: bookdown::bookdown_site",
"bibliography: references.yaml"[language == "en"],
"bibliography: referenties.yaml"[language == "nl"],
"link-citations: TRUE",
"license: CC-BY 4.0", # required by citation_meta
"csl: https://raw.githubusercontent.com/citation-style-language/styles/master/research-institute-for-nature-and-forest.csl" # nolint
)

Expand Down
8 changes: 5 additions & 3 deletions R/create_protocol_helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -688,9 +688,11 @@ yaml_interactive <- function() {
strsplit(";") |>
unlist() |>
gsub(pattern = "^\\s+", replacement = "") |>
gsub(pattern = "\\s+$", replacement = "") |>
paste(collapse = "; ") |>
sprintf(fmt = "keywords: \"%s\"") -> keywords
gsub(pattern = "\\s+$", replacement = "") -> keywords

paste0("'", keywords, "'") |>
paste(collapse = ",") |>
sprintf(fmt = "keywords: [%s]") -> keywords

c(
yaml,
Expand Down
6 changes: 4 additions & 2 deletions R/get_version_number.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ get_version_number <- function(path = ".") {

# list all index.Rmd files
indexpaths <- dir_ls(
path = path, recurse = TRUE,
regexp = "source\\/s[fpioa]p\\/.+\\/index\\.Rmd"
path = path,
recurse = TRUE,
regexp = "index\\.Rmd$"
)

# read YAML front matter
Expand Down Expand Up @@ -107,6 +108,7 @@ increment_version_number <- function(versions) {
paste0(lastyear, ".", increment),
paste0(currentyear, ".01")
)
new_version <- unname(new_version)
return(new_version)
} else {
new_version <- paste0(format(Sys.Date(), "%Y"), ".01")
Expand Down
Loading
Loading