Discover Packages
github.com/CloudVLab/tools
claat
render
package
Version:
v0.6.0
Opens a new window with list of versions in this module.
Published: Aug 27, 2016
License: Apache-2.0
Opens a new window with license information.
Imports: 14
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Jump to ...
Documentation
Index
Constants
Variables
Functions
Execute(w, fmt, data, opt)
HTML(env, nodes)
Lite(env, nodes)
MD(env, nodes)
WriteHTML(w, env, nodes)
WriteLite(w, env, nodes)
WriteMD(w, env, nodes)
Types
Source Files
Documentation
Documentation
¶
func Execute(w io.Writer, fmt string, data interface{}, opt ...Option) error
func HTML(env string, nodes ...types.Node) (htmlTemplate.HTML, error)
func Lite(env string, nodes ...types.Node) (htmlTemplate.HTML, error)
func MD(env string, nodes ...types.Node) (string, error)
func WriteHTML(w io.Writer, env string, nodes ...types.Node) error
func WriteLite(w io.Writer, env string, nodes ...types.Node) error
func WriteMD(w io.Writer, env string, nodes ...types.Node) error
type Context
type Option
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.
HTML renders nodes as the markup for the target env.
Lite renders nodes as a standard HTML markup, without Custom Elements.
MD renders nodes as markdown for the target env.
WriteHTML does the same as HTML but outputs rendered markup to w.
WriteLite does the same as Lite but outputs rendered markup to w.
WriteMD does the same as MD but outputs rendered markup to w.
Context is a template context during execution.
type Option interface {
}
Option is the type of optional arguments for Execute.
WithFuncMap creates a user-supplied template functions option.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.