Documentation ¶
Index ¶
- Constants
- Variables
- func ExecPath() (string, error)
- func IsImageFile(data []byte) (string, bool)
- func IsMarkdownFile(name string) bool
- func IsReadmeFile(name string) bool
- func IsTextFile(data []byte) (string, bool)
- func Markdown(raw string) string
- func PostProcessMarkdown(rawHtml []byte, urlPrefix string, metas map[string]string) []byte
- func PreProcessMarkdown(rawHTML []byte, urlPrefix string) []byte
- func RenderIssueIndexPattern(rawBytes []byte, urlPrefix string, metas map[string]string) []byte
- func RenderMarkdown(rawBytes []byte, urlPrefix string, metas map[string]string) []byte
- func RenderMarkdownString(raw, urlPrefix string, metas map[string]string) string
- func RenderRawMarkdown(body []byte, urlPrefix string) []byte
- func RenderSha1CurrentPattern(rawBytes []byte, urlPrefix string) []byte
- func RenderSpecialLink(rawBytes []byte, urlPrefix string, metas map[string]string) []byte
- func ShortSha(sha1 string) string
- type CustomRender
- type TplName
Constants ¶
View Source
const DOC_URL = "https://github.com/gogits/go-gogs-client/wiki"
Variables ¶
View Source
var GoGetMetas = make(map[string]bool)
View Source
var (
MentionPattern = regexp.MustCompile(`(\s|^)@[0-9a-zA-Z_\.]+`)
)
View Source
var Sanitizer = bluemonday.UGCPolicy().AllowAttrs("class").Matching(regexp.MustCompile(`[\p{L}\p{N}\s\-_',:\[\]!\./\\\(\)&]*`)).OnElements("code")
Functions ¶
func IsImageFile ¶
func IsMarkdownFile ¶
func IsReadmeFile ¶
IsReadmeFile returns true if given file name suppose to be a README file.
func IsTextFile ¶
func PostProcessMarkdown ¶
PostProcessMarkdown treats different types of HTML differently, and only renders special links for plain text blocks.
func PreProcessMarkdown ¶
PreProcessMarkdown renders full links of commits, issues and pulls to shorter version.
func RenderIssueIndexPattern ¶
func RenderMarkdown ¶
func RenderMarkdownString ¶
func RenderRawMarkdown ¶
func RenderSpecialLink ¶
Types ¶
type CustomRender ¶
type CustomRender struct { blackfriday.Renderer // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.