Top 1K Features Creators Events Podcasts Books Extensions Interviews Blog Explorer CSV

Closure Templates

< >

Closure Templates is an open source template language created in 2009.

#424on PLDB 15Years Old 424kRepos
Download source code:
git clone https://github.com/google/closure-templates
Source Code

A client- and server-side templating system that helps you dynamically build reusable HTML and UI elements


Example from the web:
/** * Says hello to the world. */ {template .helloWorld} Hello world! {/template}
Example from Linguist:
{namespace Exmaple} /** * Example */ {template .foo} {@param count: string} {@param? name: int} {if isNonnull($name)} <h1>{$name}</h1> {/if} <div class="content"> {switch count} {case 0} {call Empty.view} {param count: $count /} {/call} {default} <h2>Wow, so many!</h2> {/switch} </div> {/template}

Language features

Feature Supported Example Token
Comments ✓ /* A comment */
MultiLine Comments ✓ /* A comment */ /* */
Semantic Indentation X
View source
- Build the next great programming language · About · Keywords · Resources · Acknowledgements · Part of the World Wide Scroll