Skip to content

Commit de8ad59

Browse files
committed
Clarify using extension name not filter file
1 parent 71739c6 commit de8ad59

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

docs/extensions/filters.qmd

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ filters:
3636
---
3737
```
3838

39-
By default, user filters are run before Quarto's built-in filters. For some filters you'll want to modify this behavior. For example, here we arrange to run `spellcheck` before Quarto's filters and `lightbox` after:
39+
By default, user filters are run before Quarto's built-in filters. For some filters you'll want to modify this behavior. For example, here we arrange to run `spellcheck` before Quarto's filters and `fontawesome` after:
4040

4141
``` yaml
4242
filters:
4343
- spellcheck.lua
4444
- quarto
45-
- lightbox
45+
- fontawesome
4646
```
4747
48-
You'll notice that one of the extensions (`spellcheck.lua`) has a file extension and the other (`lightbox`) does not. This difference stems from how the extensions are distributed: an extension distributed as a plain Lua file uses `.lua` whereas a filter distributed as a [Quarto Extension](index.qmd) does not. The next section explores how to create filters as extensions.
48+
You'll notice that one of the extensions (`spellcheck.lua`) has a file extension and the other (`fontawesome`) does not. This difference stems from how the extensions are distributed: an extension distributed as a plain Lua file uses `.lua` whereas a filter distributed as a [Quarto Extension](index.qmd) does not. The next section explores how to create filters as extensions.
4949

5050

5151
## Filter Extensions
@@ -108,6 +108,17 @@ filters:
108108
This filter adds formatting to heading text.
109109
```
110110

111+
Note that the value provided to `filters` in `example.qmd` should be the name of the extension (`fancy-header`), not the filename of the filter (`fancy-header.lua`). This allows you to bundle more than one filter in your extension:
112+
113+
``` {.yaml filename="_extensions/fancy-header/_extension.yml"}
114+
contributes:
115+
filters:
116+
- fancy-header.lua
117+
- make-fancier.lua
118+
```
119+
120+
All of filters in your extension will be applied when a user uses your extension in their document.
121+
111122
To develop your filter, render/preview `example.qmd`, and then make changes to `fancy-header.lua` (the preview will automatically refresh when you change `fancy-header.lua`).
112123

113124
### Development
@@ -126,7 +137,7 @@ To create a new filter extension, use the `quarto create extension filter` comma
126137

127138
### Distribution
128139

129-
if your extension source code it located within a GitHub repository, then it can be added to a project by referencing the GitHub organization and repository name. For example:
140+
If your extension source code is located within a GitHub repository, then it can be added to a project by referencing the GitHub organization and repository name. For example:
130141

131142
``` {.bash filename="Terminal"}
132143
# target the current HEAD of the extension

0 commit comments

Comments
 (0)