Skip to contents

This is a community fork of glossary, an excellent R package by Lisa DeBruine for adding interactive glossaries to Markdown and Quarto documents.

About This Fork

Building on Lisa DeBruine’s original design, this fork includes:

  • Bug fixes: Exact case-insensitive term matching (fixes substring-matching issues where “API” could incorrectly match “Capital income”)
  • Enhanced robustness: Improved term lookup and edge case handling

Attribution & License: This work builds on DeBruine’s original package, licensed under CC BY 4.0. DeBruine remains credited as the original author in all distributions. See FORK_NOTES for details on what’s changed.

What is glossary?

There is a lot of necessary jargon to learn for coding. The goal of glossary is to provide a lightweight solution for making glossaries in educational materials written in quarto or R Markdown. This package provides functions to link terms in text to their definitions in an external glossary file, as well as create a glossary table of all linked terms at the end of a section.

Installation

You can install glossary2 from GitHub with:

# install.packages("devtools")
devtools::install_github("petzi53/glossary2")

Example

Click on the terms to see a popup definition:

library(glossary2) 
glossary_path("inst/glossary.yml")
glossary_style("purple", "underline")

# Link terms to their definitions
glossary("power")
glossary("effect size")
glossary("SESOI")
glossary("alpha")

# Display a table of all linked terms
glossary_table()

For a live interactive example, see the package vignette.

Third-Party Glossaries

You can load glossaries from external GitHub repositories. For example, to load Peter Baumgartner’s personal glossary:

library(glossary2)
glossary_load_all("https://raw.githubusercontent.com/petzi53/glossary-pb/main/glossary.yml")
glossary_style("blue", "underline")

See glossary-pb for more details.

More Information

See the vignette("glossary"), the full documentation site, or FORK_NOTES.md for more details.