File: raw_block.R

package info (click to toggle)
r-cran-simplermarkdown 0.0.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 392 kB
  • sloc: makefile: 2
file content (23 lines) | stat: -rw-r--r-- 652 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

#' Return a raw chunk of text that can be included in the pandoc parse tree
#'
#' @param content a character vector containing the content to include
#'   in the final document.
#' @param language language of the content 
#'
#' @details
#' A raw block is included as is into the final markdown document. This can
#' be used for example to include raw chunks of markdown.
#'
#' @return 
#' Returns a \code{list} with the correct structure for a \code{RawBlock} in 
#' the pandoc parse tree.
#'
#' @export
raw_block <- function(content, language = "markdown") {
  list(
    t = "RawBlock", 
    c = list(language, paste0(content, collapse="\n"))
  )
}