provision_isolation | R Documentation |
This uses xml2::xml_root()
and xml2::xml_path()
to make a copy of the
root document and then tag the corresponding nodes in the nodelist so that
we can filter on nodes that are not connected to those present in the
nodelist. This function is required for isolate_nodes()
to work.
provision_isolation(nodelist)
nodelist |
an object of class |
a list of three elements:
doc: a copy of the document with the nodes isolated depending on the context
key: a string used to tag nodes that are isolated via the tnk-key
attribute.
unrelated: an xml_nodeset
containing nodes that have no ancestor,
descendant, or self relationship to the nodes in nodelist
.
Other nodeset isolation functions:
isolate_nodes()
path <- system.file("extdata", "show-example.md", package = "tinkr")
y <- tinkr::yarn$new(path, sourcepos = TRUE)
y$protect_math()$protect_curly()
items <- xml2::xml_find_all(y$body, ".//md:item", tinkr::md_ns())
tnk <- asNamespace("tinkr")
tnk$provision_isolation(items)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.