mustache

package
v0.4.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2014 License: BSD-2-Clause, BSD-2-Clause Imports: 10 Imported by: 0

README

mussed

Mussed is a nearly mustache template library that maps to text/template/parse Trees instead of being a complete template library.

Divergences from Mustache

  • Quote characters are escaped with the Code instead of the Entity Name
  • Templates that aren't found are treated as fatal errors instead of empty strings
  • On the third partials test, Go is more proactive than mustache and escaped '<'s where an average mustache would not
  • Partials do not inherit the indentation of their caller, this was found on partial specs 7-9.

Documentation

Overview

mustache is a package to parse the mustache template format into the Tree format needed by multitemplate. In general, this implementation follows the base mustache specification, with no significant changes. However this implementation does diverge in respect to templates functions, (lambdas in mustache speak). Fill in this section when lambda's are completed.

Lambdas that are called as if statements will have their returns taken and used to set the dot value, or quite similar to the with statement from Go's stdlib template libraries.

Index

Constants

This section is empty.

Variables

View Source
var (
	LeftDelim        = "{{"
	RightDelim       = "}}"
	LeftEscapeDelim  = "{{{"
	RightEscapeDelim = "}}}"
)

Functions

func Parse

func Parse(templateName, templateContent string, funcs ht.FuncMap) (map[string]*parse.Tree, error)

Types

type MustacheParser

type MustacheParser string

func (MustacheParser) ApplicableExtensions

func (mp MustacheParser) ApplicableExtensions() []string

func (MustacheParser) ParseFile

func (mp MustacheParser) ParseFile(name, content string) (map[string]*parse.Tree, error)

func (MustacheParser) RequiredHtmlFuncs

func (mp MustacheParser) RequiredHtmlFuncs() htmlTemplate.FuncMap

func (MustacheParser) RequiredTextFuncs

func (mp MustacheParser) RequiredTextFuncs() textTemplate.FuncMap

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL