provision_isolation {tinkr}R Documentation

Create a document and list of nodes to isolate

Description

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.

Usage

provision_isolation(nodelist)

Arguments

nodelist

an object of class xml_nodeset OR xml_node OR a list of either.

Value

a list of three elements:

See Also

Other nodeset isolation functions: isolate_nodes()

Examples


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)


[Package tinkr version 0.3.0 Index]