mustache

package module
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2019 License: MIT Imports: 8 Imported by: 2

README

Mustache - v0.10.0

Copyright 2019 Erik Lott. All rights reserved. Use of this source code is governed by a MIT license that can be found in the LICENSE file.

Click To View Documentation.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Template

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

Template is the representation of a parsed template.

func NewTemplate

func NewTemplate() *Template

NewTemplate allocates a new template.

func (*Template) Parse

func (t *Template) Parse(name, text string) error

Parse adds a mustache string to the template, making it available to render by name via the Render method, or using a partial tag. If an error occurs during parsing, the parsing process stops, and the error is returned.

func (*Template) Render

func (t *Template) Render(name string, contexts ...interface{}) (string, error)

Render applies a data context to a parsed template and returns the output as a string. If an error occurs, the rendering process stops and the error is returned.

Directories

Path Synopsis
internal
ast

Jump to

Keyboard shortcuts

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