template

package
v0.0.0-...-dba4764 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2015 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Minute = 60
	Hour   = 60 * Minute
	Day    = 24 * Hour
	Week   = 7 * Day
	Month  = 30 * Day
	Year   = 12 * Month
)

Variables

View Source
var HelperFuncs []template.FuncMap

Functions

func AutoLink(html string, names []string) string

Expect sorted string-length.

func Datenow

func Datenow(format string) string

func DiffLineTypeToStr

func DiffLineTypeToStr(diffType int) string

func DiffTypeToStr

func DiffTypeToStr(diffType int) string

func EncodeSha1

func EncodeSha1(str string) string

func EscapeHTML

func EscapeHTML(text string) string
func ExtractAutoLink(html string) (names []string)

func List

func List(l *list.List) chan interface{}

func MarkdownHTML

func MarkdownHTML(markdown string) string

func Nl2br

func Nl2br(in string) string

func Plus

func Plus(a, b int) int

func Reverse

func Reverse(in interface{}) (list []interface{})

func SafeHTML

func SafeHTML(text string) template.HTML

func SanitizeHTML

func SanitizeHTML(text string) string

func Shuffle

func Shuffle(in interface{}) (list []interface{})

func Slice

func Slice(in interface{}, from, to int) (list []interface{})

func SplitFoldl

func SplitFoldl(s, sep string) string

func SplitFoldr

func SplitFoldr(s, sep string) string

func TimeSince

func TimeSince(t time.Time) template.HTML

func ToAge

func ToAge(bd time.Time) int

func ToCanonical

func ToCanonical(name string) string

func ToDay

func ToDay(t time.Time) int

func ToMonth

func ToMonth(t time.Time) time.Month

func ToUnix

func ToUnix(t time.Time) int64

func ToYear

func ToYear(t time.Time) int

func Truncate

func Truncate(in string, length int) string

Types

type Img

type Img struct {
	*image.FileInfo

	Src string
	Alt string
}

func ExtractIMGs

func ExtractIMGs(html string) (imgs []*Img)

Jump to

Keyboard shortcuts

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