Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugins: Add support for editor plugins #11296

Merged
merged 22 commits into from
Nov 10, 2024
Merged

Plugins: Add support for editor plugins #11296

merged 22 commits into from
Nov 10, 2024

Conversation

laurent22
Copy link
Owner

This allow defining a plugin view that will replace the text editor. Use case is for example showing a kanban board instead of the note editor.

Making it a draft for now since it hasn't been tested much and mobile also needs to be implemented - either we actually make it work on mobile (if not too complicated), or we make it work like a regular panel.

personalizedrefrigerator added a commit to personalizedrefrigerator/joplin that referenced this pull request Oct 31, 2024
This commit adds support for the renderMarkup command on mobile and web.
Resource URLs take different forms on desktop, web, and mobile. As such,
this commit takes the approach of rendering a replacable resource URL in
the form   joplin-resource://<resource-id>.<extension>  . To properly
support this, the webviewApi in user webviews will need to be extended
to allow resolving resources from URLs.

Possible alternatives:
- Use a different resource base URL on mobile and desktop (perhaps
  determined by   shim.noteViewerBaseUrl  ?)
  - This wouldn't help on web, where each resource must be sent to a
    note viewer before it can be loaded (web uses a virtual file
    system).
- Rather than have a renderMarkup command, extend
  laurent22#11296 to extend webviewApi
  with a renderMarkup function. Calling this function would load
  and select the correct resource URIs for the current webview. This
  would also allow user plugins to run.
  - This approach is more complicated than the approach taken here. It
    could potentially be used **in addition** to this existing
    command-based approach.

See also: ff09937
@laurent22 laurent22 marked this pull request as ready for review November 9, 2024 22:07
@laurent22
Copy link
Owner Author

Seems ok now. For now it will be desktop-only and we can look at mobile later on

@laurent22 laurent22 merged commit f091c32 into dev Nov 10, 2024
13 checks passed
@laurent22 laurent22 deleted the plugin_editor branch November 10, 2024 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant