notable/notable

Plugins

fabiospampinato opened this issue ยท 8 comments

Some people have expressed interest about adding a plugins architecture to the app.

This would require significant efforts to implement in a sufficiently mature and powerful way, but it would be very interesting to see.

I'm interested in helping with this if I can (mainly, I want to help plugins get some traction so I can start implementing note encryption and cvs plugins). Do you already have some architecture ideas about what a plugin should look like, which things would be customisable and what plugins could do in general?

I can already see two kinds of plugins, the ones that will affect the UI, and the ones that will affect the notes.

UI plugin ideas:

  • Note formatting actions
  • Tag/note colours
  • Editor split view
  • markdown linting

Note plugin ideas:

  • cvs
  • gpg encryption

I have no idea what UI plugins would look like, but note plugins imo could be written as simple hooks:

  • read_note(metadata: NoteMetadata): Promise<string>
  • write_note(metadata: NoteMetadata, content: string): Promise
    there will be a need for good error handling so that those hooks can return a failed promise and have the error displayed to the user in a nice and actionable way.

@bendem For now I want to focus on other more pressing issues and on making the project long-term sustainable, I'll work on plugins after that.

Regarding the architecture there's nothing set in stone yet, but I think:

  • There should be APIs for contributing elements to the UI, mainly toolbar buttons, sidebar sections etc.
  • There should be hooks/events for some important things (reading/saving/rendering a note, searching etc.)
  • There should be some support for loading a custom CSS and JS file, as sometimes you just need to hide that element from the UI or make that small tweak, but all plugins shouldn't have to interact with the DOM directly, unless they are manipulating a full webview they are contributing.
  • Plugins should run on a separate process, so that a crash there doesn't take the whole app down.
  • There should be a website where people can download and publish plugins.
  • Some built-in features should be implemented as disable-able plugins.

I've a plugin candidate: a local server for importing research papers into Notable by clicking a bookmark. It currently needs to be installed and run as an independent process so yes, a plugin framework would be neat! It's no rush though, as it'll be too janky to package up for a long while yet.

@andyljones that's precisely the reason why we need plugins: not everything can be implemented into the core, but the app itself should be powerful enough to be able to support pretty much all use cases via plugins.

@andyljones that's precisely the reason why we need plugins: not everything can be implemented into the core, but the app itself should be powerful enough to be able to support pretty much all use cases via plugins.

I agree, not everyone has a specific typing experience, some users might want versioning and encryption, some just want to jot their thoughts, plugins would open a great feature set that can be defined by the developers themselves, e.g. to implement themes, backup and sync to 3rd party services, application toast messages, automatic table of contents, a lot of extra functionality that can be build upon and into the project.

The main selling point for the plugins is that they are pluggable and not everyone has the need for them, however this relies on having a core that supports this such as the one build into vscode.

That being said plugins themselves could become obsolete if the functionality itself is build into the app or worked around it.

Versioning can be done via git, encryption with veracrypt or cryptomator, backup and sync with a simple dropbox, b2 backblaze or any other server.

The 1.6.0 version itself looks great and feels great using it. Not everyone has the need for every feature and thats fine since its up to the end user to decide if its worth their time.

I'd like to see a text to speech adding for read-aloud.

I would love to see a plugin that makes Notable like Notion how each note is a page you can right click on a spot and create a subpage in a page to make your own table of contents
Notion
Notion2
Notion3

I'd like to contribute adding a LanguageTool integration; @fabiospampinato do you have any news about the API / hooks ?