dendronhq / dendron

The personal knowledge management (PKM) tool that grows as you do!
https://wiki.dendron.so
Apache License 2.0
6.74k stars 257 forks source link

Expanded hooks API #2270

Open brettmitchelldev opened 2 years ago

brettmitchelldev commented 2 years ago

Please select if your request is either something new or an enhancement

Please select the area your request applies to. (Multiple selections are Possible. You can leave blank if you're not sure.)

Is your feature request related to a problem? Please describe

I really, really like the hooks feature! I use it to dynamically populate new notes in ways that aren't possible with just templates and schemas. Unfortunately, the only hook available right now is onCreate. I'd find it extremely useful to be able to run a bit of code every time I open an existing file.

Describe the solution you'd like

I'd love to see at least an onOpen hook, and possibly others if it is either easy to add them in, or if others feel there are valid use cases for hooks like onDelete, onUpdate, onRefactor, onRename etc.

Describe alternatives you've considered

I believe there are other tools that add programmability to VSCode interactions (Power Tools by e.GO Mobile comes to mind), but I'd like something that interfaces directly with Dendron's note API for access to NoteUtils and the note interface.

hikchoi commented 2 years ago

Glad that you are enjoying the hooks API!

We definitely have plans to expand this to other lifecycle events.

Feel free to chime in on the discussion here: https://github.com/dendronhq/dendron/discussions/680

brettmitchelldev commented 2 years ago

Heh, looks like adding the rocket emoji to your comment re-upped some labels... Sorry about that :laughing:

hikchoi commented 2 years ago

The issue labeler is triggered on edits 😄 perfectly valid case.

brettmitchelldev commented 2 years ago

Ha lol, that makes more sense, it was just perfectly timed with my reaction. I'm using tridactyl on Firefox, probably tried to navigate with a checkbox tab-focused.