-
Notifications
You must be signed in to change notification settings - Fork 296
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
Plugin proposition #275
Plugin proposition #275
Conversation
slowclap.gif Could you write a plugin for #147 and push it as a separate commit? This would help understanding how to write a simple one. The commit history probably needs to be squashed/reordered and some commits need to be split, but we can do that at a later point. |
Thank you! Ok I'll do that. It will be like the playvideos plugin. |
2b7c560
to
bcd9fdd
Compare
So, I've rebased to edit the way plugins config are handled according to you message. I've also added loggedin status information to plugins. Second commit contains a plugin which add a field in linklist.
Yeah... won't be fun. |
bcd9fdd
to
13d6804
Compare
Kudos for continuing work on the plugin system :D Why not consider the current
in order to provide a functional plugin system, and then implement them one by one in separate PRs? In Agile projects, it corresponds to the Epic notion: a long-term goal that needs to be split in several smaller, more localized tasks. |
13d6804
to
ef99dcc
Compare
Sooooo... I have reset all commits, and split the whole thing in 2 commits:
Then I've pushed all plugins into separate PR. I hope that's OK cause it was a pain in the ass to do. |
367fcc5
to
ead2c1e
Compare
Updated: lot of new hooks and template placeholders. EDIT: started documentation: https://github.com/shaarli/Shaarli/wiki/Plugin-System |
Thanks!
And it'll be worth every bit of it!
|
ead2c1e
to
ffba1ce
Compare
Unit tests added and documentation started. |
@@ -0,0 +1,28 @@ | |||
https://github.com/shaarli/Shaarli/issues/181 - Add Disqus or Isso comments box on a permalink page |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- good starting point for plugin discussions :)
- a
README
pointing to Github and/or local documentation, as well as theplugin
label, could be useful for users/developers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually @nodiscc file I just moved. But we can try to make a POC for Isso. It would be a good use case to test the plugin system pertinence.
df191b4
to
a52e843
Compare
Add an icon in linklist to display links QRCode
+ coding style
Display a button in buttons toolbar which allows to play all videos found.
+ coding style
Display an archive.org icon in linklist, foreach links.
+ coding style
Add a Wallabag icon in linklist for each link.
PLUGIN archiveorg
PLUGIN QRCode
PLUGIN playvideos
Add an icon for each link (linklist) for ReadItYourself
Add a field in linklist page to paste a new link. Displayed in fields toolbar.
+ removed exit error if the config is not found + coding style
PLUGIN: addlink_toolbar
PLUGIN readityourself
PLUGIN wallabag
This plugin try to cover Shaarli's plugin API entirely. Can be used by plugin developper to make their own.
PLUGIN demo_plugin
Hey guys, Sorry for not having followed the development of the plugin system.
That's all I have in mind for now. But in any case, the plugin system works great and offers a tons of possibilities ! I just hope plugin developer will be aware of the fact that there are many different themes out there (could be useful to remind it in the documentation for plugins, by the way). Thanks for the awesome work, guys ! |
Thanks for your feedback @kalvn! I'll see what I can do to reduce coupling between plugin's code and design rules in the next versions. |
What is this
I retrieved @nodiscc plugin system proposed in #164 and changed it to create PHP plugin system. It relies on hooks triggered by certain actions (only template rendering for now).
It's only a proposition, let me know what you think of it.
Why
How it works
Hooks
PluginManager
class includes enabled plugin PHP files at loading and register their hook function.When we want to trigger a hook,
PluginManager::executeHooks()
is called, eventually with rendering data. It will call every plugin function registered under the standardized name:Rendering data can be altered and/or completed.
Rendering
This is exactly what @nodiscc did.
Templates contain plugin display at specific location, which are populated by the plugin functions.
Implemented
Here is what's has been done:
link_plugin
icon for every link (QRCode, etc.)Extension
We can easily add hooks to whatever is pertinent (link add, picwal rendering, etc.).
TODO
PluginManager
andRouter
.make a POC for Isso.Later: