GEPS 020: Plugin Extensions
This Gramps Enhancement Proposal explores extending parts of Gramps. For example, the Narrative Web Report might have its own plugins which define and allow for configuration of additional pages.
A plugin extension allows plugins (builtin or third-party addons) to define their own interface for additional functionality.
- register the extension interface - defines the necessary requirements (fields)
- details dependencies, versions, hooks, and fields
- load the plugin extension interface
- if it meets the requirements
- code is called in appropriate places (hooks)
Many system have plugins which can be injected at different points in a systems processing. These are sometimes called a "hook". A hook defines a place where code can be called, and a method for injecting code into that place. For example, one might define a translation hook whereby one could override the translation of a particular phrase for a particular language.
Hooks could be implemented by a callable list of functions, a pipeline of callables, or by signals. We should look at how other systems create these hooks. Suggest looking at:
- Content management Systems, such as drupal to see how they have created a large number of hooks
- Configuarable systems like gedit which allow the definition of macros
It would also be useful if the plugin extensions for NarWeb also worked (or had sharable code) with gramps-connect.
Other things in gramps could perhaps be plugins:
- CSS (cascading style sheets) for webreports and gramps-connect
- http://n4.nabble.com/Google-Maps-available-for-PlacePages-td1835830.html#a1836789 - Benny makes a suggestion for a plugin based report