Sooner or later Techne2 will have to have the ability to load extensions.
I don’t plan on allowing users to add new shapes via an extension – that’s something that will have to be done via a pull request.
However, I think it’s fairly easy to let extensions add new menu-entries, even in the toolbar.
Here’s how I think this should and could work.
When you want to load a new extension you pass a url to a json that holds all necessary data like name of the plugin, version, where to find supporting scripts and what menu entries to add.
Look here for an example.
As soon as everything is loaded and ready Techne will call the onLoad function in the plugin in case that needs to set things up.
Adding the menu entries is just a matter of adding them to the respective observableArray and knockout will do the rest for us.
I understand that exporter need to prompt the user for some info, take a java-exporter. That needs to know what namespace to use, how to name the model class itself.
So, I’m not sure if I should provide a helper function that takes care of setting up a wizard that you pass an object describing the fields you need. Or if I should just let the extensions do all the work.