No way to pass custom functions to the templates
It seems that there is support in place for passing custom Funcs to the template, but when using temple build, there is no way to pass custom functions.
Is it just not implemented, or I'm missing something?
@Lupus, I haven't figured a good way to expose this functionality via command-line. I would love to hear suggestions :)
I have found that in many cases where you would use a function, a method on the type of data you pass in to the template works just as well. Is it possible in your case to use a method on a specific type instead of a global function?
So far I've just removed generating of code for group creation, so that command line only generates some build(g *temple.Group) function which puts all the pieces into the group. This way I can create whatever logic I need for group preparation, including custom functions, and then pass the group into build() to get template contents filled up.
I though about methods, but our code is organized in a way that object data is coming from external (yet ours) package library. Wrapping it up does not seem an option as it's pretty nested.
Also html/template in gopherjs is too slow to be usable with any reasonable data size, see issue 343 in gopherjs repo, so we're likely going to use some pure JavaScript solution for templating...