Skip to content

About

Shared Lua modules for Quarto extensions.

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Latest commit

 

History

68 Commits

Folders and files

Repository files navigation

Quarto Lua Modules

Shared Lua modules for Quarto extensions: colour conversion, string escaping, metadata access, path resolution, schema checks, and values that Quarto 1 and Quarto 2 expose differently.

Quarto has no package manager for Lua. An extension therefore copies the modules it uses into its own repository, and commits them. The modules are not loaded from this repository at render time.

Full documentation is at https://m.canouil.dev/quarto-lua-modules/:

  • Reference for every module and function.
  • Vendoring for how to copy the modules in, declare them in _dependencies.yml, and update them, by hand or with scripts/vendor.sh from the release.
  • Examples for short working snippets.

Quick start

Copy string.lua into _vendor/quarto-lua-modules/ in 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;.

Development

The modules run inside Quarto's Lua, and several of them call pandoc.*, so the tests run there too:

quarto pandoc lua tests/run.lua

Licence

MIT.

About

Shared Lua modules for Quarto extensions.

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Contributors

Languages