Skip to contents

Write a term and definition to an existing glossary file.

Usage

glossary_add(term, def, path = glossary_path(), replace = FALSE)

Arguments

term

The term to define

def

The definition to add

path

the path to the glossary file; set default with glossary_path

replace

Whether to replace an existing definition

Value

NULL; Called for side effects

Examples

# make a new glossary file
path <- tempfile("glossary", fileext = ".yml")
glossary_path(path, create = TRUE)
#> /tmp/Rtmp8PhESv/glossary1826196b8571.yml did not exist; it has been created

# add an entry for "joins"
glossary_add("joins", "Ways to combine data from two tables")

# now you can access the definition
glossary("joins")
#> [1] "<a class='glossary'>joins<span class='def'>Ways to combine data from two tables</span></a>"