Can a Quarto Custom Format have a filter embedded within it? #6791
-
DescriptionI am just trying to wrap my head around using extensions and the purpose of embedding extensions. I have a format that I would like to use pretty consistently. I know that I could also make a custom filter, but I do not know if these must be set in the qmd's document's yml header or if I have a filter embedded in another format and the document's header automatically uses the default of the custom format if the filter will be used. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 7 replies
-
A custom format can specify a set of default filters, yes. You list them under Does that help? |
Beta Was this translation helpful? Give feedback.
-
Okay, these were the resources I was viewing before and became confused about what "common metadata" meant. My embedded filter did not work until I removed the --- EDIT (clarity) --- |
Beta Was this translation helpful? Give feedback.
-
This may be worth its own issue, but it is related to my last comment. I'm finding that contrary to this documentation on filter execution order, it doesn't seem that extension filters are run after quarto's default filters. For more context, I have a simple filter in development under jtlandis/auto-eq. So far all it does is print the Para elements of the document to the console. What I am seeing is that when this filter extension is available, a yml header like the following ---
filters:
- auto-eq
---
$$
1 + 1 = 2
$$ is equivalent to ---
filters:
- auto-eq
- quarto
---
$$
1 + 1 = 2
$$ which is different from ---
filters:
- quarto
- auto-eq
---
$$
1 + 1 = 2
$$ when comparing between the logging outputs. |
Beta Was this translation helpful? Give feedback.
-
Seeing that #6759 is the actual tracking issue for declaring when embedded filters are run and the documentation is consistent, I will go ahead and close this discussion. Thank you @cscheid, @multimeric @cderv and @mcanouil for all your contributions! |
Beta Was this translation helpful? Give feedback.
A custom format can specify a set of default filters, yes. You list them under
contributes.format.X.filters
. There is an example of this here in the documentation: https://quarto.org/docs/extensions/formats.html#common-metadata.Does that help?