markdown

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// MarkupName describes markup's name
	MarkupName = "markdown"
)

Functions

func IsMarkdownFile

func IsMarkdownFile(name string) bool

IsMarkdownFile reports whether name looks like a Markdown file based on its extension.

func Render

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

Render renders Markdown to HTML with all specific handling stuff.

func RenderRaw

func RenderRaw(body []byte, urlPrefix string, wikiMarkdown bool) []byte

RenderRaw renders Markdown to HTML without handling special links.

func RenderString

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

RenderString renders Markdown to HTML with special links and returns string type.

func RenderWiki

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

RenderWiki renders markdown wiki page to HTML and return HTML string

Types

type Parser

type Parser struct {
}

Parser implements markup.Parser

func (Parser) Extensions

func (Parser) Extensions() []string

Extensions implements markup.Parser

func (Parser) Name

func (Parser) Name() string

Name implements markup.Parser

func (Parser) Render

func (Parser) Render(rawBytes []byte, urlPrefix string, metas map[string]string, isWiki bool) []byte

Render implements markup.Parser

type Renderer

type Renderer struct {
	blackfriday.Renderer
	URLPrefix string
	IsWiki    bool
}

Renderer is a extended version of underlying render object.

func (*Renderer) Image

func (r *Renderer) Image(out *bytes.Buffer, link []byte, title []byte, alt []byte)

Image defines how images should be processed to produce corresponding HTML elements.

func (r *Renderer) Link(out *bytes.Buffer, link []byte, title []byte, content []byte)

Link defines how formal links should be processed to produce corresponding HTML elements.

func (*Renderer) List

func (r *Renderer) List(out *bytes.Buffer, text func() bool, flags int)

List renders markdown bullet or digit lists to HTML

func (*Renderer) ListItem

func (r *Renderer) ListItem(out *bytes.Buffer, text []byte, flags int)

ListItem defines how list items should be processed to produce corresponding HTML elements.

Jump to

Keyboard shortcuts

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