Skip to main content

Lua Modules

Shared Lua modules for Quarto extensions: string, metadata, paths, HTML, and schema checks.

Shared Lua modules for Quarto extensions. Copy the ones you need into your repository, and update them from a release.

Lua library for Quarto extensions

Lua Modules

Shared Lua modules for Quarto extensions: string, metadata, paths, HTML, and schema checks.

The Quarto mark, a quartered circle.

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 &lt;World&gt;.

Where to go next

  • Reference lists every module and function.
  • Vendoring explains how to copy, pin, and update the modules.
  • Examples shows short working snippets.
  • Changelog lists what each release changed.
Back to top