Plugins are written in OCaml. The compiled OCaml code is then
loaded in Stog with the
A plugin just registers new functions associated to tags. Here is an example:
Have a look at the Stog library reference documentation.
The plugin is simply compiled with
The plugin is used by specifying it one the
or, if the plugin is installed with ocamlfind:
With our plugin example, we can use the new "list":
This will be evaluated (reduced) to
The cache system (see
If a new rule defined by a plugin uses a file or implies a dependency
from an element to another, this rule must declare this dependency
using the Stog_plug.add_dep
function:
If a plugin computes information which could be cached, it can declare a
new cache for this informations, using the
Stog_plug.register_cache
function:
The Cache module to provide is very simple; have a look at the
Stog_cache.Cache
module type.