Python plugin framework

I found a really neat link here that has some amazing looking sample code I can stealborrow to create a plugin/module framework for bushel! Now this also means I might have to use a different markdown parser but we'll see. I might be able to just run it through the base parser and then search for instances of the module call strings and replace it, like I do for the header.

I don't think I'll follow that one exactly. I noodled over it a little (for like months) and I think I came up with something that will work better for my use case.

You will have PluginCollections which will house Plugins. In terms of file structure it would look like this:

plugins
|
+- plugin collection 1
|  |
|  +- plugin 1
|  +- plugin 2
|
+- plugin collection 2
   |
   +- plugin 1
   +- plugin 2

When bushel is parsing a saved leaf, part of that parse function will find the generic plugin syntax of [~:<plugin_collection>:<plugin_name>.<optional_plugin_argument>]. This will get passed to the main PluginHandler which keeps track of all PluginCollections that are loaded. The PluginHandler will parse the collection name and pass the plugin name and the optional argument to the PluginCollection, which will decide which plugin to call. Plugins will return a string that they wish to insert in place of the plugin call string.

Now someone might want to make a plugin that affects the text around it. This kind of system limits that capability severely, so I might add in a context that can be sent to the plugin as well. That would look like the markdown syntax for images or links, so something like this:[~:<plugin_collection>:<plugin_name>.<optional_plugin_argument>](<plugin_context>). That context could then be modified or replaced by the plugin.