EVOLUTION-MANAGER
Edit File: knit2html.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Convert markdown to HTML using knit() and markdownToHTML()</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for knit2html {knitr}"><tr><td>knit2html {knitr}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Convert markdown to HTML using knit() and markdownToHTML()</h2> <h3>Description</h3> <p>This is a convenience function to knit the input markdown source and call <code>markdown::<a href="../../markdown/html/markdownToHTML.html">markdownToHTML</a>()</code> in the <span class="pkg">markdown</span> package to convert the result to HTML. </p> <h3>Usage</h3> <pre> knit2html( input, output = NULL, ..., envir = parent.frame(), text = NULL, quiet = FALSE, encoding = "UTF-8", force_v1 = FALSE ) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>input</code></td> <td> <p>Path to the input file.</p> </td></tr> <tr valign="top"><td><code>output</code></td> <td> <p>Path to the output file for <code>knit()</code>. If <code>NULL</code>, this function will try to guess a default, which will be under the current working directory.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Options passed to <code>markdown::<a href="../../markdown/html/markdownToHTML.html">markdownToHTML</a>()</code>.</p> </td></tr> <tr valign="top"><td><code>envir</code></td> <td> <p>Environment in which code chunks are to be evaluated, for example, <code><a href="../../base/html/sys.parent.html">parent.frame</a>()</code>, <code><a href="../../base/html/environment.html">new.env</a>()</code>, or <code><a href="../../base/html/environment.html">globalenv</a>()</code>).</p> </td></tr> <tr valign="top"><td><code>text</code></td> <td> <p>A character vector. This is an alternative way to provide the input file.</p> </td></tr> <tr valign="top"><td><code>quiet</code></td> <td> <p>Boolean; suppress the progress bar and messages?</p> </td></tr> <tr valign="top"><td><code>encoding</code></td> <td> <p>Encoding of the input file; always assumed to be UTF-8 (i.e., this argument is effectively ignored).</p> </td></tr> <tr valign="top"><td><code>force_v1</code></td> <td> <p>Boolean; whether to force rendering the input document as an R Markdown v1 document, even if it is for v2.</p> </td></tr> </table> <h3>Value</h3> <p>If the argument <code>text</code> is NULL, a character string (HTML code) is returned; otherwise the result is written into a file and the filename is returned. </p> <h3>Note</h3> <p>The <span class="pkg">markdown</span> package is for R Markdown v1, which is much less powerful than R Markdown v2, i.e. the <span class="pkg">rmarkdown</span> package (<a href="https://rmarkdown.rstudio.com">https://rmarkdown.rstudio.com</a>). To render R Markdown v2 documents to HTML, please use <code>rmarkdown::render()</code> instead. </p> <h3>See Also</h3> <p><code><a href="knit.html">knit</a></code>, <code>markdown::<a href="../../markdown/html/markdownToHTML.html">markdownToHTML</a></code> </p> <h3>Examples</h3> <pre> # a minimal example writeLines(c("# hello markdown", "```{r hello-random, echo=TRUE}", "rnorm(5)", "```"), "test.Rmd") knit2html("test.Rmd") if (interactive()) browseURL("test.html") unlink(c("test.Rmd", "test.html", "test.md")) </pre> <hr /><div style="text-align: center;">[Package <em>knitr</em> version 1.29 <a href="00Index.html">Index</a>]</div> </body></html>