Skip to contents

This function creates a glossary / definition list from all "topics" in the book. It will include everything with identifier "topic" and keys id, label, and definition, and output a Markdown definition list.

Usage

bm_fn_glossary(
  x,
  id = NULL,
  idRegex = "^topic$",
  keyRegex = ".*",
  entireBook = TRUE,
  divClass = "bm-glossary",
  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 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.