pongo2

package module
v0.0.0-...-6ca146b Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2020 License: Apache-2.0 Imports: 8 Imported by: 18 modules, 18 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

pongo2

GitHub Workflow Status codecov GoDoc Sourcegraph

Middleware pongo2 is a pongo2.v3 template engine support for Macaron.

Installation
go get github.com/go-macaron/pongo2

Getting Help

License

This project is under the Apache License, Version 2.0. See the LICENSE file for the full license text.

Documentation

Overview

Package pongo2 is a middleware that provides pongo2 template engine for Macaron.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Pongoer

func Pongoer(options ...Options) macaron.Handler

Pongoer is a Middleware that maps a macaron.Render service into the Macaron handler chain. An single variadic pongo2.Options struct can be optionally provided to configure HTML rendering. The default directory for templates is "templates" and the default file extension is ".tmpl" and ".html".

If MACARON_ENV is set to "" or "development" then templates will be recompiled on every request. For more performance, set the MACARON_ENV environment variable to "production".

func Pongoers

func Pongoers(options Options, tplSets ...string) macaron.Handler

Types

type Options

type Options struct {
	// Directory to load templates. Default is "templates"
	Directory string
	// Extensions to parse template files from. Defaults to [".tmpl", ".html"]
	Extensions []string
	// Appends the given charset to the Content-Type header. Default is "UTF-8".
	Charset string
	// Outputs human readable JSON
	IndentJSON bool
	// Outputs human readable XML
	IndentXML bool
	// Prefixes the JSON output with the given bytes.
	PrefixJSON []byte
	// Prefixes the XML output with the given bytes.
	PrefixXML []byte
	// Allows changing of output to XHTML instead of HTML. Default is "text/html"
	HTMLContentType string
	// TemplateFileSystem is the interface for supporting any implmentation of template file system.
	macaron.TemplateFileSystem
}

Options represents a struct for specifying configuration options for the Render middleware.

Jump to

Keyboard shortcuts

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