-
Notifications
You must be signed in to change notification settings - Fork 13
Extensions. #30
Comments
What I think we could do is have a directory with autoloaded JS and have Marknote dynamically import those guys into the document that way. Currently I'm having a dedicated note for scripts that need to be global which is pretty cool but I don't like it cluttering up with a random note. |
That sounds like a pretty good idea! I also plan on adding custom events for note changes and other actions so they can be hooked easier. |
Basis plugin interface implemented. #30
Added some documentation to the wiki: https://github.com/octalmage/Marknote/wiki/Plugin-API Still need to document internal functions. I'm also going to add more complex hooks, like rendering, so plugins can modify the rendered HTML before it's displayed. I'll use async waterfall to pass the HTML from plugin to plugin. |
Implemented hooks in the hooks branch, currently works like this:
It's insanely powerful. |
hooks branch was merged, I don't think this issue is completely closed though. I'll review the API this week to find any missing functionality. #38 also related. |
Allowing JavaScript in notes has opened up some amazing possibilities. For example you can now automate note creation, modify a notes content, switch notes, you can automate anything!
I want to take this a step further and have a separate editor (in the settings) where you can input JavaScript that runs in the background. This way your "extension" runs independent of your note.
One example of what could be achieved with this is encryption! You'll be able to hook the loading of a note and decrypt it, then encrypt it when the user saves.
Another possibility is extending markdown. You could again hook note loading and use regex to add syntax for YouTube embeds, for example.
This will be a great start but I'd love for the user to be able to add GitHub projects, then Marknote will download and load the JavaScript automatically.
The text was updated successfully, but these errors were encountered: