Skip to content

Commit c6dead1

Browse files
authored
remove code_output (#332)
Handled already by `to_rmd.code_chunk`
1 parent 4f10fa0 commit c6dead1

File tree

4 files changed

+0
-36
lines changed

4 files changed

+0
-36
lines changed

NAMESPACE

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ export(add_card_button_ui)
4141
export(as.teal_report)
4242
export(as_yaml_auto)
4343
export(code_chunk)
44-
export(code_output)
4544
export(doc)
4645
export(download_report_button_srv)
4746
export(download_report_button_ui)

R/doc.R

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ edit_doc <- function(x, modify = NULL, append = NULL, after = length(x)) {
185185
#' class(my_chunk)
186186
#' attributes(my_chunk)$param
187187
#' @export
188-
#' @rdname code_output
189188
code_chunk <- function(code, ...) {
190189
checkmate::assert_character(code)
191190
params <- list(...)
@@ -196,22 +195,6 @@ code_chunk <- function(code, ...) {
196195
)
197196
}
198197

199-
#' Format R code as a simple Markdown code block string
200-
#'
201-
#' This function takes a character string of R code and wraps it in
202-
#' Markdown's triple backticks for code blocks.
203-
#'
204-
#' @param code A character string containing the R code.
205-
#' @return A character string representing a simple Markdown code block.
206-
#' @seealso [code_chunk()] for creating structured code chunk objects with options.
207-
#' @examples
208-
#' code_output("y <- rnorm(5)")
209-
#' @export
210-
#' @rdname code_output
211-
code_output <- function(code) {
212-
sprintf("```\n%s\n```", code)
213-
}
214-
215198
#' @title Keep Objects In Report
216199
#' @description Utility function to change behavior of `doc` elements to be
217200
#' kept (`keep = TRUE`) or discarded (`keep = FALSE`) from the final `.Rmd` file containing the downloaded report.

man/code_output.Rd renamed to man/code_chunk.Rd

Lines changed: 0 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test-doc.R

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,6 @@ testthat::test_that("code_chunk creates a code_chunk object with params", {
126126
testthat::expect_equal(attributes(chunk)$params, list(echo = FALSE, eval = TRUE))
127127
})
128128

129-
testthat::test_that("code_output formats code as markdown string", {
130-
output <- code_output("x <- 1")
131-
testthat::expect_type(output, "character")
132-
testthat::expect_equal(output, "```\nx <- 1\n```")
133-
})
134-
135129
testthat::test_that("keep_in_report sets the 'keep' attribute", {
136130
obj1 <- "some text"
137131
kept_obj1 <- keep_in_report(obj1, TRUE)

0 commit comments

Comments
 (0)