Documentation ¶
Index ¶
- func ActionContent2Commits(act Actioner) *repository.PushCommits
- func ActionIcon(opType activities_model.ActionType) string
- func Avatar(item interface{}, others ...interface{}) template.HTML
- func AvatarByAction(action *activities_model.Action, others ...interface{}) template.HTML
- func AvatarByEmail(email, name string, others ...interface{}) template.HTML
- func AvatarHTML(src string, size int, class, name string) template.HTML
- func BuiltinAsset(name string) ([]byte, error)
- func BuiltinAssetNames() []string
- func DiffLineTypeToStr(diffType int) string
- func DiffTypeToStr(diffType int) string
- func DotEscape(raw string) string
- func Escape(raw string) string
- func GetAsset(name string) ([]byte, error)
- func GetAssetFilename(name string) (string, error)
- func GetTemplateAssetNames() []string
- func HTMLRenderer(ctx context.Context) (context.Context, *render.Render)
- func IsMultilineCommitMessage(msg string) bool
- func JSEscape(raw string) string
- func JsPrettyNumber(i interface{}) template.HTML
- func Mailer(ctx context.Context) (*texttmpl.Template, *template.Template)
- func MigrationIcon(hostname string) string
- func NewFuncMap() []template.FuncMap
- func NewTextFuncMap() []texttmpl.FuncMap
- func ReactionToEmoji(reaction string) template.HTML
- func RenderCodeBlock(htmlEscapedTextToRender template.HTML) template.HTML
- func RenderCommitBody(ctx context.Context, msg, urlPrefix string, metas map[string]string) template.HTML
- func RenderCommitMessage(ctx context.Context, msg, urlPrefix string, metas map[string]string) template.HTML
- func RenderCommitMessageLink(ctx context.Context, msg, urlPrefix, urlDefault string, ...) template.HTML
- func RenderCommitMessageLinkSubject(ctx context.Context, msg, urlPrefix, urlDefault string, ...) template.HTML
- func RenderEmoji(text string) template.HTML
- func RenderIssueTitle(ctx context.Context, text, urlPrefix string, metas map[string]string) template.HTML
- func RenderNote(ctx context.Context, msg, urlPrefix string, metas map[string]string) template.HTML
- func RepoAvatar(repo *repo_model.Repository, others ...interface{}) template.HTML
- func SVG(icon string, others ...interface{}) template.HTML
- func Safe(raw string) template.HTML
- func SafeJS(raw string) template.JS
- func Str2html(raw string) template.HTML
- type Actioner
- type Vars
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 activities_model.ActionType) string
ActionIcon accepts an action operation type and returns an icon class name.
func AvatarByAction ¶ added in v1.14.0
func AvatarByAction(action *activities_model.Action, others ...interface{}) template.HTML
AvatarByAction renders user avatars from action. args: action, size (int), class (string)
func AvatarByEmail ¶ added in v1.14.0
AvatarByEmail renders avatars by email address. args: email, name, size (int), class (string)
func AvatarHTML ¶ added in v1.14.0
AvatarHTML creates the HTML for an avatar
func BuiltinAsset ¶ added in v1.17.4
BuiltinAsset will read the provided asset from the embedded assets (This always returns os.ErrNotExist)
func BuiltinAssetNames ¶ added in v1.17.4
func BuiltinAssetNames() []string
BuiltinAssetNames returns the names of the embedded assets (This always returns nil)
func DiffLineTypeToStr ¶
DiffLineTypeToStr returns diff line type name
func DotEscape ¶ added in v1.16.5
DotEscape wraps a dots in names with ZWJ [U+200D] in order to prevent autolinkers from detecting these as urls
func GetAssetFilename ¶ added in v1.17.4
GetAssetFilename returns the filename of the provided asset
func GetTemplateAssetNames ¶ added in v1.17.4
func GetTemplateAssetNames() []string
GetTemplateAssetNames returns list of template names
func HTMLRenderer ¶ added in v1.6.0
HTMLRenderer returns the current html renderer for the context or creates and stores one within the context for future use
func IsMultilineCommitMessage ¶ added in v1.4.0
IsMultilineCommitMessage checks to see if a commit message contains multiple lines.
func JsPrettyNumber ¶ added in v1.17.0
JsPrettyNumber renders a number using english decimal separators, e.g. 1,200 and subsequent JS will replace the number with locale-specific separators, based on the user's selected language
func MigrationIcon ¶ added in v1.10.0
MigrationIcon returns a SVG 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 RenderCodeBlock ¶ added in v1.17.4
RenderCodeBlock renders "`…`" as highlighted "<code>" block. Intended for issue and PR titles, these containers should have styles for "<code>" elements
func RenderCommitBody ¶ added in v1.4.0
func RenderCommitBody(ctx context.Context, msg, urlPrefix string, metas map[string]string) template.HTML
RenderCommitBody extracts the body of a commit message without its title.
func RenderCommitMessage ¶
func RenderCommitMessage(ctx context.Context, msg, urlPrefix string, metas map[string]string) template.HTML
RenderCommitMessage renders commit message with XSS-safe and special links.
func RenderCommitMessageLink ¶ added in v1.3.0
func RenderCommitMessageLink(ctx context.Context, 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(ctx context.Context, 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 RenderIssueTitle ¶ added in v1.14.0
func RenderIssueTitle(ctx context.Context, text, urlPrefix string, metas map[string]string) template.HTML
RenderIssueTitle renders issue/pull title with defined post processors
func RenderNote ¶ added in v1.9.0
RenderNote renders the contents of a git-notes file as a commit message.
func RepoAvatar ¶ added in v1.14.0
func RepoAvatar(repo *repo_model.Repository, others ...interface{}) template.HTML
RepoAvatar renders repo avatars. args: repo, size(int), class (string)
Types ¶
type Actioner ¶
type Actioner interface { GetOpType() activities_model.ActionType GetActUserName() string GetRepoUserName() string GetRepoName() string GetRepoPath() string GetRepoLink() string GetBranch() string GetContent() string GetCreate() time.Time GetIssueInfos() []string }
Actioner describes an action