Skip to contents

This is a bookmark function: it's meant to be called in a bookmark.

Usage

bm_fn_collapse_to_ul(
  x,
  id,
  idRegex,
  keyRegex,
  entireBook = FALSE,
  divClass = "bm-ul-list",
  prefix = "",
  suffix = ""
)

Arguments

x, id

These are two default arguments that all {bookmark} functions must have. As x, an object is passed with class "bm_prepared_book", containing the bookmarked data and each chapter's contents, as with the dependency trees of each chapter in the book stored in a names list as attribute dependencyTrees (each list element is a dependency tree, and the tree's name is the identifier of the corresponding chapter). As id, the identifier of the current chapter (i.e. where the {bookmark} function is encountered) is passed (a function can choose to ignore this).

idRegex

A regular expression to match to chapter identifiers; only chapter identifiers matching this regular expression are processed.

keyRegex

A regular expression to match to keys; only keys matching this regular expression are processed.

entireBook

Whether to process the entire book

divClass

The class to pass to the <div> element containing the result.

prefix, suffix

The prefix and suffix to insert before and after the result (but within the containing <div>).

Value

A character vector with the result.