EVOLUTION-MANAGER
Edit File: markdownExtensions.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: Markdown extensions</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 markdownExtensions {markdown}"><tr><td>markdownExtensions {markdown}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Markdown extensions</h2> <h3>Description</h3> <p><code>markdownExtensions</code> returns a character vector listing all the extensions that are available in the <span class="pkg">markdown</span> package. </p> <h3>Usage</h3> <pre> markdownExtensions() </pre> <h3>Details</h3> <p>They are all ON by default. </p> <p>The <span class="pkg">Sundown</span> library (upon which <span class="pkg">markdown</span> is built) has optional support for several extensions described below. To turn these on globally in the <span class="pkg">markdown</span> package, simply place some or all of them in a character vector and assign to the global option <code>markdown.extensions</code> like so: </p> <p><code>options(markdown.extensions = markdownExtensions())</code> </p> <p>To override the global option, pass the <code>extensions</code> as an argument to one of the render functions, e.g.: </p> <p><code>markdownToHTML(..., extensions = c('no_intra_emphasis'))</code> </p> <p>Description of all extensions: </p> <dl> <dt><code>'no_intra_emphasis'</code></dt><dd><p> skip markdown embedded in words. </p> </dd> <dt><code>'tables'</code></dt><dd><p> create HTML tables (see Examples). </p> </dd> <dt><code>'fenced_code'</code></dt><dd><p> treat text as verbatim when surrounded with begin and ending lines with three ~ or <em>'</em> characters. </p> </dd> <dt><code>'autolink'</code></dt><dd><p> create HTML links from urls and email addresses. </p> </dd> <dt><code>'strikethrough'</code></dt><dd><p> create strikethroughs by surrounding text with ~~. </p> </dd> <dt><code>'lax_spacing'</code></dt><dd><p> allow HTML tags inside paragraphs without being surrounded by newlines. </p> </dd> <dt><code>'space_headers'</code></dt><dd><p> add a space between header hashes and the header itself. </p> </dd> <dt><code>'superscript'</code></dt><dd><p> translate ^ and subsequent text into HTML superscript. </p> </dd> <dt><code>'latex_math'</code></dt><dd><p> transforms all math equations into syntactically correct MathJax equations. </p> </dd> </dl> <p>See the EXAMPLES section to see the output of each extension turned on or off. </p> <h3>Value</h3> <p>A <code>character</code> vector listing all available extensions. </p> <h3>See Also</h3> <p><a href="markdownHTMLOptions.html">markdownHTMLOptions</a> </p> <h3>Examples</h3> <pre> # List all available extensions: markdownExtensions() # To turn on all markdown extensions globally: options(markdown.extensions = markdownExtensions()) # To turn off all markdown extensions globally: options(markdown.extensions = NULL) # The following examples are short, so we set the HTML option 'fragment_only' options(markdown.HTML.options = "fragment_only") # no_intra_emphasis example cat(markdownToHTML(text = "foo_bar_function", extensions = c())) cat(markdownToHTML(text = "foo_bar_function", extensions = c("no_intra_emphasis"))) # tables example (need 4 spaces at beginning of line here) cat(markdownToHTML(text = " First Header | Second Header ------------- | ------------- Content Cell | Content Cell Content Cell | Content Cell ", extensions = c())) # but not here cat(markdownToHTML(text = " First Header | Second Header ------------- | ------------- Content Cell | Content Cell Content Cell | Content Cell ", extensions = c("tables"))) # fenced_code example (need at least three leading ~ or `) fenced_block <- function(text, x = "`", n = 3) { fence <- paste(rep(x, n), collapse = "") paste(fence, text, fence, sep = "") } cat(markdownToHTML(text = fenced_block(" preformatted text here without having to indent first line. "), extensions = c())) cat(markdownToHTML(text = fenced_block(" preformatted text here without having to indent first line. "), extensions = c("fenced_code"))) # autolink example cat(markdownToHTML(text = "https://www.r-project.org/", extensions = c())) cat(markdownToHTML(text = "https://www.r-project.org/", extensions = c("autolink"))) # strikethrough example cat(markdownToHTML(text = "~~awesome~~", extensions = c())) cat(markdownToHTML(text = "~~awesome~~", extensions = c("strikethrough"))) # lax_spacing cat(markdownToHTML(text = " Embedding html without surrounding with empty newline. <div>_markdown_</div> extra text. ", extensions = c(""))) cat(markdownToHTML(text = " Embedding html without surrounding with empty newline. <div>_markdown_</div> extra text. ", extensions = c("lax_spacing"))) # space_headers example cat(markdownToHTML(text = "#A Header\neven though there is no space between # and A", extensions = c(""))) cat(markdownToHTML(text = "#Not A Header\nbecause there is no space between # and N", extensions = c("space_headers"))) # superscript example cat(markdownToHTML(text = "2^10", extensions = c())) cat(markdownToHTML(text = "2^10", extensions = c("superscript"))) </pre> <hr /><div style="text-align: center;">[Package <em>markdown</em> version 1.1 <a href="00Index.html">Index</a>]</div> </body></html>