-
Notifications
You must be signed in to change notification settings - Fork 290
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 system #52
Plugin system #52
Conversation
|
|
Rebased and updated description for clarity. To test this, |
For icon, why not use monochrome icon or font-icon (better for create new webdesign !). |
@qwertygc if you want to propose different icons, please do. I think these icons fit the current design of shaarli well (there are no other monochrome icons in shaarli). Your propositions are welcome. (However this is out of scope of this pull request, we can work on styling later) |
Updated #14 with current https://github.com/sebsauvage/Shaarli/issues status. We're getting there. We probably want some of these features in the main code (read later bookmarklet, take note bookmarklet). |
I added a third plugin, requested at sebsauvage#167. Discussion is open on whether we should include these "default" plugins in the base install or move them to separate repos (like I did with https://github.com/nodiscc/plugin-playvideos) |
As long as we have a smaller number of plugins, I'd prefer to keep them as part of the default installation. Otherwise they'll most likely never get used. If one day we grow to more than 50-100 plugins, we'll have to see how to improve it (e.g. categorization, etc.), but having this problem will be a sign that the software is healthy, so I'm glad to have that problem. |
QR code has been moved to a plugin (fixes #57) |
* 2 new global config options: LINKLIST_PLUGINS and TOOLBAR_PLUGINS * These options are lists of plugins that will be loaded when rainTPL renders the link list and toolbar, respectively * each plugin is a raintpl template in tpl/plugins/$pluginname/$pluginname.html * if the plugin contains multiple files, they must be self contained in it's directory * this allows unpacking plugins form a zip or cloning them from git * add readityourself plugin, requested at sebsauvage#66 * This plugin adds, for each link, a button to display a more readable version using an external readityourself service * move archive.org integration as a plugin. To enable, add 'archiveorg' to the LINKLIST_PLUGINS array * styling fixes for plugins * remove archive.org plugin styling from main CSS, use icon instead * match archiveorg/readityourself plugins styling with qrcode * Icon from http://p.yusukekamiyamane.com/icons/search/fugue/icons/clock-history-frame.png under CC-BY-SA License * Icon from http://p.yusukekamiyamane.com/icons/search/fugue/icons/book-open.png under CC-BY-SA License
* uses wallabag's ?plainurl action to store in wallabag * configuration of base wallabag URL is done through the WALLABAG_URL global variable * fixes sebsauvage#167
* remove qr specific code for linklist template * add html item to qrcode.linklist.html * add the script itself to qrcode.footer.html
* code from https://github.com/zaius/youtube_playlist/ * Plays all Youtube videos linked from the page in an overlay HTML5 player * See it's README.md
* tpl/plugins/*/*.toolbar.html will add elements to the toolbar * tpl/plugins/*/*.linklist.html will add elements to the linklist
… failing * each plugin should have .toolbar.html and .linklist.html else RainTPL fails at finding the file and stops parsing
…olete LINKLIST_PLUGINS
* add plugin parsing loop in footer (required to include the qrcode script) * move javascript in it's own qrcode.js file (work on #33) and load it from qrcode.footer.html * enable qr plugin by default * move qr icon in plugin directory * add empty qrcode.toolbar.html to prevent raintpl parsing failure
* Rendering the linklist has been moved to a separate function (to allow greater customisation if the need arises) * A PageBuilder is now created every time we render the page. Although it is not always page settings, like we'll do with plugins. Also, this removes the potential errors when forgetting to create a pageBuilder and so on. * We now build a list of plugins for each location (for now: toolbar, linklist, footer) so that RTPL has no issues rendering them * Simplified plugins templates. Linklist templates can now access the link info through the variable, while toolbar and footer can access global settings via . * This means we don't have to create empty files anymore to prevent raintpl from crashing
QR code has been properly moved as a plugin and the implementation is much cleaner thanks to @pikzen. I'll move the ATOM button as a plugin, and move thumbnailers to a plugin (by the way it will be a generic plugin system, not just a few hardcoded sites). Then I'll rebase/squash my changes to get clean commits and we may proceed to merge the changes. @Alkarex @ArthurHoaro @BoboTiG @e2jk @Sbgodin @sebsauvage @timovn what do you think? |
@@ -30,7 +30,7 @@ | |||
<ul> | |||
{loop="links"} | |||
<li{if="$value.class"} class="{$value.class}"{/if}> | |||
<a name="{$value.linkdate|smallHash}" id="{$value.linkdate|smallHash}"></a> | |||
<a name="{$value.shortlink}" id="{$value.shortlink}"></a> |
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.
I think you meant shorturl
, because shortlink
doesn't exist.
Since there is no PHP involved, it's more a theme extension in my opinion. But that's pretty good and easy to handle. There is one little thing that I don't like, it's the way you inject your variable in the wallabag plugin. You used the global Shaarli settings file and I think it should be handle by the plugin files. If you don't want to involve PHP in plugins, you could either use JSON, YAML or even a flat key/value plugin setting file that you load around here if it exists and assign it to RainTPL. |
Yes mainly changes to the default shaarli template.
Yes. Thanks for the review, it's in no way finished yet and I'll update this pr when i get some time (thumbnailers, a few plugins from #14, store plugin settings in plugins directory, use ini-style config, the logic should stay the same if you like it) |
I started some new branches to deal with this as it was difficult to rebase, and the example plugins and plugin system itself should not be entangled on the same branch: https://github.com/nodiscc/Shaarli/tree/new-plugin-system QR and archive.org plugins are ready to roll. I'll fix the point mentioned by @ArthurHoaro (plugins should have their own config file), and add plugin parsing to the description area so that someone can possibly add a markdown rendering plugin there. Closing this, I'll submit another pull request. Your patches to my branches are welcome, I can push them to this repo if you want. |
See https://github.com/shaarli/Shaarli/pull/52/commits descriptions for an up-to-date description