Add Lua filter support (pandoc.luaFilters) for admonition rendering#60
Conversation
…tting) Co-authored-by: ChrisChinchilla <42080+ChrisChinchilla@users.noreply.github.com>
|
📝 Documentation updates detected! New suggestion: Document Lua filter support for admonitions and document transformation Tip: Planning a big docs refactor? Use Deep Analysis to get help with the heavy lifting 🔍 |
…nstructed from library input Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…, function or class Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds Pandoc Lua filter support to the VS Code Pandoc extension, with the goal of enabling Docusaurus-style admonition rendering via Pandoc’s Lua filter mechanism (fixes #36).
Changes:
- Adds
pandoc.luaFiltersconfiguration and threads resulting--lua-filterargs into Pandoc invocation (native + Docker). - Introduces built-in admonition rendering via a bundled Lua filter and
pandoc.enableAdmonitions. - Updates docs and extends the test suite around Lua filter behavior.
Reviewed changes
Copilot reviewed 5 out of 8 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.json | Updates TS module resolution and adds node/mocha types. |
| src/extension.ts | Builds and appends --lua-filter arguments; adds built-in admonition filter toggle. |
| package.json | Adds new settings; updates toolchain dependencies. |
| package-lock.json | Locks updated dependency graph for toolchain version bumps. |
| README.md | Documents Lua filters and new admonition support option. |
| test/suites/extension.test.ts | Adds Lua filter/admonition-related tests. |
| filters/docusaurus-admonitions.lua | New bundled Pandoc Lua filter implementing admonition rendering. |
| dist/extension.js | Built output reflecting new extension behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
📝 Documentation updates detected! Updated existing suggestion: Add release notes for Lua filter and admonition support Tip: Adjust how proactive or focused Promptless is in Agent Settings ⚙️ |
Docusaurus-style admonitions (
::: note,:::warning, etc.) pass through Pandoc unprocessed because Pandoc has no built-in knowledge of that syntax. Pandoc's Lua filter mechanism is the correct extension point for this.Changes
package.json: Newpandoc.luaFilterssetting — array of absolute paths to Lua filter files, default[]src/extension.ts: NewgetLuaFilters()reads the setting and builds--lua-filter="<path>"args; appended to the Pandoc command (both standard and Docker modes) only when non-emptyREADME.md: New "Lua Filters" section documenting the setting with a Docusaurus admonitions exampletest/suites/extension.test.ts: NewLua Filters Testssuite — single filter, multiple filters, empty list, and render workflow integration casesUsage
Produces:
pandoc "doc.md" -o "doc.html" --lua-filter="/path/to/admonition-filter.lua"This is intentionally general — any community or custom Lua filter works, not just admonition-specific ones.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.