gitea: code.gitea.io/gitea/modules/markup/markdown Index | Files

package markdown

import "code.gitea.io/gitea/modules/markup/markdown"

Index

Package Files

ast.go goldmark.go markdown.go renderconfig.go toc.go

Variables

var KindDetails = ast.NewNodeKind("Details")

KindDetails is the NodeKind for Details

var KindIcon = ast.NewNodeKind("Icon")

KindIcon is the NodeKind for Icon

var KindSummary = ast.NewNodeKind("Summary")

KindSummary is the NodeKind for Summary

var KindTaskCheckBoxListItem = ast.NewNodeKind("TaskCheckBoxListItem")

KindTaskCheckBoxListItem is the NodeKind for TaskCheckBoxListItem

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

func IsDetails Uses

func IsDetails(node ast.Node) bool

IsDetails returns true if the given node implements the Details interface, otherwise false.

func IsIcon Uses

func IsIcon(node ast.Node) bool

IsIcon returns true if the given node implements the Icon interface, otherwise false.

func IsMarkdownFile Uses

func IsMarkdownFile(name string) bool

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

func IsSummary Uses

func IsSummary(node ast.Node) bool

IsSummary returns true if the given node implements the Summary interface, otherwise false.

func IsTaskCheckBoxListItem Uses

func IsTaskCheckBoxListItem(node ast.Node) bool

IsTaskCheckBoxListItem returns true if the given node implements the TaskCheckBoxListItem interface, otherwise false.

func NewGiteaParseContext Uses

func NewGiteaParseContext(urlPrefix string, metas map[string]string, isWiki bool) parser.Context

NewGiteaParseContext creates a parser.Context with the gitea context set

func NewHTMLRenderer Uses

func NewHTMLRenderer(opts ...html.Option) renderer.NodeRenderer

NewHTMLRenderer creates a HTMLRenderer to render in the gitea form.

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 ASTTransformer Uses

type ASTTransformer struct{}

ASTTransformer is a default transformer of the goldmark tree.

func (*ASTTransformer) Transform Uses

func (g *ASTTransformer) Transform(node *ast.Document, reader text.Reader, pc parser.Context)

Transform transforms the given AST tree.

type Details Uses

type Details struct {
    ast.BaseBlock
}

Details is a block that contains Summary and details

func NewDetails Uses

func NewDetails() *Details

NewDetails returns a new Paragraph node.

func (*Details) Dump Uses

func (n *Details) Dump(source []byte, level int)

Dump implements Node.Dump .

func (*Details) Kind Uses

func (n *Details) Kind() ast.NodeKind

Kind implements Node.Kind.

type HTMLRenderer Uses

type HTMLRenderer struct {
    html.Config
}

HTMLRenderer is a renderer.NodeRenderer implementation that renders gitea specific features.

func (*HTMLRenderer) RegisterFuncs Uses

func (r *HTMLRenderer) RegisterFuncs(reg renderer.NodeRendererFuncRegisterer)

RegisterFuncs implements renderer.NodeRenderer.RegisterFuncs.

type Header struct {
    Level int
    Text  string
    ID    string
}

Header holds the data about a header.

type Icon Uses

type Icon struct {
    ast.BaseInline
    Name []byte
}

Icon is an inline for a fomantic icon

func NewIcon Uses

func NewIcon(name string) *Icon

NewIcon returns a new Paragraph node.

func (*Icon) Dump Uses

func (n *Icon) Dump(source []byte, level int)

Dump implements Node.Dump .

func (*Icon) Kind Uses

func (n *Icon) Kind() ast.NodeKind

Kind implements Node.Kind.

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 RenderConfig Uses

type RenderConfig struct {
    Meta string
    Icon string
    TOC  bool
    Lang string
}

RenderConfig represents rendering configuration for this file

func (*RenderConfig) ToRenderConfig Uses

func (rc *RenderConfig) ToRenderConfig(meta yaml.MapSlice)

ToRenderConfig converts a yaml.MapSlice to a RenderConfig

type Summary Uses

type Summary struct {
    ast.BaseBlock
}

Summary is a block that contains the summary of details block

func NewSummary Uses

func NewSummary() *Summary

NewSummary returns a new Summary node.

func (*Summary) Dump Uses

func (n *Summary) Dump(source []byte, level int)

Dump implements Node.Dump .

func (*Summary) Kind Uses

func (n *Summary) Kind() ast.NodeKind

Kind implements Node.Kind.

type TaskCheckBoxListItem Uses

type TaskCheckBoxListItem struct {
    *ast.ListItem
    IsChecked bool
}

TaskCheckBoxListItem is a block that repressents a list item of a markdown block with a checkbox

func NewTaskCheckBoxListItem Uses

func NewTaskCheckBoxListItem(listItem *ast.ListItem) *TaskCheckBoxListItem

NewTaskCheckBoxListItem returns a new TaskCheckBoxListItem node.

func (*TaskCheckBoxListItem) Dump Uses

func (n *TaskCheckBoxListItem) Dump(source []byte, level int)

Dump implements Node.Dump .

func (*TaskCheckBoxListItem) Kind Uses

func (n *TaskCheckBoxListItem) Kind() ast.NodeKind

Kind implements Node.Kind.

Package markdown imports 26 packages (graph) and is imported by 51 packages. Updated 2020-08-05. Refresh now. Tools for package owners.