To Plugin or Not?

24 views
Skip to first unread message

tbp1...@gmail.com

unread,
Feb 24, 2022, 1:22:32 PM2/24/22
to leo-editor
I am developing an Leo application that displays in a tab in the Log frame.  Eventually it will probably use two tabs.  The code lives in a new subdirectory in Leo's plugins directory.

Currently this code is not a real Leo plugin, because it does not use the plugin machinery.  Instead, it installs its code and creates its tab using a Leo command script, which can be put into a button.  This design reduces the complexity of the code compared to making it a "real" plugin.

I'd like to know what people think about the question of whether to turn this app into a plugin.  The code so far has nearly 400 lines of code, and will grow as I add planned functionality, if this makes any difference.  At the moment it all lives in a single Python file, in addition to the install script.  There are also several auxiliary scripts that are helpful to get the most value out of the app, so users will need to install and use some scripts even if the thing becomes a plugin.  I suppose I could come up with a way for the app to install those other scripts on startup.

So - would it be more Leonine, or more natural, to have this thing be a plugin or not?  All suggestions gratefully received!

Jacob Peck

unread,
Feb 24, 2022, 1:28:23 PM2/24/22
to Leo-editor Group
I have similar 'apps' that live inside Leo outlines, as scripts but not plugins.  At least one of them is well over 3000 lines of code :)

I think the main question to ask is whether the 'app' makes any sense outside the context of the outline it lives in.  In my case, the ones I've built really only make sense inside the one outline they live and work in.  A plugin for those seems like overkill, especially if it would pollute the rest of my Leo session.  But that's a tradeoff you'll have to think about for yourself.

Jake

--
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/6c608bf1-a1c2-4592-acb2-2cabfe73e0ban%40googlegroups.com.

tbp1...@gmail.com

unread,
Feb 24, 2022, 2:27:27 PM2/24/22
to leo-editor
Thanks for your thoughts. @jake.  This app too will only make sense within the specific outline it's for.  I thought it might be interesting to some other folks, otherwise I wouldn't even have considered turning it into a plugin.

Edward K. Ream

unread,
Feb 25, 2022, 3:44:59 AM2/25/22
to leo-editor
On Thu, Feb 24, 2022 at 12:22 PM tbp1...@gmail.com <tbp1...@gmail.com> wrote:

> I'd like to know what people think about the question of whether to turn this app into a plugin.

The choice is yours. @button scripts, especially those that apply to a single outline need not ever become plugins.

If, later, you see some reason to share the code, you can still put your @button script in your myLeoSettings.leo file. Any @button node that is a child of the @buttons node will be available to all open outlines.  Same for @command nodes that are children of the @commands node.

Otoh, the advantages of plugins:

- They can be enabled/disabled on a per-outline basis.
- They can respond to specific events

Edward
Reply all
Reply to author
Forward
0 new messages