Documentation ¶
Index ¶
- func ActionContent2Commits(act Actioner) *repository.PushCommits
- func ActionIcon(opType models.ActionType) string
- func DiffLineTypeToStr(diffType int) string
- func DiffTypeToStr(diffType int) string
- func Escape(raw string) string
- func HTMLRenderer() macaron.Handler
- func IsMultilineCommitMessage(msg string) bool
- func JSONRenderer() macaron.Handler
- func List(l *list.List) chan interface{}
- func Mailer() (*texttmpl.Template, *template.Template)
- func MigrationIcon(hostname string) string
- func NewFuncMap() []template.FuncMap
- func NewTextFuncMap() []texttmpl.FuncMap
- func ReactionToEmoji(reaction string) template.HTML
- func RenderCommitBody(msg, urlPrefix string, metas map[string]string) template.HTML
- func RenderCommitMessage(msg, urlPrefix string, metas map[string]string) template.HTML
- func RenderCommitMessageLink(msg, urlPrefix, urlDefault string, metas map[string]string) template.HTML
- func RenderCommitMessageLinkSubject(msg, urlPrefix, urlDefault string, metas map[string]string) template.HTML
- func RenderEmoji(text string) template.HTML
- func RenderNote(msg, urlPrefix string, metas map[string]string) template.HTML
- func SVG(icon string, others ...interface{}) template.HTML
- func Safe(raw string) template.HTML
- func SafeJS(raw string) template.JS
- func Sha1(str string) string
- func Str2html(raw string) template.HTML
- func TrN(lang string, cnt interface{}, key1, keyN string) string
- type Actioner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActionContent2Commits ¶
func ActionContent2Commits(act Actioner) *repository.PushCommits
ActionContent2Commits converts action content to push commits
func ActionIcon ¶
func ActionIcon(opType models.ActionType) string
ActionIcon accepts an action operation type and returns an icon class name.
func DiffLineTypeToStr ¶
DiffLineTypeToStr returns diff line type name
func HTMLRenderer ¶ added in v1.6.0
HTMLRenderer implements the macaron handler for serving HTML templates.
func IsMultilineCommitMessage ¶ added in v1.4.0
IsMultilineCommitMessage checks to see if a commit message contains multiple lines.
func JSONRenderer ¶ added in v1.6.0
JSONRenderer implements the macaron handler for serving JSON templates.
func MigrationIcon ¶ added in v1.10.0
MigrationIcon returns a Font Awesome name matching the service an issue/comment was migrated from
func NewFuncMap ¶
NewFuncMap returns functions for injecting to templates
func NewTextFuncMap ¶ added in v1.11.0
NewTextFuncMap returns functions for injecting to text templates It's a subset of those used for HTML and other templates
func ReactionToEmoji ¶ added in v1.12.0
ReactionToEmoji renders emoji for use in reactions
func RenderCommitBody ¶ added in v1.4.0
RenderCommitBody extracts the body of a commit message without its title.
func RenderCommitMessage ¶
RenderCommitMessage renders commit message with XSS-safe and special links.
func RenderCommitMessageLink ¶ added in v1.3.0
func RenderCommitMessageLink(msg, urlPrefix, urlDefault string, metas map[string]string) template.HTML
RenderCommitMessageLink renders commit message as a XXS-safe link to the provided default url, handling for special links.
func RenderCommitMessageLinkSubject ¶ added in v1.10.0
func RenderCommitMessageLinkSubject(msg, urlPrefix, urlDefault string, metas map[string]string) template.HTML
RenderCommitMessageLinkSubject renders commit message as a XXS-safe link to the provided default url, handling for special links without email to links.
func RenderEmoji ¶ added in v1.12.0
RenderEmoji renders html text with emoji post processors
func RenderNote ¶ added in v1.9.0
RenderNote renders the contents of a git-notes file as a commit message.
Types ¶
type Actioner ¶
type Actioner interface { GetOpType() models.ActionType GetActUserName() string GetRepoUserName() string GetRepoName() string GetRepoPath() string GetRepoLink() string GetBranch() string GetContent() string GetCreate() time.Time GetIssueInfos() []string }
Actioner describes an action