render

package
v0.0.0-...-c868949 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute(w io.Writer, fmt string, data interface{}, opt ...Option) error

Execute renders a template of the fmt format into w.

The fmt argument can also be a path to a local file.

Template execution context data is expected to be of type *Context but can be an arbitrary struct, as long as it contains at least Context's fields for the built-in templates to be successfully executed.

func HTML

func HTML(env string, nodes ...types.Node) (htmlTemplate.HTML, error)

HTML renders nodes as the markup for the target env.

func Lite

func Lite(env string, nodes ...types.Node) (htmlTemplate.HTML, error)

Lite renders nodes as a standard HTML markup, without Custom Elements.

func MD

func MD(env string, nodes ...types.Node) (string, error)

MD renders nodes as markdown for the target env.

func QwiklabsGitMD

func QwiklabsGitMD(env string, nodes ...types.Node) (string, error)

QwiklabsGitMD renders nodes as markdown for the target env.

func QwiklabsHTML

func QwiklabsHTML(env string, nodes ...types.Node) (htmlTemplate.HTML, error)

QwiklabsHTML renders nodes as the markup for the target env.

func QwiklabsMD

func QwiklabsMD(env string, nodes ...types.Node) (string, error)

QwiklabsMD renders nodes as markdown for the target env.

func WriteHTML

func WriteHTML(w io.Writer, env string, nodes ...types.Node) error

WriteHTML does the same as HTML but outputs rendered markup to w.

func WriteLite

func WriteLite(w io.Writer, env string, nodes ...types.Node) error

WriteLite does the same as Lite but outputs rendered markup to w.

func WriteMD

func WriteMD(w io.Writer, env string, nodes ...types.Node) error

WriteMD does the same as MD but outputs rendered markup to w.

func WriteQwiklabsGitMD

func WriteQwiklabsGitMD(w io.Writer, env string, nodes ...types.Node) error

WriteQwiklabsGitMD does the same as MD but outputs rendered markup to w.

func WriteQwiklabsHTML

func WriteQwiklabsHTML(w io.Writer, env string, nodes ...types.Node) error

WriteQwiklabsHTML does the same as Qwiklabs but outputs rendered markup to w.

func WriteQwiklabsMD

func WriteQwiklabsMD(w io.Writer, env string, nodes ...types.Node) error

WriteQwiklabsMD does the same as MD but outputs rendered markup to w.

Types

type Context

type Context struct {
	Env      string
	Prefix   string
	GlobalGA string
	Meta     *types.Meta
	Steps    []*types.Step
	Extra    map[string]string // Extra variables passed from the command line.
}

Context is a template context during execution.

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option is the type of optional arguments for Execute.

func WithFuncMap

func WithFuncMap(fm map[string]interface{}) Option

WithFuncMap creates a user-supplied template functions option.

Jump to

Keyboard shortcuts

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