Skip to content

A lightweight logicless templating engine, written in Scala and inspired by Mustache

License

Notifications You must be signed in to change notification settings

Product-Foundry/beard

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Beard: A Blazing-Fast Template Engine

Build Status

Beard is an open-source, logic-less templating engine, written in Scala and inspired by Mustache. You can use it out-of-the-box; see the Requirements list below.

What makes Beard powerful:

  • Streaming. As soon as you need to render something, you can stream it to the browser. This provides high user-perceived performance.
  • Speed. We've benchmarked it against other template engines for the JVM, and Beard performed much faster in terms of rendering time. (We invite you to run your own benchmarks to see if you get the same results.) It also uses ANTLR to make template compilation fast.
  • It offers template inheritance.
  • Its simple, beautiful syntax. A la Mustache, it uses only the { and } markers for tags and delimiters.

Here's a code snippet to show you how simply Beard can parse templates:

<html>
  <head>
	<title>{{ the.title }}</title>
  </head>
  <body>
	{{ the.content }}
  </body>
</html>

Requirements

  • Scala 2.10 or 2.11
  • a package manager like sbt or Maven

Installing

If you're using sbt, add this line to your build.sbt file:

libraryDependencies += "de.zalando" %% "beard" % "0.1.2"

resolvers ++= Seq(
  "zalando-maven" at "https://dl.bintray.com/zalando/maven"
)

If you're using Maven, run this:

<dependency>
	<groupId>de.zalando</groupId>
	<artifactId>beard</artifactId>
	<version>0.1.2</version>
</dependency>

Binaries are available from bintray

Additional Documentation

We've started a Gitbook for additional docs. There, you'll find more information on:

You can contribute to this documentation here.

##Contributing/TODO List

We gladly welcome contributions—just submit a pull request with a short note summarizing briefly (1-2 sentences) what you've done. If you'd like to make a substantial contribution to Beard, we could use your help with these items:

  • adding filters: ind Handlebars, Angular, Twig, etc.
  • providing more meaningful error messages
  • XSS prevention; see related issue

About

A lightweight logicless templating engine, written in Scala and inspired by Mustache

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Scala 89.7%
  • HTML 5.0%
  • ANTLR 3.8%
  • FreeMarker 1.5%