knitr-asis_output

Here are the examples of the r api knitr-asis_output taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

7 Examples 7

19 File: HTMLElement.R, author: coolbutuseless, license: MIT License

 knit_print.HTMLElement  < - function(x, ...) { 

     string  < - as.character(x, include_declaration = FALSE) 

     string  < - gsub("\\s+", " ", string) 

     knitr::asis_output(string) 

 } 

19 File: SVGDocument.R, author: coolbutuseless, license: MIT License

 knit_print.SVGDocument  < - function(x, ...) { 

     string  < - as.character(x, include_declaration = FALSE) 

     string  < - gsub("\\s+", " ", string) 

     knitr::asis_output(string) 

 } 

19 File: SVGFilter.R, author: coolbutuseless, license: MIT License

 knit_print.SVGFilter  < - function(x, ...) { 

     full_svg  < - x$as_full_svg(...) 

     string  < - as.character(full_svg, include_declaration = FALSE) 

     string  < - gsub("\\s+", " ", string) 

     knitr::asis_output(string) 

 } 

19 File: SVGPattern.R, author: coolbutuseless, license: MIT License

 knit_print.SVGPattern  < - function(x, ...) { 

     full_svg  < - x$as_full_svg(...) 

     string  < - as.character(full_svg, include_declaration = FALSE) 

     string  < - gsub("\\s+", " ", string) 

     knitr::asis_output(string) 

 } 

19 File: note_in_md_pdf.R, author: jienagu, license: MIT License

 note_in_md_pdf = function(input) { 

     rmarkdown:::find_pandoc() 

     f1 = tempfile() 

     f2 = tempfile() 

     writeLines(input, f1) 

     rmarkdown::pandoc_convert(f1, to = "latex", from = "markdown",  

         output = f2) 

     return(knitr::asis_output(readLines(f2, encoding = "UTF-8"))) 

 } 

19 File: note_in_md_word.R, author: jienagu, license: MIT License

 note_in_md_word = function(input) { 

     f1 = tempfile() 

     writeLines(input, f1) 

     return(knitr::asis_output(readLines(f1, encoding = "UTF-8"))) 

 } 

 knit_print.psItemContentText  < - function(x, inline = FALSE, ...) { 

     res  < - imap_chr(.x = x, .f = function(wording, handle) { 

         if (is.integer(handle)) { 

             handle  < - NULL 

         } 

         if (inline) { 

             glue_collapse(x = c(glue("`{handle}`"), glue("^['{wording}']"))) 

         } 

         else { 

             glue_collapse(x = c(glue("`{handle}`", ":    "),  

                 glue("> {wording}\n\n\n                 ")),  

                 sep = "\n \n") 

         } 

     }) 

     knitr::asis_output(res) 

 } 

Categories r Tags