pebble icon indicating copy to clipboard operation
pebble copied to clipboard

Template model

Open ndawod opened this issue 1 year ago • 0 comments

Hi there, and thanks for this fine piece of software! 🎉

I'm currently moving away from FreeMarker and I'm 99% sold on Pebble – except for one important factor (for me): Pebble expects the template model to be a Map<String, Object>, while FreeMarker doesn't. FreeMarker accepts any instance of a class, Map, List, String, anything really, and the template would work fine with it. But Pebble works only with a Map.

So, I wonder, how hard would it be to add an overload for evaluate() that accepts Object model? The easiest would probably be to convert the Object to a Map (via reflection) and then forward the call to the existing evaluate() method.

ndawod avatar Aug 08 '24 15:08 ndawod