hweb

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2020 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Overview

Package hweb provides utilities for the HWeb templating system such as transpilation to Pongo2 templates.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToPongo

func ToPongo(src []byte) ([]byte, error)

ToPongo transpiles the HWeb src template to Pongo2 template

Types

type Context

type Context = pongo2.Context

The Context with which to render a HWeb template

type Template

type Template = pongo2.Template

A Template to be rendered with server's c.HTML()

func Must

func Must(tpl *Template, err error) *Template

Must panics, if a Template couldn't successfully parsed. This is how you would use it:

var baseTemplate = pongo2.Must(pongo2.FromFile("templates/base.html"))

type TemplateSet

type TemplateSet = pongo2.TemplateSet

TemplateSet allows you to create your own group of templates with their own global context (which is shared among all members of the set) and their own configuration. It's useful for a separation of different kind of templates (e. g. web templates vs. mail templates).

func NewSet

func NewSet(name string, loader pongo2.TemplateLoader) *TemplateSet

NewSet can be used to create sets with different kind of templates (e. g. web from mail templates), with different globals or other configurations.

Jump to

Keyboard shortcuts

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