Skip to content
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

Implement a plugin mechanism for custom Python scripts #115

Open
proycon opened this issue Jun 14, 2017 · 0 comments
Open

Implement a plugin mechanism for custom Python scripts #115

proycon opened this issue Jun 14, 2017 · 0 comments
Assignees

Comments

@proycon
Copy link
Owner

proycon commented Jun 14, 2017

Implement a plugin system in foliadocserve and FLAT, that allows custom Python scripts to be executed in the context of the foliadocserve. This would add a lot of flexibility and allow custom functionality to be added.

The setup would be as follows:

  • The plugin is declared in the FLAT configuration, this specifies 1) the python module to import, 2) the function to call in said module, 3) the user parameters the function accepts. 4) A label for a menu entry
  • A plugin script has to be rewritten and should define an entry function adhering to as specific signature, something like f(namespace,docid, doc, **kwargs) where doc is an instance of folia.Document and allows full read+write access to the document. The output of the function is either 1) an FQL query (possibly with some extra parameters) that tells FLAT what to visualize or 2) an HTML snippet that will be shown in a separate response dialog.
  • From a user perspective, the user selects an item tied to a plugin in the menu, if any user defined parameters are taken, a dialog pops up to query those. Upon submission of this dialog (or direct click if no parameters are needed), FLAT communicates to foliadocserve to invoke the plugin with said parameters.

Requested by @ErkanBasar

@proycon proycon self-assigned this Jun 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant