renderer

package module
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: BSD-3-Clause Imports: 8 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

renderer

Template renderer

Static Badge

GoDoc GitHub stars Go Report Card codecov

Versions

Stable Version GitHub Release GitHub Release

Contributors

JanGalek actions-user dependabot[bot]

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCustomFunc added in v1.1.4

func AddCustomFunc(name string, fn interface{})

AddCustomFunc adds a custom function to the template function map Example:

renderer.AddCustomFunc("myFunc", func() string { return "Hello, World!" })

func AddCustomFuncMap added in v1.1.4

func AddCustomFuncMap(funcMap map[string]interface{})

AddCustomFuncMap adds a map of custom functions to the template function map Example:

renderer.AddCustomFuncMap(map[string]interface{}{
	"myFunc": func() string { return "Hello, World!" },
})

func FirstRecord added in v1.0.0

func FirstRecord(m map[string]*finder.Info) string

Types

type File added in v1.0.0

type File struct {
	Path     string
	Layout   string
	Includes []File
}

type Renderer added in v1.1.0

type Renderer struct {
	Router          *router.Router
	LayoutPattern   []string
	TemplateDir     string
	TemplateHandler *handlers.TemplateHandler
}

func NewRenderer added in v1.1.0

func NewRenderer(templatesDir string, layoutPattern []string) Renderer

NewRenderer register and set HTMLRenderer to gouef/router Example:

NewRenderer("./views/templates", []string{"layout", "base.gohtml"})

func (Renderer) HtmlRenderer added in v1.1.0

func (renderer Renderer) HtmlRenderer() multitemplate.Renderer

func (Renderer) RegisterRouter added in v1.1.0

func (renderer Renderer) RegisterRouter(r *router.Router) Renderer

RegisterRouter register and set HTMLRenderer to gouef/router Example:

renderer.RegisterRouter(r)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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