base

package
v0.0.0-...-3f6dde8 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2016 License: MIT Imports: 15 Imported by: 0

Documentation

Index

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 ExecPath

func ExecPath() (string, error)

ExecPath returns the executable path.

func IsImageFile

func IsImageFile(data []byte) (string, bool)

func IsMarkdownFile

func IsMarkdownFile(name string) bool

func IsReadmeFile

func IsReadmeFile(name string) bool

IsReadmeFile returns true if given file name suppose to be a README file.

func IsTextFile

func IsTextFile(data []byte) (string, bool)

func Markdown

func Markdown(raw string) string

func PostProcessMarkdown

func PostProcessMarkdown(rawHtml []byte, urlPrefix string, metas map[string]string) []byte

PostProcessMarkdown treats different types of HTML differently, and only renders special links for plain text blocks.

func PreProcessMarkdown

func PreProcessMarkdown(rawHTML []byte, urlPrefix string) []byte

PreProcessMarkdown renders full links of commits, issues and pulls to shorter version.

func RenderIssueIndexPattern

func RenderIssueIndexPattern(rawBytes []byte, urlPrefix string, metas map[string]string) []byte

func RenderMarkdown

func RenderMarkdown(rawBytes []byte, urlPrefix string, metas map[string]string) []byte

func RenderMarkdownString

func RenderMarkdownString(raw, urlPrefix string, metas map[string]string) string

func RenderRawMarkdown

func RenderRawMarkdown(body []byte, urlPrefix string) []byte

func RenderSha1CurrentPattern

func RenderSha1CurrentPattern(rawBytes []byte, urlPrefix string) []byte
func RenderSpecialLink(rawBytes []byte, urlPrefix string, metas map[string]string) []byte

func ShortSha

func ShortSha(sha1 string) string

Types

type CustomRender

type CustomRender struct {
	blackfriday.Renderer
	// contains filtered or unexported fields
}

func (*CustomRender) Image

func (options *CustomRender) Image(out *bytes.Buffer, link []byte, title []byte, alt []byte)
func (options *CustomRender) Link(out *bytes.Buffer, link []byte, title []byte, content []byte)

type TplName

type TplName string

Jump to

Keyboard shortcuts

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