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

Community Code Library / Plugin System #986

Closed
sambbaron opened this issue Apr 26, 2020 · 15 comments
Closed

Community Code Library / Plugin System #986

sambbaron opened this issue Apr 26, 2020 · 15 comments

Comments

@sambbaron
Copy link

It would be helpful to have a public library of community code for widgets, custom notes, css themes, hosting configurations, etc. This could expand community involvement and provide a showcase for potential new features.

Some implementation options:

  • A folder in the existing git repo and a wiki page listing each code snippet
  • Integrate into Trilium demo
  • Create a publicly hosted "community" Trilium instance
  • Replace Gitter with something more featured: Slack, Discourse, etc.
@zadam
Copy link
Owner

zadam commented Apr 26, 2020

Hello,

my approach so far has been to show some basics in the demo document. I would like to expand on that in the future with more/better examples but still of course it's far from this "community library".

Perhaps the easiest way would be to add this stuff to the wiki.

There are some issues:

  • Although it is getting better lately, scripting / styling API is still in flux
  • I don't think there's very many available contributions from users, although that might be of course also caused by the fact that there isn't a place to share them

But the biggest issue is that I don't really have time for this. So I would welcome this happening, but someone else would have to drive this.

@sambbaron
Copy link
Author

Yeah, after writing this issue, I realized it was a big ask 😐. As I looked over old issues, I saw snippets that might be helpful to others, but if the API is still in flux, then perhaps not. The wiki does seem like a good option.

@jkurei
Copy link

jkurei commented May 17, 2020

I've been thinking about this as well...

Adding more examples to the wiki would need at least some level curation, and that's much extra work. Another suggestion: Trilium users should write about their scripts and examples on their own blogs or gists or their own git projects, and we could link those from the Wiki. If any example becomes clearly specially interesting, it could be added to the wiki itself or to the default example notebook.

We could have guidelines requesting to make clear what version of trilium do these community scripts have been tested with.

Trilium's extensibility is one of its strong suits, it would be great to see what others are doing with it.

@idelem
Copy link

idelem commented Oct 24, 2020

@zadam Github has discussions beta out now. How about adding one?

@patrickjm
Copy link
Contributor

I'm willing to try this out on the side and PR if it works, but is it an idea you'd be OK with merging in theory @zadam ?

Pasted from #1328:

It would be interesting to have a git based "marketplace" repo which is by default hard-coded to some public repo that zadam owns, but maybe users could configure their instances to additionally point to private repos. Standard Notes has a similar system.

For example, maybe the repo's file structure could look like this:

/My Super Awesome Theme
  /metadata.json
  /... some file based representation of notes to import
/My Cool Render Note
  /metadata.json
  /... some file based representation of notes to import

Metadata could have information like markdown description, author, tags, etc.. As it's laid out above, there wouldn't be installing/uninstalling, just importing them somewhere into the tree. If Trilium ever has its own website someday, the marketplace could live on some subdomain and statically generate from this public git repository.

@zadam
Copy link
Owner

zadam commented Oct 26, 2020

but is it an idea you'd be OK with merging in theory @zadam ?

I'm OK with merging this in theory, however I think it will be rather difficult in practice.

For the repo structure, looks good to me - I would essentially use the export/import ZIP format (but unzipped) - there's currently !!!meta.json file with all the note metadata like attributes etc. There could be an extra metadata note with the author etc. as you mention.

@9s-l-s9
Copy link

9s-l-s9 commented Feb 4, 2022

Any updates? :)

@meichthys
Copy link
Collaborator

For reference, some existing community code examples can be seen here: https://github.com/zadam/trilium/discussions/categories/show-and-tell

@meichthys
Copy link
Collaborator

Also just for reference, some other community code can be found here: https://github.com/Nriver/awesome-trilium

@meichthys meichthys changed the title Community Code Library Community Code Library / Plugin System Jan 25, 2024
@meichthys
Copy link
Collaborator

meichthys commented Jan 25, 2024

Since we have various issues and discussions on this topic (#3293, #3238, #2969, #1328, #4567, #4603, #1873 ), let's consolidate the issues here and leave the discussion open at #1873 for more break-out discussions.

Relevant input from @zadam : #1873 (comment)
Also related: #4236

Current lists of various plugins/scripts/templates/etc:

@rauenzi
Copy link
Collaborator

rauenzi commented Jan 25, 2024

Extension System

A proper plugin system is something I briefly discussed with zadam but, I think it would be good to get more community input on how they expect it to work, from BOTH a user perspective and a developer perspective. Having that kind of input would help me in making a proposal (and potentially some PRs) to that end. So I'd love for people to describe their ideal system from either perspective.

I have some previous experience designing the extension system for BetterDiscord. And I say extension because like over there, Trilium could have both plugins and themes that include metadata like settings schema that allows end-users to easily customize the theme colors or a plugin's functionality.

Library/Store

Beyond the extension system itself, a centralized listing of all the ones available is of course always nice for end users. How that's handled is a whole other rabbit hole, but a discussion worth having nonetheless. The easiest of course would be to just maintain a list in a github repository or the wiki like we already have. It's not the most user friendly and it's difficult to get new ones added. It's also not obvious to find for users. The other extreme is to have a website dedicated to trilium (a la trilium.rocks) that maintains a listing where people can submit their own extensions. Obviously that has many issues of its own like malicious actors and such. But it could also have an API that the local Trilium client accesses to show an in-client listing of addons with an easy install button.

I have to think the solution for the library/store would have to be somewhere between those two extremes; the github wiki is not easily findable for users, and the advanced website is too much to maintain and setup for zadam. I don't know what that in-the-middle solution is, but hopefully someone else does 😄

@meichthys
Copy link
Collaborator

meichthys commented Jan 25, 2024

@rauenzi Have you seen https://hacs.xyz (The HomeAssistant Community Store)? It uses the git repository method and is IMO one of the best implementations I've seen. It defaults to a specific repository but allows you to define custom repositories or just search the known repositories which have been registered with HACS. The user can then search for any integrations registered with HACS and one-click install them. The installation page shows the related git repository readme along with some simple git stats. See the screenshots on the bottom of the hacs page i linked to.

@meichthys
Copy link
Collaborator

meichthys commented Jan 25, 2024

@rauenzi Have you seen the HACS store (HomeAssistant Community Store) for HomeAssistant? It uses the git repository method and is IMO one of the best implementations I've seen. It defaults to a specific repository but allows you to define custom repositories or just search the known repositories which have been registered with HACS. The user can then search for any integrations registered with HACS and one-click install them. The installation page shows the related git repository readme along with some simple git stats (See the screenshots on the bottom of the HACS page i linked to).
For a video of how this looks from the user side see here: https://youtu.be/XGyjan7j54w?t=556

@filipworksdev
Copy link

Hi everyone. I would personally prefer a much simpler approach.

Have a special folder where you can add self-contained plugin notes which would add new functionality in Trilium such as new panel buttons, new context menu items, new menu items, new settings, new status bar items, scripts that run on a timer or schedule, popup panels and controls, etc

For example here is a Calendar Plugin (from the demo project) but added on it's own into this Plugins folder:
image

Additionally when clicking on the Plugins folder you would see a list of all the plugin notes with an on/off slider switch beside each list item entry. In the future this could be expanded such that the bottom part of the Plugins note is also a browser of github repositories for plugin notes.
image

The plugin notes would simply be zip files and to ensure they are added to the Plugins note folder they can be marked as standalone plugins rather than normal projects. Plugins could also be created this way from any notes in the project.

The scripting system right now is good enough to create some of this functionality and can be expanded and built on to add additional functionality.

@meichthys
Copy link
Collaborator

Trilium has entered maintenance mode. Future enhancements will be addressed in TrilumNext: TriliumNext#107

@meichthys meichthys closed this as not planned Won't fix, can't repro, duplicate, stale May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants