Allow extensions to have configuration #11730
multimeric
started this conversation in
Feature Requests
Replies: 1 comment 4 replies
-
You can already define "configuration" and it's completely up to the extension developer. Note that extensions don't necessarily use specific/new keys but can use the default ones ( What's the issue with having the extension YAML keys alongside Quarto ones? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Currently extensions are either enabled or disabled. For example, a filter extension is either in the filter list, or it's not. However, extensions often provide behaviour that user will want to configure in detail. Shortcodes are a bit better because they have a arguments that can be used to configure them, but ideally these arguments could be put in one central place for the whole project to avoid repetition.
I think a nice solution to this would be to extend the Quarto YAML format. I propose that items in the
filters
list can optionally become a one-item map whose key must be the extension name and whose value must also be a map. This is a common YAML pattern:Then, I think the lua API should gain another function that returns the extension's config. This would allow extensions like filters to easily use this information:
As a bonus extra, it would be cool if we could provide a schema to validate the configuration before even running the filter, but this is non-essential. e.g. in the
_extension.yml
:Beta Was this translation helpful? Give feedback.
All reactions