Skip to content
TopicTracker
From HackerNewsView original
TranslationTranslation

Pandoc Lua Filters

Pandoc Lua Filters allow users to write custom transformations for documents processed by Pandoc, using the Lua scripting language to manipulate the document's abstract syntax tree during conversion between formats.

Background

Pandoc is a free, open-source "swiss-army knife" document converter: it can translate files between dozens of formats (Markdown, HTML, LaTeX, Word, EPUB, etc.) while preserving structure. A "Lua filter" is a script written in the lightweight Lua programming language that users can inject into Pandoc's conversion pipeline to programmatically modify the document — e.g., auto-number headings, replace certain text, add custom metadata, or change how images are rendered. The official guide at pandoc.org/lua-filters.html is the primary reference for writing these filters. Lua itself is a fast, embeddable scripting language originally from Brazil, widely used in game engines (e.g., World of Warcraft) and configurable tools because it is easy to integrate. This matters for technical writers, academics, and publishers who use Pandoc as part of automated book-production or note-taking workflows and need to customize output beyond what Pandoc's built-in options allow.

Related stories