You can for example extend VelocityPlugin and write an associated script
and jar them up in a jar (only two files required). Then register
them with Generama, and you're ready to go.
If you need advanced functinaolity that's hard to do in Velocity
or Jelly, you can implement the logic in your plugin class as a
public method. You can then call the method directly from the
scripts.
This is inspired of the MVC pattern. The script just renders the data
provided by the plugin (and the metadata).