config

package
v0.0.0-...-4d051fd Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2020 License: MIT Imports: 0 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = NewConfig()

DefaultConfig is a configuration with default values

Functions

This section is empty.

Types

type Config

type Config struct {
	Debug bool
	// The string marking the beginning of a block. Defaults to '{%'
	BlockStartString string
	// The string marking the end of a block. Defaults to '%}'.
	BlockEndString string
	// The string marking the beginning of a print statement. Defaults to '{{'.
	VariableStartString string
	// The string marking the end of a print statement. Defaults to '}}'.
	VariableEndString string
	// The string marking the beginning of a comment. Defaults to '{#'.
	CommentStartString string
	// The string marking the end of a comment. Defaults to '#}'.
	CommentEndString string
	// If given and a string, this will be used as prefix for line based statements.
	// See also Line Statements.
	LineStatementPrefix string
	// If given and a string, this will be used as prefix for line based comments.
	// See also Line Statements.
	LineCommentPrefix string
	// If this is set to True the first newline after a block is removed (block, not variable tag!).
	// Defaults to False.
	TrimBlocks bool
	// If this is set to True leading spaces and tabs are stripped from the start of a line to a block.
	// Defaults to False.
	LstripBlocks bool
	// The sequence that starts a newline.
	// Must be one of '\r', '\n' or '\r\n'.
	// The default is '\n' which is a useful default for Linux and OS X systems as well as web applications.
	NewlineSequence string
	// Preserve the trailing newline when rendering templates.
	// The default is False, which causes a single newline,
	// if present, to be stripped from the end of the template.
	KeepTrailingNewline bool
	// If set to True the XML/HTML autoescaping feature is enabled by default.
	// For more details about autoescaping see Markup.
	// This can also be a callable that is passed the template name
	// and has to return True or False depending on autoescape should be enabled by default.
	Autoescape bool

	// Allow extensions to store some config
	Ext map[string]Inheritable
}

Config holds plexer and parser parameters

func NewConfig

func NewConfig() *Config

func (*Config) Inherit

func (cfg *Config) Inherit() *Config

type Inheritable

type Inheritable interface {
	Inherit() Inheritable
}

Jump to

Keyboard shortcuts

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