Factory Plugin Menu

The Factory Plugin renders as brief instructions and a short menu of types, a subset of plugin types available on the origin server, that will transform the plugin when clicked.

Here we explain how that menu is created and what happens when items are chosen from it.

Rendering

The plugin renders the menu from a list of plugins it has fetched from the server and cached in the client.

GET /system/factories.json

The plugin omits the menu if it finds alternative instructions in the prompt field of the factory item.

{ "type": "factory", "id": "63ad2e58eecdd9e5", "prompt": "Link to a page about yourself here. Type your name enclosed in double square brackets. Then press Command/ALT-S to save.<br><br>Make all pages here yours alone with the login below." }

Configuration

The server selects from its available plugins those that it finds suitable for inclusion in the menu. Plugins volunteer for inclusion by providing metadata easily accessible to the server in their own factory.json file.

{ "name":"Method", "title":"Computational Method", "category":"data" }

The menu shows names and offers titles as hover text.

Categories are "markup", "data" and "other". These become columns in newer versions of the Factory plugin.

Selection

A factory plugin transforms itself client-side to a plugin of the chosen type when a menu item is clicked.

A text editor is opened on the newly transformed item. This allows the user to enter the desired markup for the item.

When editing completes the change is recorded in the journal as an edit with both the new type and new text.

When editing completes with no text entered then the change is recorded as a delete of the factory with no mention of the never saved new item type.