HTML template engine for Go
Go
Switch branches/tags
Clone or download
Permalink
Failed to load latest commit information.
cmd/ace Add command line tool to compile Ace into HTML with Go template syntax Dec 4, 2014
documentation Adding a simple cli utility for your ace template engine to the list. Jan 2, 2016
examples add an example to demonstrate using link and script tags from externa… Oct 17, 2015
.gitignore Initial commit Jul 13, 2014
LICENSE Initial commit Jul 13, 2014
README.md Tools - add Atom syntax highlighter Oct 28, 2015
ace.go all: gofmt Jun 16, 2018
action.go Implement output formatter Jul 20, 2016
comment.go Update files Jul 26, 2014
compile.go New .NoCloseTagNames option & public InitializeOptions May 14, 2015
compile_test.go go fmt compile_test.go Oct 9, 2014
doc.go Add read.go Jul 14, 2014
element.go Implement output formatter Jul 20, 2016
element_base.go Implement output formatter Jul 20, 2016
element_test.go Add element_test.go Jul 26, 2014
empty_element.go Update files Jul 26, 2014
file.go Update files Jul 26, 2014
formatter.go Implement output formatter Jul 20, 2016
formatter_test.go Implement output formatter Jul 20, 2016
helper_method_conditional_comment.go Add a pre defined func Jul 27, 2014
helper_method_content.go Implement output formatter Jul 20, 2016
helper_method_css.go Update files Jul 26, 2014
helper_method_doctype.go Append a file name to the error messages Jul 26, 2014
helper_method_include.go Update helper_method_include.go Sep 23, 2014
helper_method_javascript.go Update files Jul 26, 2014
helper_method_yield.go Append a file name to the error messages Jul 26, 2014
html_comment.go Add a pre defined func Jul 27, 2014
html_tag.go Implement output formatter Jul 20, 2016
line.go Implement output formatter Jul 20, 2016
options.go Implement output formatter Jul 20, 2016
parse.go New .NoCloseTagNames option & public InitializeOptions May 14, 2015
plain_text.go Update plain_text.go Jul 27, 2014
plain_text_inner.go Update plain_text_inner.go Jul 26, 2014
read.go Add an asset option Jul 26, 2014
result.go Add element_base.go Jul 17, 2014
source.go Update files Jul 26, 2014
wercker.yml Update wercker.yml Oct 1, 2014

README.md

Ace - HTML template engine for Go

wercker status GoDoc

Overview

Ace is an HTML template engine for Go. This is inspired by Slim and Jade. This is a refinement of Gold.

Example

= doctype html
html lang=en
  head
    title Hello Ace
    = css
      h1 { color: blue; }
  body
    h1 {{.Msg}}
    #container.wrapper
      p..
        Ace is an HTML template engine for Go.
        This engine simplifies HTML coding in Go web application development.
    = javascript
      console.log('Welcome to Ace');

becomes

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Hello Ace</title>
    <style type="text/css">
      h1 { color: blue; }
    </style>
  </head>
  <body>
    <h1>Hello Ace</h1>
    <div id="container" class="wrapper">
      <p>
        Ace is an HTML template engine for Go.<br>
        This engine simplifies HTML coding in Go web application development.
      </p>
    </div>
    <script type="text/javascript">
      console.log('Welcome to Ace');
    </script>
  </body>
</html>

Features

Making Use of the Go Standard Template Package

Ace fully utilizes the strength of the html/template package. You can embed actions of the template package in Ace templates. Ace also uses nested template definitions of the template package and Ace templates can pass pipelines (parameters) to other templates which they include.

Simple Syntax

Ace has a simple syntax and this makes template files simple and light.

Caching Function

Ace has a caching function which caches the result data of the templates parsing process. You can omit the templates parsing process and save template parsing time by using this function.

Binary Template Load Function

Ace has a binary template load function which loads Ace templates from binary data in memory instead of template files on disk. You can compile your web application into one binary file by using this function. go-bindata is the best for generating binary data from template files.

Getting Started

Please check the following documentation.

  • Getting Started - shows the getting started guide.
  • Examples - shows the examples of the web applications which use the Ace template engine.

Documentation

You can get the documentation about Ace via the following channels:

  • Documentation - includes the getting started guide and the syntax documentation.
  • GoDoc - includes the API documentation.

Discussion & Contact

You can discuss Ace and contact the Ace development team via the following channels:

Contributions

Any contributions are welcome. Please feel free to create an issue or send a pull request.

Renderers for web frameworks

Tools

  • vim-ace - Vim syntax highlighting for Ace templates
  • ace-tmbundle - TextMate/Sublime syntax highlighting for Ace templates
  • atom-ace - Atom Editor syntax highlighting for Ace templates

Projects using Ace

Here is the list of the projects using Ace. Please feel free to add your awesome project to the list!