Best way to do a project "filter"? #9280
Unanswered
andrewpbray
asked this question in
Q&A
Replies: 1 comment 1 reply
-
I think the related (or reframed?) question I've been pondering is, "What advice do I give to users who want to use my custom format or project in conjunction with another custom format or project?" Right now it's basically, "Copy the settings from the extension definition and merge them yourself," but that's definitely asking users to pop the hood! |
Beta Was this translation helpful? Give feedback.
1 reply
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I have a custom project type that adds a bunch of functionality to university course websites. One piece of that functionality is the ability to schedule documents for publishing. I am trying to figure out the best way to pull that piece out into a more narrowly scoped extension that users can add to their website to get just the scheduled document functionality.
I've started building this as an extension where
_extension.yml
looks like:The problem is that I don't want users to have to use
project: type: scheduled_docs
in their_quarto.yml
. Scheduled docs feels like singular functionality (akin to a filter), not a full project type (akin to a custom format). Could this functionality be addable inside an existing Project Type?I've come up with two alternatives:
1. Manually modify
_quarto.yml
In my documentation I could instruct users to add the
pre-render
,post-render
, andmetadata-files
keys to their_quarto.yml
. The downsides there are that the functionality is now brittler and it requires them to handle the paths themselves (i.e._extensions/scheduled-docs/write-draftlist.ts
).2. Package it up as a metadata file
I could instead make an
ext.yml
file in my extensions dir that looks like:then users would just have to add one line to their
_quarto.yml
:metadata-files: "_extensions/scheduled-docs/ext.yml"
. The downsides here is that this really does feel like a hack on the existing extension system and it shows in the fact that the paths inext.yml
are relative to_quarto.yml
.I've come to think of filters as adding functionality to a document and a custom format as a batch of meta data, filters, et al. You can add many filters to a document and the functionalities add, but you can't add multiple custom formats to the same document.
In essence I guess I'd like a project "filter". It seems like we're really close with the existing functionality around Project Types except you can only have one Project Type per project. Would this be as easy as allowing
project: type
to take an array and fun through those metadata merges in order? Or is that muddling the notion of a "custom format" with a "filter"?Maybe a separate key like:
?
Beta Was this translation helpful? Give feedback.
All reactions