rmd_node {parsermd} | R Documentation |
rmd node utility functions
Description
Functions for extracting information for Rmd nodes.
Usage
rmd_node_label(x, ...)
rmd_node_type(x, ...)
rmd_node_length(x, ...)
rmd_node_content(x, ...)
rmd_node_attr(x, attr, ...)
rmd_node_engine(x, ...)
rmd_node_options(x, ...)
rmd_node_code(x, ...)
Arguments
x |
An rmd object, e.g. |
... |
Unused, for extensibility. |
attr |
Attribute name to extract. |
Value
-
rmd_node_label()
- returns a character vector of node labels, nodes without labels returnNA
. -
rmd_node_type()
- returns a character vector of node types. -
rmd_node_length()
- returns an integer vector of node lengths (i.e. lines of code, lines of text, etc.), nodes without a length returnNA
. -
rmd_node_content()
- returns a character vector of node textual content, nodes without content returnNA
. -
rmd_node_attr()
- returns a list of node attribute values. -
rmd_node_engine()
- returns a character vector of chunk engines,NA
for all other node types. -
rmd_node_options()
- returns a list of chunk node options (named list),MULL
for all other node types. -
rmd_node_code()
- returns a list of chunk node code (character vector),NULL
for all other node types.
Examples
rmd = parse_rmd(system.file("hw01.Rmd", package="parsermd"))
rmd_node_label(rmd)
rmd_node_type(rmd)
rmd_node_content(rmd)
rmd_node_attr(rmd, "level")
rmd_node_engine(rmd)
rmd_node_options(rmd)
rmd_node_code(rmd)