Embedding a shared filter in a custom format filter #13469
-
DescriptionI'm trying to create some new custom formats, which all use some shared lua filters. I've worked out how to create the filter extension, but I cannot get the --embed command to work. I tested it by starting with this structure: (I also tried the same as below but via quarto create extension, which makes everything two directories deeper) Where I manually created the filter-a, format-b and format-c folders.
The only way I can get it to embed is to first remove mention of filter-a inside format-b, then embed filter-a inside format-b (which adds a further nested _extension folder deep inside format-b). Then later I did add format-b to test-proj but the filter-a isn't getting picked up. Does anyone has an actual example of a filter embedded inside a format they can point me too perhaps? I'm in Quarto 1.8.24 in Fedora 42. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
What's the goal of the embedded filter? Is it supposed to be used by end-users? Is it only used internally by your format extension? Note that without a concrete "working" example, it's hard to provide accurate help. |
Beta Was this translation helpful? Give feedback.
Thanks, yep I got it working now. In case someone comes across this post in the future:
Lesson 1
The custom format (
format-c
in my case) definition in_extension.yml
needs to compile properly before we try to embed the sub-filter. So first embed the filter withquarto add path/to/filter/ --embed format-c
and only then addfilters:
code into_extensions.yml
for format-c. i.e. don't get ahead of yourselfLesson 2
The custom format yml should say:
Note
html
notformat-c
orformat-c-html
.