openresty / lemplate

OpenResty/Lua template framework implementing Perl's TT2 templating language
54 stars 9 forks source link

feature: support custom lua TT filters. #1

Closed ingydotnet closed 7 years ago

ingydotnet commented 7 years ago

Example:

lemplate = require('my.templates')
lemplate.filters['upper'] = function(str, args)
    return string.upper(str)
end
lemplate.process('[% "i like pie" | upper %]')
agentzh commented 7 years ago

@doujiang24 Have a look at this :)

@ingydotnet Thanks!

doujiang24 commented 7 years ago

@ingydotnet Thanks, works fine on my side. one question: seems we should also update lemplate.

ingydotnet commented 7 years ago

Fixed. Please Review.

agentzh commented 7 years ago

@ingydotnet Will you rebase to the latest master and resolve those conflicts? Then I think it's good to merge. Thanks a lot!

ingydotnet commented 7 years ago

Done. Please review.

agentzh commented 7 years ago

@ingydotnet Merged. Thanks!