Lua Modules
Shared Lua modules for Quarto extensions: string, metadata, paths, HTML, and schema checks.
Lua library for Quarto extensions
Lua Modules
Shared Lua modules for Quarto extensions: string, metadata, paths, HTML, and schema checks.
Your filter or shortcode needs the same helpers as every other extension. It must escape text for HTML or Typst, read a setting from the metadata, resolve a path, or check a shortcode call against its schema. Each extension writes these helpers again, or copies them from another extension. These modules are tested once, and you copy the ones you use.
Installation
Quarto has no package manager for Lua. Copy the modules you need into _vendor/quarto-lua-modules/ in your extension, and commit them. The vendoring guide covers the copy, the _dependencies.yml manifest, and how to update to a new release.
Quick start
Copy string.lua into your extension, then load it from a filter:
local str = require(quarto.utils.resolve_path('_vendor/quarto-lua-modules/string.lua'):gsub('%.lua$', ''))
print(str.escape_html('Hello <World>'))The output is Hello <World>.