renderer

package
v0.0.0-...-e64dc14 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2016 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Copyright 2011 Viktor Kojouharov. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Package renderer provides a helper type for rendering html/template files. There is always a 'base' template, which acts as an initial template onto which functions may be registered and used in the subsequent template chain. Each template chain always ends with the 'base' template, and is cached after being parsed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RenderCtx

type RenderCtx func(w io.Writer, data RenderData, names ...string) error

type RenderData

type RenderData map[string]interface{}

type Renderer

type Renderer interface {
	BaseName() string
	SetBaseName(string)
	Funcs(template.FuncMap)
	Delims(left, right string)
	SkipCache(skip ...bool) bool
	Render(w io.Writer, data RenderData, cdata context.ContextData, names ...string) error
}

func NewRenderer

func NewRenderer(path, base string) Renderer

NewRenderer creates a new renderer object. The path points to a directory containing the template files. The base is the name of the file for the 'base' template.

Jump to

Keyboard shortcuts

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