Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## Unreleased

### Bug Fixes

- fix: Register the filter at `pre-quarto` in the extension manifest, so listing `lua-env` under `filters` is enough. The shortcode reads metadata the filter publishes, and a filter left at the default entry point published it after Quarto had expanded the shortcodes, so every `{{< lua-env >}}` rendered as nothing unless the entry point was named by hand.
- fix: Raise `quarto-required` to `>=1.9.38`, the first version whose `_extension.yml` schema accepts a filter entry point.

## 1.5.1 (2026-08-01)

### Documentation
Expand Down
5 changes: 3 additions & 2 deletions _extensions/lua-env/_extension.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
title: Lua Environment
author: Mickaël Canouil
version: 1.5.1
quarto-required: ">=1.4.459"
quarto-required: ">=1.9.38"
contributes:
shortcodes:
- lua-env-shortcode.lua
filters:
- lua-env-filter.lua
- path: lua-env-filter.lua
at: pre-quarto
3 changes: 1 addition & 2 deletions docs/examples.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ The filter is enabled in this site's `_quarto.yml`:

```yaml
filters:
- path: lua-env
at: pre-quarto
- lua-env
```

## Pandoc
Expand Down
3 changes: 1 addition & 2 deletions docs/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ The filter has to be enabled before the shortcode has anything to read:

```yaml
filters:
- path: lua-env
at: pre-quarto
- lua-env
```

Then name a value by its dot-separated path:
Expand Down
17 changes: 2 additions & 15 deletions docs/reference.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,11 @@ The shortcode reads metadata the filter collects, so the filter has to run first

```yaml
filters:
- path: lua-env
at: pre-quarto
```

::: {.callout-caution}
`at: pre-quarto`, not `at: post-quarto`.
Quarto expands shortcodes during its own pass, so a filter placed after that pass publishes the metadata too late.
Every `{{{< lua-env >}}}` then warns that no `lua-env` metadata was found and renders nothing, while the document itself builds as though nothing were wrong.
:::

Ordering the filter by hand has the same effect, and is what a project already listing `quarto` among its filters will be doing:

```yaml
filters:
- quarto
- lua-env
```

The extension registers the filter at `pre-quarto`, before Quarto expands shortcodes, so the entry point never has to be named here.

## Shortcode

```markdown
Expand Down
5 changes: 1 addition & 4 deletions example.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ format:
html:
toc: true
filters:
# pre-quarto, not post-quarto: Quarto expands shortcodes during its own pass,
# so a filter placed after it publishes the metadata too late.
- path: lua-env
at: pre-quarto
- lua-env
extensions:
lua-env:
json: false
Expand Down