mustache

package module
v0.0.0-...-5e680b3 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2020 License: MIT Imports: 10 Imported by: 2

README

Fork of hoisie/mustache.

This fork is purpose-specific (for maud), feedback is appreciated but what's gone is gone.

TODO:

  • (Optional) Dot notation support, one that works with structs

REMOVED:

  • Partials
  • call / callMethod (weren't used anyway)

DONE:

  • Loop indices (ex. {{#Array:index}}) + tests
  • Merged hoisie#33 hoisie#37 hoisie#42

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render

func Render(data string, context ...interface{}) string

func RenderFile

func RenderFile(filename string, context ...interface{}) string

func RenderFileInLayout

func RenderFileInLayout(filename string, layoutFile string, context ...interface{}) string

func RenderInLayout

func RenderInLayout(data string, layoutData string, context ...interface{}) string

Types

type Template

type Template struct {
	// contains filtered or unexported fields
}

func ParseFile

func ParseFile(filename string) (*Template, error)

func ParseString

func ParseString(data string) (*Template, error)

func (*Template) Render

func (tmpl *Template) Render(context ...interface{}) string

func (*Template) RenderInLayout

func (tmpl *Template) RenderInLayout(layout *Template, context ...interface{}) string

Jump to

Keyboard shortcuts

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