Documentation
¶
Index ¶
- func After(index interface{}, seq interface{}) (interface{}, error)
- func Apply(seq interface{}, fname string, args ...interface{}) (interface{}, error)
- func Base64Decode(content interface{}) (string, error)
- func Base64Encode(content interface{}) (string, error)
- func Chomp(text interface{}) (string, error)
- func DateFormat(layout string, v interface{}) (string, error)
- func Delimit(seq, delimiter interface{}, last ...interface{}) (template.HTML, error)
- func Dictionary(values ...interface{}) (map[string]interface{}, error)
- func Eq(x, y interface{}) bool
- func ExecuteTemplate(context interface{}, buffer *bytes.Buffer, layouts ...string)
- func ExecuteTemplateToHTML(context interface{}, layouts ...string) template.HTML
- func First(limit interface{}, seq interface{}) (interface{}, error)
- func Ge(a, b interface{}) bool
- func GetCSV(sep string, urlParts ...string) [][]string
- func GetJSON(urlParts ...string) interface{}
- func Gt(a, b interface{}) bool
- func Highlight(in interface{}, lang, opts string) template.HTML
- func In(l interface{}, v interface{}) bool
- func Intersect(l1, l2 interface{}) (interface{}, error)
- func IsSet(a interface{}, key interface{}) bool
- func Last(limit interface{}, seq interface{}) (interface{}, error)
- func Le(a, b interface{}) bool
- func Lt(a, b interface{}) bool
- func Markdownify(text string) template.HTML
- func Mod(a, b interface{}) (int64, error)
- func ModBool(a, b interface{}) (bool, error)
- func Ne(x, y interface{}) bool
- func Partial(name string, context_list ...interface{}) template.HTML
- func ReadDir(path string) []os.FileInfo
- func Ref(page interface{}, ref string) template.HTML
- func RelRef(page interface{}, ref string) template.HTML
- func Replace(a, b, c interface{}) (string, error)
- func ReturnWhenSet(a, k interface{}) interface{}
- func SafeCSS(text string) template.CSS
- func SafeHTML(a string) template.HTML
- func SafeHTMLAttr(text string) template.HTMLAttr
- func SafeJS(a string) template.JS
- func SafeURL(text string) template.URL
- func Slicestr(a interface{}, startEnd ...interface{}) (string, error)
- func Sort(seq interface{}, args ...interface{}) (interface{}, error)
- func Split(a interface{}, delimiter string) ([]string, error)
- func Substr(a interface{}, nums ...interface{}) (string, error)
- func Trim(a interface{}, b string) (string, error)
- func Where(seq, key interface{}, args ...interface{}) (r interface{}, err error)
- type GoHTMLTemplate
- func (t *GoHTMLTemplate) AddAceTemplate(name, basePath, innerPath string, baseContent, innerContent []byte) error
- func (t *GoHTMLTemplate) AddInternalShortcode(name, content string) error
- func (t *GoHTMLTemplate) AddInternalTemplate(prefix, name, tpl string) error
- func (t *GoHTMLTemplate) AddTemplate(name, tpl string) error
- func (t *GoHTMLTemplate) AddTemplateFile(name, baseTemplatePath, path string) error
- func (t *GoHTMLTemplate) EmbedShortcodes()
- func (t *GoHTMLTemplate) EmbedTemplates()
- func (t *GoHTMLTemplate) GenerateTemplateNameFrom(base, path string) string
- func (t *GoHTMLTemplate) LoadEmbedded()
- func (t *GoHTMLTemplate) LoadTemplates(absPath string)
- func (t *GoHTMLTemplate) LoadTemplatesWithPrefix(absPath string, prefix string)
- func (t *GoHTMLTemplate) PrintErrors()
- type Template
- type Tmpl
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func After ¶
func After(index interface{}, seq interface{}) (interface{}, error)
After is exposed to templates, to iterate over all the items after N in a rangeable list. It's meant to accompany First
func Apply ¶
Apply, given a map, array, or slice, returns a new slice with the function fname applied over it.
func Base64Decode ¶
func Base64Encode ¶
func DateFormat ¶
DateFormat converts the textual representation of the datetime string into the other form or returns it of the time.Time value. These are formatted with the layout string
func Dictionary ¶
func ExecuteTemplate ¶
func ExecuteTemplateToHTML ¶
func First ¶
func First(limit interface{}, seq interface{}) (interface{}, error)
First is exposed to templates, to iterate over the first N items in a rangeable list.
func GetCSV ¶
GetCSV expects a data separator and one or n-parts of a URL to a resource which can either be a local or a remote one. The data separator can be a comma, semi-colon, pipe, etc, but only one character. If you provide multiple parts for the URL they will be joined together to the final URL. GetCSV returns nil or a slice slice to use in a short code.
func GetJSON ¶
func GetJSON(urlParts ...string) interface{}
GetJSON expects one or n-parts of a URL to a resource which can either be a local or a remote one. If you provide multiple parts they will be joined together to the final URL. GetJSON returns nil or parsed JSON to use in a short code.
func Last ¶
func Last(limit interface{}, seq interface{}) (interface{}, error)
Last is exposed to templates, to iterate over the last N items in a rangeable list.
func Markdownify ¶
func ReturnWhenSet ¶
func ReturnWhenSet(a, k interface{}) interface{}
func SafeHTMLAttr ¶
"safeHTMLAttr" is currently disabled, pending further discussion on its use case. 2015-01-19
func Slicestr ¶
Slicing in Slicestr is done by specifying a half-open range with two indices, start and end. 1 and 4 creates a slice including elements 1 through 3. The end index can be omitted, it defaults to the string's length.
func Substr ¶
Substr extracts parts of a string, beginning at the character at the specified position, and returns the specified number of characters.
It normally takes two parameters: start and length. It can also take one parameter: start, i.e. length is omitted, in which case the substring starting from start until the end of the string will be returned.
To extract characters from the end of the string, use a negative start number.
In addition, borrowing from the extended behavior described at http://php.net/substr, if length is given and is negative, then that many characters will be omitted from the end of string.
Types ¶
type GoHTMLTemplate ¶
func (*GoHTMLTemplate) AddAceTemplate ¶
func (t *GoHTMLTemplate) AddAceTemplate(name, basePath, innerPath string, baseContent, innerContent []byte) error
func (*GoHTMLTemplate) AddInternalShortcode ¶
func (t *GoHTMLTemplate) AddInternalShortcode(name, content string) error
func (*GoHTMLTemplate) AddInternalTemplate ¶
func (t *GoHTMLTemplate) AddInternalTemplate(prefix, name, tpl string) error
func (*GoHTMLTemplate) AddTemplate ¶
func (t *GoHTMLTemplate) AddTemplate(name, tpl string) error
func (*GoHTMLTemplate) AddTemplateFile ¶
func (t *GoHTMLTemplate) AddTemplateFile(name, baseTemplatePath, path string) error
func (*GoHTMLTemplate) EmbedShortcodes ¶
func (t *GoHTMLTemplate) EmbedShortcodes()
func (*GoHTMLTemplate) EmbedTemplates ¶
func (t *GoHTMLTemplate) EmbedTemplates()
func (*GoHTMLTemplate) GenerateTemplateNameFrom ¶
func (t *GoHTMLTemplate) GenerateTemplateNameFrom(base, path string) string
func (*GoHTMLTemplate) LoadEmbedded ¶
func (t *GoHTMLTemplate) LoadEmbedded()
func (*GoHTMLTemplate) LoadTemplates ¶
func (t *GoHTMLTemplate) LoadTemplates(absPath string)
func (*GoHTMLTemplate) LoadTemplatesWithPrefix ¶
func (t *GoHTMLTemplate) LoadTemplatesWithPrefix(absPath string, prefix string)
func (*GoHTMLTemplate) PrintErrors ¶
func (t *GoHTMLTemplate) PrintErrors()
type Template ¶
type Template interface { ExecuteTemplate(wr io.Writer, name string, data interface{}) error Lookup(name string) *template.Template Templates() []*template.Template New(name string) *template.Template LoadTemplates(absPath string) LoadTemplatesWithPrefix(absPath, prefix string) AddTemplate(name, tpl string) error AddAceTemplate(name, basePath, innerPath string, baseContent, innerContent []byte) error AddInternalTemplate(prefix, name, tpl string) error AddInternalShortcode(name, tpl string) error PrintErrors() }
func InitializeT ¶
func InitializeT() Template
InitializeT resets the internal template state to its initial state