gitea: Index | Files

package markdown

import ""


Package Files



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

func IsMarkdownFile Uses

func IsMarkdownFile(name string) bool

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

func Render Uses

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

Render renders Markdown to HTML with all specific handling stuff.

func RenderRaw Uses

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

RenderRaw renders Markdown to HTML without handling special links.

func RenderString Uses

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

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

func RenderWiki Uses

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

RenderWiki renders markdown wiki page to HTML and return HTML string

type Parser Uses

type Parser struct {

Parser implements markup.Parser

func (Parser) Extensions Uses

func (Parser) Extensions() []string

Extensions implements markup.Parser

func (Parser) Name Uses

func (Parser) Name() string

Name implements markup.Parser

func (Parser) Render Uses

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

Render implements markup.Parser

type Renderer Uses

type Renderer struct {
    URLPrefix string
    IsWiki    bool

Renderer is a extended version of underlying render object.

func (*Renderer) RenderNode Uses

func (r *Renderer) RenderNode(w io.Writer, node *blackfriday.Node, entering bool) blackfriday.WalkStatus

RenderNode is a default renderer of a single node of a syntax tree. For block nodes it will be called twice: first time with entering=true, second time with entering=false, so that it could know when it's working on an open tag and when on close. It writes the result to w.

The return value is a way to tell the calling walker to adjust its walk pattern: e.g. it can terminate the traversal by returning Terminate. Or it can ask the walker to skip a subtree of this node by returning SkipChildren. The typical behavior is to return GoToNext, which asks for the usual traversal to the next node.

Package markdown imports 7 packages (graph) and is imported by 17 packages. Updated 2019-11-19. Refresh now. Tools for package owners.