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
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export(add_card_button_ui)
export(as.teal_report)
export(as_yaml_auto)
export(code_chunk)
export(code_output)
export(doc)
export(download_report_button_srv)
export(download_report_button_ui)
Expand Down
17 changes: 0 additions & 17 deletions R/doc.R
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ edit_doc <- function(x, modify = NULL, append = NULL, after = length(x)) {
#' class(my_chunk)
#' attributes(my_chunk)$param
#' @export
#' @rdname code_output
code_chunk <- function(code, ...) {
checkmate::assert_character(code)
params <- list(...)
Expand All @@ -196,22 +195,6 @@ code_chunk <- function(code, ...) {
)
}

#' Format R code as a simple Markdown code block string
#'
#' This function takes a character string of R code and wraps it in
#' Markdown's triple backticks for code blocks.
#'
#' @param code A character string containing the R code.
#' @return A character string representing a simple Markdown code block.
#' @seealso [code_chunk()] for creating structured code chunk objects with options.
#' @examples
#' code_output("y <- rnorm(5)")
#' @export
#' @rdname code_output
code_output <- function(code) {
sprintf("```\n%s\n```", code)
}

#' @title Keep Objects In Report
#' @description Utility function to change behavior of `doc` elements to be
#' kept (`keep = TRUE`) or discarded (`keep = FALSE`) from the final `.Rmd` file containing the downloaded report.
Expand Down
12 changes: 0 additions & 12 deletions man/code_output.Rd → man/code_chunk.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions tests/testthat/test-doc.R
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,6 @@ testthat::test_that("code_chunk creates a code_chunk object with params", {
testthat::expect_equal(attributes(chunk)$params, list(echo = FALSE, eval = TRUE))
})

testthat::test_that("code_output formats code as markdown string", {
output <- code_output("x <- 1")
testthat::expect_type(output, "character")
testthat::expect_equal(output, "```\nx <- 1\n```")
})

testthat::test_that("keep_in_report sets the 'keep' attribute", {
obj1 <- "some text"
kept_obj1 <- keep_in_report(obj1, TRUE)
Expand Down