Documentation ¶
Index ¶
- Variables
- func ExtractMetadata(contents string, out any) (string, error)
- func ExtractMetadataBytes(contents []byte, out any) ([]byte, error)
- func NewHTMLRenderer(renderInternal *internal.RenderInternal, opts ...html.Option) renderer.NodeRenderer
- func Render(ctx *markup.RenderContext, input io.Reader, output io.Writer) error
- func RenderRaw(ctx *markup.RenderContext, input io.Reader, output io.Writer) error
- func RenderRawString(ctx *markup.RenderContext, content string) (string, error)
- func RenderString(ctx *markup.RenderContext, content string) (template.HTML, error)
- type ASTTransformer
- type Attention
- type ColorPreview
- type Details
- type GlodmarkRender
- type HTMLRenderer
- type Header
- type Icon
- type RenderConfig
- type Renderer
- type Summary
- type TaskCheckBoxListItem
Constants ¶
This section is empty.
Variables ¶
var KindAttention = ast.NewNodeKind("Attention")
KindAttention is the NodeKind for Attention
var KindColorPreview = ast.NewNodeKind("ColorPreview")
KindColorPreview is the NodeKind for ColorPreview
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 = "markdown"
MarkupName describes markup's name
Functions ¶
func ExtractMetadata ¶ added in v1.13.0
ExtractMetadata consumes a markdown file, parses YAML frontmatter, and returns the frontmatter metadata separated from the markdown content
func ExtractMetadataBytes ¶ added in v1.17.4
ExtractMetadata consumes a markdown file, parses YAML frontmatter, and returns the frontmatter metadata separated from the markdown content
func NewHTMLRenderer ¶ added in v1.12.0
func NewHTMLRenderer(renderInternal *internal.RenderInternal, opts ...html.Option) renderer.NodeRenderer
NewHTMLRenderer creates a HTMLRenderer to render in the gitea form.
func RenderRawString ¶ added in v1.15.0
func RenderRawString(ctx *markup.RenderContext, content string) (string, error)
RenderRawString renders Markdown to HTML without handling special links and return string
func RenderString ¶
RenderString renders Markdown string to HTML with all specific handling stuff and return string
Types ¶
type ASTTransformer ¶ added in v1.12.0
type ASTTransformer struct {
// contains filtered or unexported fields
}
ASTTransformer is a default transformer of the goldmark tree.
func NewASTTransformer ¶ added in v1.22.0
func NewASTTransformer(renderInternal *internal.RenderInternal) *ASTTransformer
type Attention ¶ added in v1.17.4
type Attention struct { ast.BaseInline AttentionType string }
Attention is an inline for an attention
func NewAttention ¶ added in v1.17.4
NewAttention returns a new Attention node.
type ColorPreview ¶ added in v1.17.4
type ColorPreview struct { ast.BaseInline Color []byte }
ColorPreview is an inline for a color preview
func NewColorPreview ¶ added in v1.17.4
func NewColorPreview(color []byte) *ColorPreview
NewColorPreview returns a new Span node.
func (*ColorPreview) Dump ¶ added in v1.17.4
func (n *ColorPreview) Dump(source []byte, level int)
Dump implements Node.Dump.
func (*ColorPreview) Kind ¶ added in v1.17.4
func (n *ColorPreview) Kind() ast.NodeKind
Kind implements Node.Kind.
type Details ¶ added in v1.12.0
Details is a block that contains Summary and details
func NewDetails ¶ added in v1.12.0
func NewDetails() *Details
NewDetails returns a new Paragraph node.
type GlodmarkRender ¶ added in v1.23.0
type GlodmarkRender struct {
// contains filtered or unexported fields
}
func SpecializedMarkdown ¶ added in v1.20.0
func SpecializedMarkdown(ctx *markup.RenderContext) *GlodmarkRender
SpecializedMarkdown sets up the Gitea specific markdown extensions
func (*GlodmarkRender) Convert ¶ added in v1.23.0
func (r *GlodmarkRender) Convert(source []byte, writer io.Writer, opts ...parser.ParseOption) error
func (*GlodmarkRender) Renderer ¶ added in v1.23.0
func (r *GlodmarkRender) Renderer() renderer.Renderer
type HTMLRenderer ¶ added in v1.12.0
HTMLRenderer is a renderer.NodeRenderer implementation that renders gitea specific features.
func (*HTMLRenderer) RegisterFuncs ¶ added in v1.12.0
func (r *HTMLRenderer) RegisterFuncs(reg renderer.NodeRendererFuncRegisterer)
RegisterFuncs implements renderer.NodeRenderer.RegisterFuncs.
type Icon ¶ added in v1.12.0
type Icon struct { ast.BaseInline Name []byte }
Icon is an inline for a Fomantic UI icon
type RenderConfig ¶ added in v1.12.0
type RenderConfig struct { Meta markup.RenderMetaMode Icon string TOC string // "false": hide, "side"/empty: in sidebar, "main"/"true": in main view Lang string // contains filtered or unexported fields }
RenderConfig represents rendering configuration for this file
func (*RenderConfig) UnmarshalYAML ¶ added in v1.17.4
func (rc *RenderConfig) UnmarshalYAML(value *yaml.Node) error
UnmarshalYAML implement yaml.v3 UnmarshalYAML
type Renderer ¶
type Renderer struct{}
Renderer implements markup.Renderer
func (Renderer) Extensions ¶ added in v1.15.0
Extensions implements markup.Renderer
func (Renderer) NeedPostProcess ¶ added in v1.15.0
NeedPostProcess implements markup.PostProcessRenderer
func (Renderer) SanitizerRules ¶ added in v1.15.0
func (Renderer) SanitizerRules() []setting.MarkupSanitizerRule
SanitizerRules implements markup.Renderer
type Summary ¶ added in v1.12.0
Summary is a block that contains the summary of details block
func NewSummary ¶ added in v1.12.0
func NewSummary() *Summary
NewSummary returns a new Summary node.
type TaskCheckBoxListItem ¶ added in v1.12.0
TaskCheckBoxListItem is a block that represents a list item of a markdown block with a checkbox
func NewTaskCheckBoxListItem ¶ added in v1.12.0
func NewTaskCheckBoxListItem(listItem *ast.ListItem) *TaskCheckBoxListItem
NewTaskCheckBoxListItem returns a new TaskCheckBoxListItem node.
func (*TaskCheckBoxListItem) Dump ¶ added in v1.12.0
func (n *TaskCheckBoxListItem) Dump(source []byte, level int)
Dump implements Node.Dump .
func (*TaskCheckBoxListItem) Kind ¶ added in v1.12.0
func (n *TaskCheckBoxListItem) Kind() ast.NodeKind
Kind implements Node.Kind.