You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/extensions/filters.qmd
+15-4Lines changed: 15 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -36,16 +36,16 @@ filters:
36
36
---
37
37
```
38
38
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:
40
40
41
41
```yaml
42
42
filters:
43
43
- spellcheck.lua
44
44
- quarto
45
-
- lightbox
45
+
- fontawesome
46
46
```
47
47
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.
49
49
50
50
51
51
## Filter Extensions
@@ -108,6 +108,17 @@ filters:
108
108
This filter adds formatting to heading text.
109
109
```
110
110
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:
All of filters in your extension will be applied when a user uses your extension in their document.
121
+
111
122
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`).
112
123
113
124
### Development
@@ -126,7 +137,7 @@ To create a new filter extension, use the `quarto create extension filter` comma
126
137
127
138
### Distribution
128
139
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:
0 commit comments