Examples for 'knitr::vignette_engines'


Package vignette engines

Aliases: vignette_engines

Keywords:

### ** Examples

library(knitr)
vig_list = tools::vignetteEngine(package = "knitr")
str(vig_list)
List of 8
 $ knitr::rmarkdown             :List of 6
  ..$ name   : chr "rmarkdown"
  ..$ package: chr "knitr"
  ..$ pattern: chr "[.][Rr](md|markdown)$"
  ..$ weave  :function (...)  
  ..$ tangle :function (file, ..., encoding = "UTF-8", quiet = FALSE)  
  ..$ aspell :List of 1
  .. ..$ filter:function (ifile, encoding = "UTF-8")  
 $ knitr::docco_classic_notangle:List of 6
  ..$ name   : chr "docco_classic_notangle"
  ..$ package: chr "knitr"
  ..$ pattern: chr "[.][Rr]mk?d$"
  ..$ weave  :function (file, driver, syntax, encoding = "UTF-8", quiet = FALSE, ...)  
  ..$ tangle :function (file, ...)  
  ..$ aspell :List of 1
  .. ..$ filter:function (ifile, encoding = "UTF-8")  
 $ knitr::docco_linear_notangle :List of 6
  ..$ name   : chr "docco_linear_notangle"
  ..$ package: chr "knitr"
  ..$ pattern: chr "[.][Rr](md|markdown)$"
  ..$ weave  :function (file, driver, syntax, encoding = "UTF-8", quiet = FALSE, ...)  
  ..$ tangle :function (file, ...)  
  ..$ aspell :List of 1
  .. ..$ filter:function (ifile, encoding = "UTF-8")  
 $ knitr::knitr                 :List of 6
  ..$ name   : chr "knitr"
  ..$ package: chr "knitr"
  ..$ pattern: chr "[.]([rRsS](nw|tex)|[Rr](md|html|rst))$"
  ..$ weave  :function (file, driver, syntax, encoding = "UTF-8", quiet = FALSE, ...)  
  ..$ tangle :function (file, ..., encoding = "UTF-8", quiet = FALSE)  
  ..$ aspell :List of 1
  .. ..$ filter:function (ifile, encoding = "UTF-8")  
 $ knitr::docco_classic         :List of 6
  ..$ name   : chr "docco_classic"
  ..$ package: chr "knitr"
  ..$ pattern: chr "[.][Rr]mk?d$"
  ..$ weave  :function (file, driver, syntax, encoding = "UTF-8", quiet = FALSE, ...)  
  ..$ tangle :function (file, ..., encoding = "UTF-8", quiet = FALSE)  
  ..$ aspell :List of 1
  .. ..$ filter:function (ifile, encoding = "UTF-8")  
 $ knitr::rmarkdown_notangle    :List of 6
  ..$ name   : chr "rmarkdown_notangle"
  ..$ package: chr "knitr"
  ..$ pattern: chr "[.][Rr](md|markdown)$"
  ..$ weave  :function (...)  
  ..$ tangle :function (file, ...)  
  ..$ aspell :List of 1
  .. ..$ filter:function (ifile, encoding = "UTF-8")  
 $ knitr::knitr_notangle        :List of 6
  ..$ name   : chr "knitr_notangle"
  ..$ package: chr "knitr"
  ..$ pattern: chr "[.]([rRsS](nw|tex)|[Rr](md|html|rst))$"
  ..$ weave  :function (file, driver, syntax, encoding = "UTF-8", quiet = FALSE, ...)  
  ..$ tangle :function (file, ...)  
  ..$ aspell :List of 1
  .. ..$ filter:function (ifile, encoding = "UTF-8")  
 $ knitr::docco_linear          :List of 6
  ..$ name   : chr "docco_linear"
  ..$ package: chr "knitr"
  ..$ pattern: chr "[.][Rr](md|markdown)$"
  ..$ weave  :function (file, driver, syntax, encoding = "UTF-8", quiet = FALSE, ...)  
  ..$ tangle :function (file, ..., encoding = "UTF-8", quiet = FALSE)  
  ..$ aspell :List of 1
  .. ..$ filter:function (ifile, encoding = "UTF-8")  
vig_list[["knitr::knitr"]][c("weave", "tangle")]
$weave
function (file, driver, syntax, encoding = "UTF-8", quiet = FALSE, 
    ...) 
{
    {
        on.exit({
            opts_chunk$restore()
            knit_hooks$restore()
        }, add = TRUE)
        oopts = options(knitr.knit2html.force_v1 = TRUE)
        on.exit(options(oopts), add = TRUE)
    }
    opts_chunk$set(error = FALSE)
    knit_hooks$set(purl = function(...) {
        hook_purl(...)
        for (i in c("optipng", "pngquant")) if (!is.function(knit_hooks$get(i)) && 
            Sys.which(i) != "") {
            switch(i, optipng = hook_optipng(...), pngquant = hook_pngquant(...))
        }
    })
    (if (grepl("\\.[Rr]md$", file)) 
        knit2html
    else if (grepl("\\.[Rr]rst$", file)) 
        knit2pandoc
    else knit)(file, encoding = encoding, quiet = quiet, envir = globalenv(), 
        ...)
}
<bytecode: 0x55ccfd911db0>
<environment: namespace:knitr>

$tangle
function (file, ..., encoding = "UTF-8", quiet = FALSE) 
{
    purl(file, encoding = encoding, quiet = quiet, ...)
}
<bytecode: 0x55ccfd917508>
<environment: namespace:knitr>
vig_list[["knitr::knitr_notangle"]][c("weave", "tangle")]
$weave
function (file, driver, syntax, encoding = "UTF-8", quiet = FALSE, 
    ...) 
{
    {
        on.exit({
            opts_chunk$restore()
            knit_hooks$restore()
        }, add = TRUE)
        oopts = options(knitr.knit2html.force_v1 = TRUE)
        on.exit(options(oopts), add = TRUE)
    }
    opts_chunk$set(error = FALSE)
    {
    }
    (if (grepl("\\.[Rr]md$", file)) 
        knit2html
    else if (grepl("\\.[Rr]rst$", file)) 
        knit2pandoc
    else knit)(file, encoding = encoding, quiet = quiet, envir = globalenv(), 
        ...)
}
<environment: namespace:knitr>

$tangle
function (file, ...) 
{
    unlink(with_ext(file, "R"))
    return()
}
<bytecode: 0x55ccfd949d70>
<environment: namespace:knitr>
vig_list[["knitr::docco_classic"]][c("weave", "tangle")]
$weave
function (file, driver, syntax, encoding = "UTF-8", quiet = FALSE, 
    ...) 
{
    {
        on.exit({
            opts_chunk$restore()
            knit_hooks$restore()
        }, add = TRUE)
        oopts = options(knitr.knit2html.force_v1 = TRUE)
        on.exit(options(oopts), add = TRUE)
    }
    opts_chunk$set(error = FALSE)
    knit_hooks$set(purl = function(...) {
        hook_purl(...)
        for (i in c("optipng", "pngquant")) if (!is.function(knit_hooks$get(i)) && 
            Sys.which(i) != "") {
            switch(i, optipng = hook_optipng(...), pngquant = hook_pngquant(...))
        }
    })
    rocco(file, encoding = encoding, quiet = quiet, envir = globalenv(), 
        ...)
}
<bytecode: 0x55ccfd9314a8>
<environment: namespace:knitr>

$tangle
function (file, ..., encoding = "UTF-8", quiet = FALSE) 
{
    purl(file, encoding = encoding, quiet = quiet, ...)
}
<bytecode: 0x55ccfd917508>
<environment: namespace:knitr>

[Package knitr version 1.49 Index]