Skip to content

Commit

Permalink
Improve the suggestion for missing topics.
Browse files Browse the repository at this point in the history
Closes #2800
  • Loading branch information
jayhesselberth committed Oct 28, 2024
1 parent 4f5c10e commit ffe60d5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion R/build-reference-index.R
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,10 @@ check_missing_topics <- function(rows, pkg, error_call = caller_env()) {
pkg,
c(
"{sum(missing)} topic{?s} missing from index: {.val {pkg$topics$name[missing]}}.",
i = "Either use {.code @keywords internal} to drop from index, or"
i = paste(
"Either add to the reference index,",
"or use {.code @keywords internal} to drop from the index."
)
),
call = error_call
)
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/build-reference-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
Condition
Error:
! In _pkgdown.yml, 3 topics missing from index: "c", "e", and "?".
i Either use `@keywords internal` to drop from index, or
i Either add to the reference index, or use `@keywords internal` to drop from the index.

# gives informative errors

Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/check.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
v Articles metadata ok.
x Reference metadata not ok.
In _pkgdown.yml, 1 topic missing from index: "?".
Either use `@keywords internal` to drop from index, or
Either add to the reference index, or use `@keywords internal` to drop from the index.

# checks fails on first problem

Expand Down

0 comments on commit ffe60d5

Please sign in to comment.