jgm / djot

A light markup language
https://djot.net
MIT License
1.67k stars 43 forks source link

Lua filter API #34

Closed jgm closed 1 year ago

jgm commented 2 years ago

Create a Lua filter API, like pandoc's Lua filters API.

Doing this might require changing the way we currently represent the AST in Lua. The current method is designed for speed, but uses some conventions that make it fragile for direct interaction (e.g., annotation as first component of an array). (Perhaps we could use metatables to provide a friendly public interface to the current array-based structure.)

Alternatively, we could leave the AST as it is but provide special functions for manipulating it.