GEPS 020: Plugin Extensions

From Gramps
Jump to: navigation, search

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.

  1. register the extension interface - defines the necessary requirements (fields)
    1. details dependencies, versions, hooks, and fields
  2. load the plugin extension interface
    1. if it meets the requirements
  3. 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:

  1. CSS (cascading style sheets) for webreports and gramps-connect

References