Amber is an elegant templating engine for Go Programming Language, inspired from HAML and Jade

Related tags

amber
Overview

amber GoDoc Build Status

Notice

While Amber is perfectly fine and stable to use, I've been working on a direct Pug.js port for Go. It is somewhat hacky at the moment but take a look at Pug.go if you are looking for a Pug.js compatible Go template engine.

Usage

import "github.com/eknkc/amber"

Amber is an elegant templating engine for Go Programming Language It is inspired from HAML and Jade

Tags

A tag is simply a word:

html

is converted to

<html></html>

It is possible to add ID and CLASS attributes to tags:

div#main
span.time

are converted to

<div id="main"></div>
<span class="time"></span>

Any arbitrary attribute name / value pair can be added this way:

a[href="http://www.google.com"]

You can mix multiple attributes together

a#someid[href="/"][title="Main Page"].main.link Click Link

gets converted to

<a id="someid" class="main link" href="/" title="Main Page">Click Link</a>

It is also possible to define these attributes within the block of a tag

a
    #someid
    [href="/"]
    [title="Main Page"]
    .main
    .link
    | Click Link

Doctypes

To add a doctype, use !!! or doctype keywords:

!!! transitional
// <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

or use doctype

doctype 5
// <!DOCTYPE html>

Available options: 5, default, xml, transitional, strict, frameset, 1.1, basic, mobile

Tag Content

For single line tag text, you can just append the text after tag name:

p Testing!

would yield

<p>Testing!</p>

For multi line tag text, or nested tags, use indentation:

html
    head
        title Page Title
    body
        div#content
            p
                | This is a long page content
                | These lines are all part of the parent p

                a[href="/"] Go To Main Page

Data

Input template data can be reached by key names directly. For example, assuming the template has been executed with following JSON data:

{
  "Name": "Ekin",
  "LastName": "Koc",
  "Repositories": [
    "amber",
    "dateformat"
  ],
  "Avatar": "/images/ekin.jpg",
  "Friends": 17
}

It is possible to interpolate fields using #{}

p Welcome #{Name}!

would print

<p>Welcome Ekin!</p>

Attributes can have field names as well

a[title=Name][href="/ekin.koc"]

would print

<a title="Ekin" href="/ekin.koc"></a>

Expressions

Amber can expand basic expressions. For example, it is possible to concatenate strings with + operator:

p Welcome #{Name + " " + LastName}

Arithmetic expressions are also supported:

p You need #{50 - Friends} more friends to reach 50!

Expressions can be used within attributes

img[alt=Name + " " + LastName][src=Avatar]

Variables

It is possible to define dynamic variables within templates, all variables must start with a $ character and can be assigned as in the following example:

div
    $fullname = Name + " " + LastName
    p Welcome #{$fullname}

If you need to access the supplied data itself (i.e. the object containing Name, LastName etc fields.) you can use $ variable

p $.Name

Conditions

For conditional blocks, it is possible to use if <expression>

div
    if Friends > 10
        p You have more than 10 friends
    else if Friends > 5
        p You have more than 5 friends
    else
        p You need more friends

Again, it is possible to use arithmetic and boolean operators

div
    if Name == "Ekin" && LastName == "Koc"
        p Hey! I know you..

There is a special syntax for conditional attributes. Only block attributes can have conditions;

div
    .hasfriends ? Friends > 0

This would yield a div with hasfriends class only if the Friends > 0 condition holds. It is perfectly fine to use the same method for other types of attributes:

div
    #foo ? Name == "Ekin"
    [bar=baz] ? len(Repositories) > 0

Iterations

It is possible to iterate over arrays and maps using each:

each $repo in Repositories
    p #{$repo}

would print

p amber
p dateformat

It is also possible to iterate over values and indexes at the same time

each $i, $repo in Repositories
    p
        .even ? $i % 2 == 0
        .odd ? $i % 2 == 1

Mixins

Mixins (reusable template blocks that accept arguments) can be defined:

mixin surprise
    span Surprise!
mixin link($href, $title, $text)
    a[href=$href][title=$title] #{$text}

and then called multiple times within a template (or even within another mixin definition):

div
	+surprise
	+surprise
    +link("http://google.com", "Google", "Check out Google")

Template data, variables, expressions, etc., can all be passed as arguments:

+link(GoogleUrl, $googleTitle, "Check out " + $googleTitle)

Imports

A template can import other templates using import:

a.amber
    p this is template a

b.amber
    p this is template b

c.amber
    div
        import a
        import b

gets compiled to

div
    p this is template a
    p this is template b

Inheritance

A template can inherit other templates. In order to inherit another template, an extends keyword should be used. Parent template can define several named blocks and child template can modify the blocks.

master.amber
    !!! 5
    html
        head
            block meta
                meta[name="description"][content="This is a great website"]

            title
                block title
                    | Default title
        body
            block content

subpage.amber
    extends master

    block title
        | Some sub page!

    block append meta
        // This will be added after the description meta tag. It is also possible
        // to prepend someting to an existing block
        meta[name="keywords"][content="foo bar"]

    block content
        div#main
            p Some content here

License

(The MIT License)

Copyright (c) 2012 Ekin Koc [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Usage

var DefaultOptions = Options{true, false}
var DefaultDirOptions = DirOptions{".amber", true}

func Compile

func Compile(input string, options Options) (*template.Template, error)

Parses and compiles the supplied amber template string. Returns corresponding Go Template (html/templates) instance. Necessary runtime functions will be injected and the template will be ready to be executed.

func CompileFile

func CompileFile(filename string, options Options) (*template.Template, error)

Parses and compiles the contents of supplied filename. Returns corresponding Go Template (html/templates) instance. Necessary runtime functions will be injected and the template will be ready to be executed.

func CompileDir

func CompileDir(dirname string, dopt DirOptions, opt Options) (map[string]*template.Template, error)

Parses and compiles the contents of a supplied directory name. Returns a mapping of template name (extension stripped) to corresponding Go Template (html/template) instance. Necessary runtime functions will be injected and the template will be ready to be executed.

If there are templates in subdirectories, its key in the map will be it's path relative to dirname. For example:

templates/
   |-- index.amber
   |-- layouts/
         |-- base.amber
templates, err := amber.CompileDir("templates/", amber.DefaultDirOptions, amber.DefaultOptions)
templates["index"] // index.amber Go Template
templates["layouts/base"] // base.amber Go Template

By default, the search will be recursive and will match only files ending in ".amber". If recursive is turned off, it will only search the top level of the directory. Specified extension must start with a period.

type Compiler

type Compiler struct {
	// Compiler options
	Options
}

Compiler is the main interface of Amber Template Engine. In order to use an Amber template, it is required to create a Compiler and compile an Amber source to native Go template.

compiler := amber.New()
// Parse the input file
err := compiler.ParseFile("./input.amber")
if err == nil {
	// Compile input file to Go template
	tpl, err := compiler.Compile()
	if err == nil {
		// Check built in html/template documentation for further details
		tpl.Execute(os.Stdout, somedata)
	}
}

func New

func New() *Compiler

Create and initialize a new Compiler

func (*Compiler) Compile

func (c *Compiler) Compile() (*template.Template, error)

Compile amber and create a Go Template (html/templates) instance. Necessary runtime functions will be injected and the template will be ready to be executed.

func (*Compiler) CompileString

func (c *Compiler) CompileString() (string, error)

Compile template and return the Go Template source You would not be using this unless debugging / checking the output. Please use Compile method to obtain a template instance directly.

func (*Compiler) CompileWriter

func (c *Compiler) CompileWriter(out io.Writer) (err error)

Compile amber and write the Go Template source into given io.Writer instance You would not be using this unless debugging / checking the output. Please use Compile method to obtain a template instance directly.

func (*Compiler) Parse

func (c *Compiler) Parse(input string) (err error)

Parse given raw amber template string.

func (*Compiler) ParseFile

func (c *Compiler) ParseFile(filename string) (err error)

Parse the amber template file in given path

type Options

type Options struct {
	// Setting if pretty printing is enabled.
	// Pretty printing ensures that the output html is properly indented and in human readable form.
	// If disabled, produced HTML is compact. This might be more suitable in production environments.
	// Defaukt: true
	PrettyPrint bool
	// Setting if line number emitting is enabled
	// In this form, Amber emits line number comments in the output template. It is usable in debugging environments.
	// Default: false
	LineNumbers bool
}

type DirOptions

// Used to provide options to directory compilation
type DirOptions struct {
	// File extension to match for compilation
	Ext string
	// Whether or not to walk subdirectories
	Recursive bool
}
Issues
  • Support for virtual filesystems

    Support for virtual filesystems

    I needed to add support for virtual filesystems (ex. implementing net/http.FileSystem interface) for a project I am working on which then compiles to a single standalone binary without any external resources so I am opening this PR to get suggestions what to improve and eventually merge it into master.

    opened by zet4 5
  • Input close tag

    Input close tag

    I have asked in the golang g+ forum about this issue, i can't generate output like this using amber: <input type="text" name="email" size="30" />

    they are always give result like this <input type="text" name="email" size="30"></input> so what i want is just that simple. my question: is it by design or not yet implemented? thanks

    opened by susilolab 4
  • Inconsistent order of attribute iteration

    Inconsistent order of attribute iteration

    Currently attributes are put into a map in Compiler.visitTag() method. Since Go uses randomized order of iteration for maps - this results in different HTML files generated from the same amber file every time you compile them.

    This implies that one can't keep compiled HTMLs under version control because amber compilation is not reproducible. Also, one can't test amber templates because the HTML output is always random, so you can't compare it to a certain expected value.

    A possible fix would be to keep attributes in a slice and use a special node pointer for the special class attribute.

    P.S. On a side note, is this project still alive? Most open issues are half a year old.. Amber seems to be the only sane lightweight HTML markup compiler for Go, it would be a big loss if it's not under development anymore.

    opened by zserge 3
  • Incorrect inline-style

    Incorrect inline-style

    One item in style is fine: p[style="color:black"] => <p style="color:black"></p>

    However, with multiple items there, the output is wired: p[style="color:black; background:write"] => <p style="ZgotmplZ"></p>

    Even with a semicolon appended, the output is not correct: p[style="color:black;"] => <p style="ZgotmplZ"></p>

    The same style in Jade and Slim are fine. Am I missing any document about this?

    opened by adamzy 3
  • Do not evaluate conditional attributes until condition is satisfied

    Do not evaluate conditional attributes until condition is satisfied

    Template:

    input
        [value=row.Value] ? row != nil
    

    Produces error, if row is nil:

    template: .:1:20: executing "." at <.row.Value>: can't evaluate field Value in type interface {}
    

    row.Value should not be evaluated until row != nil is satisfied.

    opened by seletskiy 3
  • Export funcMap or provide it as an Option

    Export funcMap or provide it as an Option

    It would be nice if you provided a means to add functions to the template via the funcMap. At the moment, the funcMap variable is private (in runtime.go). A simple way to be open to extensions would be to make this variable public, although package users could remove/replace the existing, required runtime functions (can be seen both as a feature or a bug, really).

    Another (more controlled) way to provide this flexibility would be to add a template.FuncMap field in the Options, and this map would extend the internal funcMap.

    My basic need for this is to provide a function to format a time.Time value, but this seems like a nice generic feature to add (which obviously is present with the native Go functions). I wanted to discuss it first, but if you're ok with one of the proposals, I'd be happy to send a PR.

    opened by mna 2
  • Parsing data without converting to string

    Parsing data without converting to string

    Making it possible to read the contents of a file and providing both the contents and the filename to Amber, as an alternative to Amber reading the file (or a string, without a filename).

    This avoids a conversion from []byte to string in algernon and also makes it possible to manipulate the bytes before sending them to Amber, while keeping the functionality that is available when the Amber parser has been given a filename.

    Please accept, reject or ask me to make changes to the pull request.

    Best regards, Alexander F Rødseth

    opened by xyproto 2
  • Command-line version

    Command-line version

    I just saw amber, and from the readme, it looks absolutely awesome!

    One thing that I wish you'd add is a standalone command line for amber, so you could compile amber files without having to write a script that does that.

    opened by SEAPUNK 2
  • "Import"ing header.amber issue

    Hi there,

    I'm finding that when I have header.amber:

    !!! 5
    html
        head
            title #{title}
            link[href="assets/build/app.css"][rel="stylesheet"]
        body
    

    ...and a whatever.amber:

    import header
        h1 foobar!
    

    ...the resulting HTML is invalid:

    <!DOCTYPE html>
    <html>
        <head>
            <title>Baz</title>
            <link href="assets/build/app.css" rel="stylesheet" />
        </head>
        <body></body>
    </html>
    <h1>foobar!</h1>
    

    Whenever a "child" amber file is "import"ed, valid markup results (as seen in the README). The use-case I've described above seems to result in invalid markup, however (child "import"ing parent file). Just for reference, I have a convenience "AmberParser" struct (I plan on open sourcing this soon!) that takes an amber file and JSON options and then uses amber's ParseFile(), Compile(), and tpl.Execute().

    Is this use-case simply not supported or am I missing something?

    Thanks and I enjoy using Amber! At the moment, it's the closest thing to actual Jade in the Golang world!

    -Matthew Vita

    opened by MatthewVita 2
  • Unescaped html?

    Unescaped html?

    Is there a way to print unescaped HTML text? I pass some text through blackfriday (markdown library) to generate HTML, and try to print it in an amber template using the #{variable} notation, but I always get it escaped (it prints the tags and all in the rendered document, instead of interpreting the HTML).

    I know this is possible in Jade, the "inspiration" for amber, but I haven't found anything about such a feature in the docs or a quick look at the code.

    Thanks, Martin

    opened by mna 2
  • Added Power Support ppc64le

    Added Power Support ppc64le

    Added power support for the travis.yml file with ppc64le. This is part of the Ubuntu distribution for ppc64le. This helps us simplify testing later when distributions are re-building and re-releasing. Thank you.

    opened by nagesh4193 1
  • runtime error: invalid memory address or nil pointer dereference

    runtime error: invalid memory address or nil pointer dereference

    We are experiencing issues compiling our templates. Any help or recommendations will be extremely useful and appreciated. the error gotten is " runtime error: invalid memory address or nil pointer dereference - Line: 41, Column: 5, Length: 3 STACK:"

    The script being compiled contains the following code, I cant seem to solve the issue.

    **`extends ./../layout

    block menu +topMenu("items")

    block left_menu +leftMenu("items")

    block content $selectedPage = Page $selectedCity = CityID $selectedCategory = CategoryID $selectedShippingTo = ShippingTo $selectedShippingFrom = ShippingFrom $viewUser = ViewUser $sortby = SortBy $account = Account $l = Localization div.ui.grid.stackable.divided div.three.wide.column.t-left-menu-items if EnableStoreStaffUI if ViewUserStore.VerificationRequired a.ui.button.red.fluid[href="/verification/encryption"] #{Localization.Auth.VerifyAccount} div.ui.section.divider.left-menu if !HideAdvertisings import ./../advertising/partial_advertising import C:\Users\user\go\src\marketplaceproject-clone\student-free-market\deploy\package\templates\mixin_right_menu.amber $SelectedPackageType = SelectedPackageType $Localization = Localization $ShippingFrom = ShippingFrom $ShippingFromList = ShippingFromList $ShippingTo = ShippingTo $ShippingToList = ShippingToList $City = City $GeoCities = GeoCities $SortBy = SortBy $Category = Category $SubCategory = SubCategory $Query = Query +RightMenu($SelectedPackageType, $Localization, $ShippingFrom, $ShippingFromList, $ShippingTo, $ShippingToList, $SelectedPackageType, $City, $GeoCities, $SortBy, $Category, $SubCategory, $Query) div.thirteen.wide.column form.ui.input.icon.fluid[method="GET"][action="/marketplace"] input[type="hidden"][name="category"][value=0] input[type="hidden"][name="subcategory"][value=0] input[type="text"][name="query"][placeholder=Localization.Items.LookingFor][value=Query] i.icon.search div.ui.four.item.menu.secondary.pointing a.item[href="/marketplace/"] [class="active"] ? SelectedPackageType == "all" i.icon.filter | #{Localization.Items.AllTypes} a.item[href="/marketplace/mail/"] [class="active"] ? SelectedPackageType == "mail" i.icon.envelope.open.outline | #{Localization.Items.Mail} a.item[href="/marketplace/drop/"] [class="active"] ? SelectedPackageType == "drop" i.icon.sticky.note.outline | #{Localization.Items.Drop} a.item[href="/marketplace/drop preorder/"] [class="active"] ? SelectedPackageType == "drop preorder" i.icon.warehouse | #{Localization.Items.DropPreorder} if len(ViewSerpItems) > 0 div.ui.grid.stackable each $item in ViewSerpItems div.four.wide.column import ./mixin_item_row $i = $item $u = $viewUser +itemRow($i, $u, $l) if len(ViewSerpItems) == 0 div.ui.icon.message i.icon.cart div.content div.header #{Localization.Items.NoItems} if len(Pages) > 1 $query = Query div.ui.section.divider div.ui.pagination.menu.mini each $page in Pages div.item .active ? $page == $selectedPage a[href="?page="+$page + "&city="+$selectedCity + "&category="+$selectedCategory + "&sortby="+$sortby + "&account="+$account + "&shipping-to="+$selectedShippingTo + "&shipping-from="+$selectedShippingFrom + "&query=" + $query] #{$page} `**

    opened by ankemzi 0
  • variables not work with extends and import

    variables not work with extends and import

    eg. _layout.amber:

    !!! 5
    html
        body
            import inc/_sidebar
    

    inc/_sidebar.amber:

    div.test #{$activePage}
    

    and rendered page is home.amber:

    extends _layout
    $activePage = "dashboard"
    

    this won't work, with err: undefined variable "$activePage"

    opened by yockii 0
  • Small typo in README.md

    Small typo in README.md

    type Options

    type Options struct {
    	// Setting if pretty printing is enabled.
    	// Pretty printing ensures that the output html is properly indented and in human readable form.
    	// If disabled, produced HTML is compact. This might be more suitable in production environments.
    	// Defaukt: true
    	PrettyPrint bool
    	// Setting if line number emitting is enabled
    	// In this form, Amber emits line number comments in the output template. It is usable in debugging environments.
    	// Default: false
    	LineNumbers bool
    }
    

    Typo in text // Defaukt: true

    opened by mezoni 0
  • how to add js functions in template

    how to add js functions in template

    Hi Sorry for such question because i am new to templates can any one tell me how to add Javascript functions in template.

    opened by HafeezRai 0
  • Issues with conditional attributes

    Issues with conditional attributes

    Bug 1: Whenever there are no default classes being included on a tag and all the included classes are with conditional values, the template is not rendered according to the expectations.

    Reproduction guide: Run the following template:

    $var_1 = 20
    div
        .foo ? $var_1 == 10
        .bar ? $var_1 == 20
    

    Compiled template:

    {{$var_1 := 20}}{{$__amber_1 := __amber_eql $var_1 10}}{{$__amber_2 := __amber_eql $var_1 20}}
    <div{{if $__amber_1}} class="{{if $__amber_1}}foo{{end}} {{if $__amber_2}}bar{{end}}"{{end}}></div>
    

    Expected result:

    <div class="bar"></div>
    

    Real result:

    <div></div>
    

    Bug 2: Whenever adding attributes to a tag, if the same attribute appears multiple times with different conditions, just the latest one is considered.

    Reproduction guide: Run the following template:

    $var_1 = 10
    div
        [foo="bar"] ? $var_1 == 10
        [foo="zaz"] ? $var_1 == 20
    

    Compiled template:

    {{$var_1 := 20}}{{$__amber_1 := __amber_eql $var_1 10}}{{$__amber_2 := __amber_eql $var_1 20}}
    <div{{if $__amber_2}} foo="zaz"{{end}}></div>
    

    Expected result:

    <div foo="bar"></div>
    

    Real result:

    <div></div>
    

    Version: Latest

    opened by honux 0
  • Mixin blocks from Pug or mixins are parameters

    Mixin blocks from Pug or mixins are parameters

    I'm trying to achieve something using Amber that I regularly used in Pug. It would be best described as an example from the Pug documentation:

    Mixins can also take a block of Pug to act as the content:

    mixin article(title)
      .article
        .article-wrapper
          h1= title
          if block
            block
          else
            p No content provided
    
    +article('Hello world')
    
    +article('Hello world')
      p This is my
      p Amazing article
    

    The resulting HTML:

    <div class="article">
      <div class="article-wrapper">
        <h1>Hello world</h1>
        <p>No content provided</p>
      </div>
    </div>
    <div class="article">
      <div class="article-wrapper">
        <h1>Hello world</h1>
        <p>This is my</p>
        <p>Amazing article</p>
      </div>
    </div>
    

    I tried the same code with Amber but it just ignores it.

    I also tried sending mixins as parameters of a mixin. This also doesn't seem possible:

     +header("Header Text")        
     +twocolumns(+header, +header) 
    

    Any workaround for this?

    opened by fanmanpro 0
  • Option to change tag attributes to other markup like Pug

    Option to change tag attributes to other markup like Pug

    I wanna change the markup for tag attributes to a(href="", style="") Using a[href=""][style=""] would have no highlight on any editor.

    I've tried your Pug package but there are numerous errors. Any chance?

    opened by dzpt 0
  • Always disregard blank lines in template

    Always disregard blank lines in template

    I am seeing some issues with how templates are parsed when blank lines are present.

    This:

    div.content
    
      div.inner-content Hello!
    

    will generate:

    <div class="content"></div>
    <div class="inner-content">Hello!</div>
    

    whereas this:

    div.content
      div.inner-content Hello!
    

    will generate:

    <div class="content">
      <div class="inner-content">Hello!</div>
    </div>
    

    Along these same lines, I've noticed that a blank line immediately following an each statement will lose the variable scope:

    each $x in Collection
    
      div.row #{$x.Name}
    

    This will throw an error undefined variable "$x"

    opened by jmcnevin 0
  • Iterations issues

    Iterations issues

    for example : a[href="path?id="+$repo.ID]; the value of href will be messy code

    i want to know how to solve it

    opened by cuiyancong 0
Owner
Ekin Koc
kovan.io -- also co founder of onedio.com
Ekin Koc
HTML template engine for Go

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

Keiji Yoshida 803 Sep 10, 2021
A strongly typed HTML templating language that compiles to Go code, and has great developer tooling.

A language, command line tool and set of IDE extensions that makes it easier to write HTML user interfaces and websites using Go.

Adrian Hesketh 80 Jul 25, 2021
pongo2 is a Django-syntax like templating-language

Django-syntax like template-engine for Go

Florian Schlachter 2k Sep 14, 2021
An ERB-style templating language for Go.

Ego Ego is an ERb style templating language for Go. It works by transpiling templates into pure Go and including them at compile time. These templates

Ben Johnson 504 Sep 13, 2021
Package damsel provides html outlining via css-selectors and common template functionality.

Damsel Markup language featuring html outlining via css-selectors, extensible via pkg html/template and others. Library This package expects to exist

Daniel Skinner 24 Sep 12, 2020
A sweet velvety templating package

Velvet Velvet is a templating package for Go. It bears a striking resemblance to "handlebars" based templates, there are a few small changes/tweaks, t

Buffalo - The Go Web Eco-System 71 Aug 15, 2021
A complete Liquid template engine in Go

Liquid Template Parser liquid is a pure Go implementation of Shopify Liquid templates. It was developed for use in the Gojekyll port of the Jekyll sta

Oliver Steele 134 Sep 3, 2021
Templating system for HTML and other text documents - go implementation

FAQ What is Kasia.go? Kasia.go is a Go implementation of the Kasia templating system. Kasia is primarily designed for HTML, but you can use it for any

Michał Derkacz 72 May 4, 2021
Programatic document generation as a HTTP service. Render PDFs using LaTeX templates and JSON.

LaTTe Generate PDFs using LaTeX templates and JSON. Try out the demo! Find LaTTe on Docker Hub Table of Contents About Obtaining LaTTe Running & Using

Raphael Reyna 164 Aug 25, 2021
Fast, powerful, yet easy to use template engine for Go. Optimized for speed, zero memory allocations in hot paths. Up to 20x faster than html/template

quicktemplate A fast, powerful, yet easy to use template engine for Go. Inspired by the Mako templates philosophy. Features Extremely fast. Templates

Aliaksandr Valialkin 2.2k Sep 12, 2021
Goview is a lightweight, minimalist and idiomatic template library based on golang html/template for building Go web application.

goview Goview is a lightweight, minimalist and idiomatic template library based on golang html/template for building Go web application. Contents Inst

foolin 244 Aug 31, 2021
Jet template engine

Jet Template Engine for Go Jet is a template engine developed to be easy to use, powerful, dynamic, yet secure and very fast. simple and familiar synt

null 829 Sep 7, 2021
The powerful template system that Go needs

Plush Plush is the templating system that Go both needs and deserves. Powerful, flexible, and extendable, Plush is there to make writing your template

Buffalo - The Go Web Eco-System 655 Sep 7, 2021
Razor view engine for go

gorazor gorazor is the Go port of the razor view engine originated from asp.net in 2011. In summary, gorazor is: Extremely Fast. Templates are convert

null 787 Sep 13, 2021
The world’s most powerful template engine and Go embeddable interpreter.

The world’s most powerful template engine and Go embeddable interpreter

Open2b 17 Sep 15, 2021
Article spinning and spintax/spinning syntax engine written in Go, useful for A/B, testing pieces of text/articles and creating more natural conversations

GoSpin Article spinning and spintax/spinning syntax engine written in Go, useful for A/B, testing pieces of text/articles and creating more natural co

Miles Croxford 28 Sep 3, 2021
Simple system for writing HTML/XML as Go code. Better-performing replacement for html/template and text/template

Simple system for writing HTML as Go code. Use normal Go conditionals, loops and functions. Benefit from typing and code analysis. Better performance than templating. Tiny and dependency-free.

Nelo Mitranim 3 Sep 8, 2021
A PDF document generator with high level support for text, drawing and images

GoFPDF document generator Package gofpdf implements a PDF document generator with high level support for text, drawing and images. Features UTF-8 supp

Kurt Jung 3.9k Sep 12, 2021
A template to build dynamic web apps quickly using Go, html/template and javascript

gomodest-template A modest template to build dynamic web apps in Go, HTML and sprinkles and spots of javascript. Why ? Build dynamic websites using th

Adnaan Badr 54 Aug 28, 2021