Skip to content

Commit

Permalink
redocument with roxygen2 7.3.1 + add missing @export (#811)
Browse files Browse the repository at this point in the history
  • Loading branch information
olivroy authored Apr 23, 2024
1 parent a52ebe3 commit abe4b4e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,5 @@ Config/Needs/coverage: covr
Config/Needs/website: pkgdown, tidyverse/tidytemplate
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
SystemRequirements: pandoc (>= 1.14) - http://pandoc.org
7 changes: 7 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@

S3method(format,learnr_available_tutorials)
S3method(format,mock_exercise)
S3method(format,shiny_selector)
S3method(format,shiny_selector_list)
S3method(format,tutorial_exercise)
S3method(format,tutorial_question)
S3method(format,tutorial_question_answer)
S3method(format,tutorial_quiz)
S3method(knit_print,tutorial_question)
S3method(knit_print,tutorial_quiz)
S3method(mutate_tags,default)
S3method(mutate_tags,list)
S3method(mutate_tags,shiny.tag)
S3method(print,learnr_available_tutorials)
S3method(print,shiny_selector)
S3method(print,shiny_selector_list)
S3method(print,tutorial_exercise)
S3method(print,tutorial_question)
S3method(print,tutorial_question_answer)
Expand Down
6 changes: 6 additions & 0 deletions R/html_selector.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,27 @@ as_selector_list <- function(selector) {
selector
}

#' @export
format.shiny_selector <- function(x, ...) {
if (x$match_everything) {
paste0("* // match everything")
} else {
paste0(x$element, if (!is.null(x$id)) paste0("#", x$id), paste0(".", x$classes, collapse = ""))
}
}

#' @export
format.shiny_selector_list <- function(x, ...) {
paste0(unlist(lapply(x, format, ...)), collapse = " ")
}

#' @export
print.shiny_selector <- function(x, ...) {
cat("// css selector\n")
cat(format(x, ...), "\n")
}

#' @export
print.shiny_selector_list <- function(x, ...) {
cat("// css selector list\n")
cat(format(x, ...), "\n")
Expand Down
3 changes: 3 additions & 0 deletions R/mutate_tags.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ mutate_tags <- function(ele, selector, fn, ...) {
UseMethod("mutate_tags", ele)
}

#' @export
mutate_tags.default <- function(ele, selector, fn, ...) {
if (any(
c(
Expand All @@ -31,6 +32,7 @@ mutate_tags.default <- function(ele, selector, fn, ...) {
)
}

#' @export
mutate_tags.list <- function(ele, selector, fn, ...) {
# set values to maintain attrs and class values
ele[] <- lapply(
Expand All @@ -42,6 +44,7 @@ mutate_tags.list <- function(ele, selector, fn, ...) {
ele
}

#' @export
mutate_tags.shiny.tag <- function(ele, selector, fn, ...) {
# # vectorize selector. (Currently not used, so removed)
# if (inherits(selector, "character")) {
Expand Down

0 comments on commit abe4b4e

Please sign in to comment.