Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: pkgcheck
Title: rOpenSci Package Checks
Version: 0.1.2.230
Version: 0.1.2.231
Authors@R: c(
person("Mark", "Padgham", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-2172-5265")),
Expand Down
22 changes: 20 additions & 2 deletions R/check-vignette.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,27 @@ pkgchk_has_vignette <- function (checks) {
if (is.null (format)) {
# See https://yihui.org/litedown/#sec:yaml-syntax
# litedown uses "taml", which fails with yaml parsers
f_lines <- readLines (f)
requireNamespace ("xfun", quietly = TRUE)
taml <- xfun::taml_load (readLines (f))
format <- names (taml$output)
# This can fail (xfun v0.53), so requires a fallback:
taml <- tryCatch (
xfun::taml_load (f_lines),
error = function (e) NULL
)
if (!is.null (taml)) {
format <- names (taml$output)
} else {
# manual taml parsing
taml_index <- grep ("^\\-\\-+", f_lines)
if (length (taml_index) >= 2L) {
taml_content <- f_lines [seq (taml_index [1] + 1, taml_index [2] - 1)]
index <- grep ("(output|vignette)\\:", taml_content)
if (length (index) >= 2) {
# the whole "output" fields which will contain format
format <- taml_content [seq (index [1], index [2])]
}
}
}
}

# See suffix dictionary at
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"codeRepository": "https://github.com/ropensci-review-tools/pkgcheck",
"issueTracker": "https://github.com/ropensci-review-tools/pkgcheck/issues",
"license": "https://spdx.org/licenses/GPL-3.0",
"version": "0.1.2.230",
"version": "0.1.2.231",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down
Loading