fedwiki / wiki-client

Federated wiki client-side javascript as a npm module.
Other
115 stars 36 forks source link

RFC: Adding a presave hook in editor focusoutHandler #279

Open andrewshell opened 2 years ago

andrewshell commented 2 years ago

I'm curious if there have been any conversations about providing hooks in the code to allow plugins to extend core functionality. Here is an example of adding a "presave" hook to the editor.

I've created a plugin that would use this hook as a proof of concept.

https://github.com/andrewshell/wiki-plugin-metadata/blob/master/client/metadata.js#L26-L35

I'm sure there will need to be discussions before something like this gets merged. So I'm documenting the idea with working code.

dobbs commented 2 years ago

A while back I created a feature to allow plugins to override the editor. It's not the same thing as the presave hook you've proposed, but I think reaching for similar kinds of extensions. https://github.com/fedwiki/wiki-client/pull/247