Skip to content

feat(quarto): add quarto-lua skill for Lua shortcodes and filters#39

Open
mcanouil wants to merge 18 commits intoposit-dev:mainfrom
mcanouil:feat/quarto-lua
Open

feat(quarto): add quarto-lua skill for Lua shortcodes and filters#39
mcanouil wants to merge 18 commits intoposit-dev:mainfrom
mcanouil:feat/quarto-lua

Conversation

@mcanouil
Copy link
Copy Markdown
Contributor

@mcanouil mcanouil commented Mar 9, 2026

Add a new quarto-lua skill for writing Lua shortcodes and filters in Quarto.

The skill provides inline patterns for shortcode handlers and AST filters, Lua coding conventions (naming, indentation, scoping, error handling), Quarto-specific APIs (is_format, add_html_dependency, include_text, quarto.log.output), and a decision tree that delegates to Quarto's .llms.md pages for detailed API reference.

A references/custom-ast-nodes.md file documents Quarto's custom AST node types (Callout, ConditionalBlock, Tabset, FloatRefTarget, etc.), constructor signatures, and filter timing phases.

Evaluation

File Lines ~Tokens
SKILL.md 181 1,536
references/custom-ast-nodes.md 84 708
Total 265 2,244
Description - 42

mcanouil added 2 commits March 9, 2026 21:24
Add a new skill for writing Lua shortcodes and filters in Quarto.
Covers handler patterns, Lua style conventions, Quarto-specific APIs,
and delegates to Quarto's .llms.md pages for detailed API reference.
@mcanouil

This comment was marked as resolved.

@mcanouil mcanouil marked this pull request as draft March 9, 2026 22:13
Include details on custom AST nodes and filter timing in the documentation. This enhances the understanding of Quarto's capabilities for users working with Lua shortcodes and filters.
@mcanouil mcanouil marked this pull request as ready for review March 9, 2026 22:19
@mcanouil mcanouil marked this pull request as draft March 9, 2026 22:40
@mcanouil mcanouil marked this pull request as ready for review March 23, 2026 23:27
@mcanouil
Copy link
Copy Markdown
Contributor Author

First version of this lua skill for Quarto ready with Quarto CLI v1.9.36 now released.

Comment thread quarto/quarto-lua/SKILL.md Outdated
Comment thread quarto/quarto-lua/SKILL.md Outdated
Comment thread quarto/quarto-lua/SKILL.md Outdated
Clarified registration instructions for shortcodes and filters in YAML.
Copy link
Copy Markdown

@cderv cderv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this addition !

Something that makes me wonder: Lua filter can be used without Quarto Extensions. Shortcodes can't. Is this skill made for Lua inside quarto extension ? Or just any Quarto Lua writing ?

I wonder if the skill should be more clear on this to help Claude know when this is in Extensions context or just Lua filter context. 🤷‍♂️

Also, this is a good opportunity to better document the Lua API so I'll add something in the doc with all the feature. (like quarto.format endpoint).

Comment thread quarto/quarto-lua/SKILL.md Outdated
Comment thread quarto/quarto-lua/SKILL.md Outdated
Comment thread quarto/quarto-lua/SKILL.md
Comment thread quarto/README.md Outdated
@mcanouil
Copy link
Copy Markdown
Contributor Author

mcanouil commented Apr 1, 2026

@cderv "Something that makes me wonder: Lua filter can be used without Quarto Extensions. Shortcodes can't. "

This is not true.
They 100% can.

screenshot showing definition and usage of shortcode without Quarto extension, as a plain YAML inline setting

@cderv
Copy link
Copy Markdown

cderv commented Apr 1, 2026

Oh cool ! I thought they couldn't !

I guess I forgot this shortcodes configuration can also work in single documents !! Awesome !

@mcanouil
Copy link
Copy Markdown
Contributor Author

mcanouil commented Apr 1, 2026

I believe most if not all users don't know about this because that's not documented.
Discovered this few years ago when "shortcodes" was autocompleted in my header, then I tried it and it worked🤯
Edit: it's "documented"-ish in the schema thus in reference pages obviously

@cderv
Copy link
Copy Markdown

cderv commented Apr 1, 2026

Possibly not documented because not expected initially but side effect 🤷‍♂️

it seems useful to avoid setting a full extension to add shortcode explicitly to a single project without intent of sharing

@mcanouil
Copy link
Copy Markdown
Contributor Author

mcanouil commented Apr 1, 2026

it seems useful to avoid setting a full extension to add shortcode explicitly to a single project without intent of sharing

and quick development/debugging ;) (that's how I use it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants