Documentation ¶
Index ¶
- Constants
- Variables
- func StripHTML(s string) string
- type FileInfo
- type Info
- type InfoManager
- type ParseConfig
- type ParseInfo
- type Template
- type TemplateFinder
- type TemplateFuncGetter
- type TemplateHandler
- type TemplateLookup
- type TemplateManager
- type TemplateParseFinder
- type TemplateParser
- type TemplateVariants
Constants ¶
View Source
const TemplateVersion = 2
Increments on breaking changes.
Variables ¶
View Source
var DefaultParseConfig = ParseConfig{ Version: TemplateVersion, }
View Source
var DefaultParseInfo = ParseInfo{ Config: DefaultParseConfig, }
Functions ¶
Types ¶
type Info ¶
type InfoManager ¶
type ParseConfig ¶
type ParseConfig struct {
Version int
}
type ParseInfo ¶
type ParseInfo struct { // Set for shortcode templates with any {{ .Inner }} IsInner bool // Set for partials with a return statement. HasReturn bool // Config extracted from template. Config ParseConfig }
type Template ¶
type Template interface { Name() string Prepare() (*texttemplate.Template, error) }
Template is the common interface between text/template and html/template.
type TemplateFinder ¶
type TemplateFinder interface { TemplateLookup }
TemplateFinder finds templates.
type TemplateFuncGetter ¶
TemplateFuncGetter allows to find a template func by name.
type TemplateHandler ¶
type TemplateHandler interface { TemplateFinder Execute(t Template, wr io.Writer, data any) error ExecuteWithContext(ctx context.Context, t Template, wr io.Writer, data any) error LookupLayout(d output.LayoutDescriptor, f output.Format) (Template, bool, error) HasTemplate(name string) bool }
TemplateHandler finds and executes templates.
type TemplateLookup ¶
type TemplateManager ¶
type TemplateManager interface { TemplateHandler TemplateFuncGetter AddTemplate(name, tpl string) error MarkReady() error }
TemplateManager manages the collection of templates.
type TemplateParseFinder ¶
type TemplateParseFinder interface { TemplateParser TemplateFinder }
TemplateParseFinder provides both parsing and finding.
type TemplateParser ¶
TemplateParser is used to parse ad-hoc templates, e.g. in the Resource chain.
type TemplateVariants ¶
TemplateVariants describes the possible variants of a template. All of these may be empty.
Directories ¶
Path | Synopsis |
---|---|
Package compare provides template functions for comparing values.
|
Package compare provides template functions for comparing values. |
go_templates/texttemplate/parse
Package parse builds parse trees for templates as defined by text/template and html/template.
|
Package parse builds parse trees for templates as defined by text/template and html/template. |
Package os provides template functions for interacting with the operating system.
|
Package os provides template functions for interacting with the operating system. |
Package transform provides template functions for transforming content.
|
Package transform provides template functions for transforming content. |
Click to show internal directories.
Click to hide internal directories.