cli

package
v0.0.0-...-7fb0569 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Templates  []string
	DataFile   string
	OutputFile string

	HTMLFuncMap temple.FuncMap
	TextFuncMap temple.FuncMap

	HTML  bool
	Watch bool
	// contains filtered or unexported fields
}

App represents the temple application. To populate the struct with values from the command line as described in the documentation, instantiate the struct with the New() function.

func New

func New() *App

New creates a new App. The default values are populated with values from the command line. The list of command line args will be used as the list of template files. At least one must be provided. The available command line flags are:

-o string: The output filename
-d string: The data file
-w: 		Indicates that the input files should be watched for changes
-v: 		Indicates that additional logging should be displayed
-html:		Indicates that the html/template parser should be used

func (*App) ClearFuncMaps

func (a *App) ClearFuncMaps() *App

ClearFuncMaps resets both the text and HTML FuncMaps for the App.

func (*App) ClearHTMLFuncMap

func (a *App) ClearHTMLFuncMap() *App

ClearHTMLFuncMap resets the App's HTML FuncMap.

func (*App) ClearTextFuncMap

func (a *App) ClearTextFuncMap() *App

ClearTextFuncMap resets the App's text FuncMap.

func (*App) Run

func (a *App) Run() error

Run runs the temple application. If App.Watch is set to true, then this method will never return.

func (*App) WithFuncMap

func (a *App) WithFuncMap(f temple.FuncMap) *App

WithFuncMap merges the provided FuncMap into the App's text and HTML FuncMaps. This method can be called multiple times to merge in multiple FuncMaps.

func (*App) WithHTMLFuncMap

func (a *App) WithHTMLFuncMap(f temple.FuncMap) *App

WithHTMLFuncMap merges the provided FuncMap into the App's HTML FuncMap. This method can me called multipled times to merge in multiple FuncMaps.

func (*App) WithTextFuncMap

func (a *App) WithTextFuncMap(f temple.FuncMap) *App

WithTextFuncMap merges the provided FuncMap into the App's text FuncMap. This method can me called multipled times to merge in multiple FuncMaps.

Jump to

Keyboard shortcuts

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