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.
Plugin Extensions
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)
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
- Configurable systems like gedit which allow the definition of macros
Prototype
It would also be useful if the plugin extensions for NarWeb also worked (or had sharable code) with gramps-connect.
Additional Comments
Other things in gramps could perhaps be plugins:
- CSS (cascading style sheets) for webreports and gramps-connect
References
- Re: Gramps-devel Google Maps available for PlacePages? From: Benny Malengier 2010-04-12 - Benny makes a suggestion for a plugin based report