From abe4b4eeabb72e60614b863db1eb8dda6bf7da3b Mon Sep 17 00:00:00 2001 From: olivroy <52606734+olivroy@users.noreply.github.com> Date: Tue, 23 Apr 2024 13:24:23 -0400 Subject: [PATCH] redocument with roxygen2 7.3.1 + add missing `@export` (#811) --- DESCRIPTION | 2 +- NAMESPACE | 7 +++++++ R/html_selector.R | 6 ++++++ R/mutate_tags.R | 3 +++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index a8e3f0995..db9ad5366 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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 diff --git a/NAMESPACE b/NAMESPACE index ffa962c85..eb504ac36 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -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) diff --git a/R/html_selector.R b/R/html_selector.R index 165229f7b..c86f8f55d 100644 --- a/R/html_selector.R +++ b/R/html_selector.R @@ -46,6 +46,7 @@ as_selector_list <- function(selector) { selector } +#' @export format.shiny_selector <- function(x, ...) { if (x$match_everything) { paste0("* // match everything") @@ -53,14 +54,19 @@ format.shiny_selector <- function(x, ...) { 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") diff --git a/R/mutate_tags.R b/R/mutate_tags.R index 8de830056..25b94c439 100644 --- a/R/mutate_tags.R +++ b/R/mutate_tags.R @@ -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( @@ -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( @@ -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")) {