templateHelper

package
v0.0.0-...-6b4cc3a Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2019 License: MIT Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddTemplate

func AddTemplate(t *templateHTML.Template, name string) (*templateHTML.Template, error)

AddTemplate gets the Template structure with the given template name (as set in configuration file).

func AddTemplateGroup

func AddTemplateGroup(t *templateHTML.Template, groupName string) (*templateHTML.Template, error)

AddTemplateGroup is like AddTemplate but instead of adding a single named template it adds all templates of the specified group.

func AddTemplateHelperSettingDecoders

func AddTemplateHelperSettingDecoders()

AddTemplateHelperSettingDecoders adds a decoder for the template Helper setting format in the config file.

func ProcessTemplateHTML

func ProcessTemplateHTML(templateFileBuffer *[]byte, out io.Writer, tStruct interface{}) error

ProcessTemplateHTML takes the template described by templateFileBuffer and uses the html/template package to parse and execute the template, pushing output on the, out io.Writer. The big difference between this and ProcessTemplateText, is that this function performs HTML escaping of text.

func ProcessTemplateText

func ProcessTemplateText(templateFileBuffer *[]byte, out io.Writer, tStruct interface{}) error

ProcessTemplateText takes the template described by templateFileBuffer and uses the text/template package to parse and execute the template, pushing output on the, out io.Writer.

Types

type TemplatePluginSettings

type TemplatePluginSettings struct {
	PluginPath,
	TemplateName string
	Groups []string
}

TemplatePluginSettings represents the settings for a template plugin

Jump to

Keyboard shortcuts

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