{"modulePath":"github.com/RedAFD/code-core","version":"v1.8.3","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package templates\n\n## Functions\n\n```go\nfunc ActionContent2Commits(act Actioner) *models.PushCommits\n```\nActionContent2Commits converts action content to push commits\n\n```go\nfunc ActionIcon(opType models.ActionType) string\n```\nActionIcon accepts an action operation type and returns an icon class name.\n\n```go\nfunc DiffLineTypeToStr(diffType int) string\n```\nDiffLineTypeToStr returns diff line type name\n\n```go\nfunc DiffTypeToStr(diffType int) string\n```\nDiffTypeToStr returns diff type name\n\n```go\nfunc Escape(raw string) string\n```\nEscape escapes a HTML string\n\n```go\nfunc HTMLRenderer() macaron.Handler\n```\nHTMLRenderer implements the macaron handler for serving HTML templates.\n\n```go\nfunc IsMultilineCommitMessage(msg string) bool\n```\nIsMultilineCommitMessage checks to see if a commit message contains multiple lines.\n\n```go\nfunc JSONRenderer() macaron.Handler\n```\nJSONRenderer implements the macaron handler for serving JSON templates.\n\n```go\nfunc JSRenderer() macaron.Handler\n```\nJSRenderer implements the macaron handler for serving JS templates.\n\n```go\nfunc List(l *list.List) chan interface{}\n```\nList traversings the list\n\n```go\nfunc Mailer() *template.Template\n```\nMailer provides the templates required for sending notification mails.\n\n```go\nfunc NewFuncMap() []template.FuncMap\n```\nNewFuncMap returns functions for injecting to templates\n\n```go\nfunc RenderCommitBody(msg, urlPrefix string, metas map[string]string) template.HTML\n```\nRenderCommitBody extracts the body of a commit message without its title.\n\n```go\nfunc RenderCommitMessage(msg, urlPrefix string, metas map[string]string) template.HTML\n```\nRenderCommitMessage renders commit message with XSS-safe and special links.\n\n```go\nfunc RenderCommitMessageLink(msg, urlPrefix, urlDefault string, metas map[string]string) template.HTML\n```\nRenderCommitMessageLink renders commit message as a XXS-safe link to the provided default url, handling for special links.\n\n```go\nfunc ReplaceLeft(s, old, new string) string\n```\nReplaceLeft replaces all prefixes 'old' in 's' with 'new'.\n\n```go\nfunc Safe(raw string) template.HTML\n```\nSafe render raw as HTML\n\n```go\nfunc SafeJS(raw string) template.JS\n```\nSafeJS renders raw as JS\n\n```go\nfunc Sha1(str string) string\n```\nSha1 returns sha1 sum of string\n\n```go\nfunc Str2html(raw string) template.HTML\n```\nStr2html render Markdown text to HTML\n\n```go\nfunc ToUTF8(content string) string\n```\nToUTF8 converts content to UTF8 encoding and ignore error\n\n```go\nfunc ToUTF8WithErr(content []byte) (string, error)\n```\nToUTF8WithErr converts content to UTF8 encoding\n\n```go\nfunc ToUTF8WithFallback(content []byte) []byte\n```\nToUTF8WithFallback detects the encoding of content and coverts to UTF-8 if possible\n\n```go\nfunc TrN(lang string, cnt interface{}, key1, keyN string) string\n```\nTrN returns key to be used for plural text translation\n\n## Types\n\n```go\ntype Actioner interface {\n\tGetOpType() models.ActionType\n\tGetActUserName() string\n\tGetRepoUserName() string\n\tGetRepoName() string\n\tGetRepoPath() string\n\tGetRepoLink() string\n\tGetBranch() string\n\tGetContent() string\n\tGetCreate() time.Time\n\tGetIssueInfos() []string\n}\n```\nActioner describes an action\n\n","path":"github.com/RedAFD/code-core/modules/templates","name":"templates","synopsis":"","isRedistributable":true}
