Hsoy Templates – client- and server side templating

Introducing “Hsoy Templates”, a html templating library for modern web. The main goal was to make a templating library with easy to use syntax, that can be used on both server and client side. It have HAML syntax, and compiles into Java on server side and JavaScript on client side.

Actually it’s a version of Google Closure Templates (.soy templates) with HAML syntax.

Why you need this?

In modern web development it’s very common to update some parts of current page by data received from server, but the problem that it’s annoying to write and support same HTML view two times – for Client and for Server. Just breaks DRY principle.

Hsoy Templates gives you a way to write such templates just once, and use it on client-side, and on backend.

Features:

  • one template (a *.hsoy file)
  • HAML syntax (see http://haml.info/)
  • fast
    • compiled into Java (so can be used from Groovy, Scala, Clojure, etc)
    • compiled into Javascript (so can be used from Node.js)
  • based on Google Closure Templates library
  • commercial friendly (Apache 2.0 licence)
    • Example:

      Source template

      If you met HAML syntax first time, take a look at generic viagra forum uk

      and use it

      from JavaScript:

      from Java:

      As a result you’ll get

      Same HTML on server and client side, generated from same template file.

      See full documentation at generic viagra uk paypal

      Components

      Currently the project consists of following parts:

      Roadmap

      • test test test
      • support most Google Closure Templates features
      • JSP taglib
      • native OS listener for sources modification
      • a Gradle plugin