9 - Note Lifecycle Plugins #680
Replies: 2 comments 1 reply
-
In general I love this. The RFC discusses registering plugins, and hints at lifecycle hooks those plugins could use. I'd like to suggest that plugins and lifecycle hooks should be two separate things. Or, at least, that the lifecycle hooks and plugins can be 'attached' to schemas. Ie: I want my daily.journal.* notes to execute plugin.foo on create. However, I don't want plugin.foo to run when I create a note of schema 'meeting'. This would, I think, reduce the latency concern expressed in the RFC, as the fine-grained detail of what runs when will prevent a ton of plugins from all trying to execute every note creation. It might be helpful to enumerate the lifecycle events in the RFC:
|
Beta Was this translation helpful? Give feedback.
-
Coming over from #2270. I figured since there's an open discussion on this topic I'd describe my specific use case for hooks. Hopefully someone finds it helpful (or at least mildly interesting). 🤷 I'm definitely not a Dendron expert yet, especially WRG the plans for it's future, so maybe there's a different feature coming down the pipe (or already here) that would be a better fit for this, but one use case I'd like to use hooks for is dynamic views. Maybe it's a bit hacky, but personally, I'd like to be able to dynamically populate a note every time I open it, or better yet, define a set of ephemeral notes that don't exist unless they are open (if this never becomes a first-class citizen, I'd probably use an onOpen / onClose pair to populate and then delete). Reason being is I have some infrastructure set up to manage JS functions in code blocks within notes that can be designated as 'contributers' for a particular hierarchy pattern. Right now, this is handy for contributing todo items to a daily journal note from locations within my 'projects.*' hierarchy in ways that a schema with templates can't handle. I'd like to extend this to provide myself with dynamic views. I'm not quite sure yet how the relationship between an ephemeral dynamic view and the note hierarchy would work 🤷 but that's the general direction I'm headed in. All that to say, I'm very excited for an expanded hooks API, and if anyone has pointers (or criticisms) of my process, I'm happy to hear them. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
This thread is to discuss the note lifecycles rfc
Beta Was this translation helpful? Give feedback.
All reactions