View source: R/create_toc_entries.R
create_toc_entries | R Documentation |
Given a html file, parse throught the file looking for h3 html nodes. Each node is formatted using format_toc_entry() and returned as a character vector.
create_toc_entries( html_file, node_type = "h1, h3", padding_map = c(h1 = "0em", h3 = "2em"), include_page_name = TRUE )
html_file |
a html file |
node_type |
character string defaults to "h3" |
padding_map |
a named character vector used to map node types to padding strings for the table of contents entry |
include_page_name |
a logical if true, the table of contents begins with a link to the page as the first entry. |
The function create_toc_entries expects a flexdashboard with H3 headers (### in rmarkdown). In addtion, the header should be followed by a tag identical to the heading but without white space e.g., #HeaderasisWithoutSpaces. The function is used for the side-effect of directly printing table of contents entries.
Use node_type = "h3" to find rmarkdown ### headers or node_type = "h1" to find rmarkdown page headers. node_type = "h2" refers to column or row oobjects in a flexdashboard.
create_toc_entries(system.file("extdata", "curios-test-flexdashboard.html", package = "curios")) create_toc_entries(system.file("extdata", "curios-test-flexdashboard.html", package = "curios"), node_type = "h3")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.