markdown

package
v0.4.0-beta.47 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Emoji = &emojiExt{}

Emoji is an extension that allow you to use emoji expression like '~~text~~' .

View Source
var EmojiAttributeFilter = html.GlobalAttributeFilter

EmojiAttributeFilter defines attribute names which dd elements can have.

View Source
var KindContainer = ast.NewNodeKind("Container")
View Source
var KindEmojiInline = gast.NewNodeKind("Emoji")

KindEmojiInline is a NodeKind of the Emoji node.

View Source
var KindExecutionBlock = ast.NewNodeKind("ExecutionBlock")

KindRundownBlock is a NodeKind of the RundownBlock node.

View Source
var KindRundownBlock = ast.NewNodeKind("RundownBlock")

KindRundownBlock is a NodeKind of the RundownBlock node.

View Source
var KindRundownInline = ast.NewNodeKind("RundownInline")

KindRundown is a NodeKind of the Rundown node.

View Source
var KindSection = ast.NewNodeKind("Section")

KindRundownBlock is a NodeKind of the RundownBlock node.

View Source
var KindSectionedDocument = ast.NewNodeKind("SectionedDocument")

KindRundownBlock is a NodeKind of the RundownBlock node.

View Source
var KindTextSubInline = ast.NewNodeKind("TextSubInline")

KindRundownBlock is a NodeKind of the RundownBlock node.

View Source
var RundownElements = &rundownElements{}

Functions

func NewEmojiParser

func NewEmojiParser() parser.InlineParser

NewEmojiParser return a new InlineParser that parses emoji expressions.

func NewEmojiRenderer

func NewEmojiRenderer() renderer.NodeRenderer

NewEmojiHTMLRenderer returns a new EmojiHTMLRenderer.

func NewRundownASTTransformer

func NewRundownASTTransformer() parser.ASTTransformer

NewFootnoteASTTransformer returns a new parser.ASTTransformer that insert a footnote list to the last of the document.

func NewRundownBlockParser

func NewRundownBlockParser() parser.BlockParser

func NewRundownInlineParser

func NewRundownInlineParser() parser.InlineParser

NewRundownInlineParser return a new InlineParser that can parse inline htmls

func NewRundownParaTransformer

func NewRundownParaTransformer() parser.ParagraphTransformer

func NewTextSubParser

func NewTextSubParser() parser.InlineParser

NewEmphasisParser return a new InlineParser that parses emphasises.

Types

type Container

type Container struct {
	ast.Document
	Name string
}

func NewContainer

func NewContainer(name string) *Container

func (*Container) Dump

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

func (*Container) Kind

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

Kind implements Node.Kind.

type EmojiInline

type EmojiInline struct {
	gast.BaseInline
	EmojiCode string
}

A EmojiInline struct represents a emoji of GFM text.

func NewEmojiInline

func NewEmojiInline(code string) *EmojiInline

NewEmojiInline returns a new EmojiInline node.

func (*EmojiInline) Dump

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

Dump implements Node.Dump.

func (*EmojiInline) Kind

func (n *EmojiInline) Kind() gast.NodeKind

Kind implements Node.Kind.

type EmojiRenderer

type EmojiRenderer struct {
	html.Config
}

EmojiHTMLRenderer is a renderer.NodeRenderer implementation that renders Emoji nodes.

func (*EmojiRenderer) RegisterFuncs

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

RegisterFuncs implements renderer.NodeRenderer.RegisterFuncs.

type ExecutionBlock

type ExecutionBlock struct {
	ast.BaseBlock

	Modifiers *Modifiers
	Syntax    string
	Origin    *ast.FencedCodeBlock
	ID        string
}

func NewExecutionBlock

func NewExecutionBlock(syntax string, modifiers *Modifiers) *ExecutionBlock

NewRundownBlock returns a new RundownBlock node.

func (*ExecutionBlock) Dump

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

Dump implements Node.Dump.

func (*ExecutionBlock) Kind

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

Kind implements Node.Kind.

func (*ExecutionBlock) SetOrigin

func (n *ExecutionBlock) SetOrigin(fcb *ast.FencedCodeBlock, source []byte)

IsRaw implements Node.IsRaw.

type Flag

type Flag string

type Modifiers

type Modifiers struct {
	fmt.Stringer
	Values map[Parameter]string
	Flags  map[Flag]bool
}

func MergeModifiers

func MergeModifiers(left, right *Modifiers) *Modifiers

func NewModifiers

func NewModifiers() *Modifiers

func ParseModifiers

func ParseModifiers(line string, kvSep string) *Modifiers

func (*Modifiers) GetFlag

func (m *Modifiers) GetFlag(name Flag) *bool

func (*Modifiers) GetValue

func (m *Modifiers) GetValue(name Parameter) *string

func (*Modifiers) HasAll

func (m *Modifiers) HasAll(names ...string) bool

func (*Modifiers) HasAny

func (m *Modifiers) HasAny(names ...string) bool

func (*Modifiers) Ingest

func (m *Modifiers) Ingest(from *Modifiers)

func (*Modifiers) String

func (m *Modifiers) String() string

type Parameter

type Parameter string

type RundownBlock

type RundownBlock struct {
	ast.BaseBlock

	ForCodeBlock bool
	Modifiers    *Modifiers
}

func NewRundownBlock

func NewRundownBlock(modifiers *Modifiers) *RundownBlock

NewRundownBlock returns a new RundownBlock node.

func (*RundownBlock) Dump

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

Dump implements Node.Dump.

func (*RundownBlock) GetModifiers

func (n *RundownBlock) GetModifiers() *Modifiers

func (*RundownBlock) IsRaw

func (n *RundownBlock) IsRaw() bool

IsRaw implements Node.IsRaw.

func (*RundownBlock) Kind

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

Kind implements Node.Kind.

type RundownInline

type RundownInline struct {
	ast.BaseInline
	Segments       *text.Segments
	Modifiers      *Modifiers
	MutateContents func(input []byte) []byte
}

A Rundown struct represents an inline <rundown> element.

func NewRundownInline

func NewRundownInline(mods *Modifiers) *RundownInline

NewRundown returns a new Rundown node.

func (*RundownInline) Dump

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

Dump implements Node.Dump.

func (*RundownInline) GetModifiers

func (n *RundownInline) GetModifiers() *Modifiers

func (*RundownInline) Inline

func (n *RundownInline) Inline()

Inline implements Inline.Inline.

func (*RundownInline) Kind

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

Kind implements Node.Kind.

type RundownInlineParser

type RundownInlineParser struct {
}

func (*RundownInlineParser) CloseBlock

func (s *RundownInlineParser) CloseBlock(parent ast.Node, pc parser.Context)

func (*RundownInlineParser) Parse

func (s *RundownInlineParser) Parse(parent ast.Node, block text.Reader, pc parser.Context) ast.Node

func (*RundownInlineParser) Trigger

func (s *RundownInlineParser) Trigger() []byte

type RundownNode

type RundownNode interface {
	ast.Node
	GetModifiers() *Modifiers
}

type Section

type Section struct {
	ast.BaseBlock

	Handlers    *Container
	Options     *Container
	Description list.List // Description is a list as we want to keep it inside the DOM.
	Setups      list.List // Setups is a list to keep them in the DOM too.

	Label        *string
	FunctionName *string
	Level        int
	Name         string
	// contains filtered or unexported fields
}

func NewSectionForRoot

func NewSectionForRoot() *Section

func NewSectionFromHeading

func NewSectionFromHeading(heading *ast.Heading, source []byte) *Section

NewRundownBlock returns a new RundownBlock node.

func (*Section) Append

func (n *Section) Append(child ast.Node)

func (*Section) AppendChild

func (n *Section) AppendChild(self, node ast.Node)

func (*Section) Dump

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

Dump implements Node.Dump.

func (*Section) ForceLevel

func (n *Section) ForceLevel(newLevel int)

Shifts to Root Level, and then adds the given Level to all.

func (*Section) ForceRootLevel

func (n *Section) ForceRootLevel()

Forces the section to be at Level 1, and all children are shifted accordingly.

func (*Section) Kind

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

Kind implements Node.Kind.

type SectionedDocument

type SectionedDocument struct {
	ast.Document
	Sections []*Section
}

func NewSectionedDocument

func NewSectionedDocument() *SectionedDocument

NewRundownBlock returns a new RundownBlock node.

func (*SectionedDocument) AddSection

func (n *SectionedDocument) AddSection(section *Section)

func (*SectionedDocument) Dump

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

Dump implements Node.Dump.

func (*SectionedDocument) Kind

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

Kind implements Node.Kind.

type TextSubInline

type TextSubInline struct {
	ast.BaseInline
	Segment text.Segment
	// contains filtered or unexported fields
}

func NewTextSubInline

func NewTextSubInline() *TextSubInline

NewRundownBlock returns a new RundownBlock node.

func (*TextSubInline) Dump

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

Dump implements Node.Dump.

func (*TextSubInline) Kind

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

Kind implements Node.Kind.

func (*TextSubInline) Substitute

func (n *TextSubInline) Substitute(contents []byte)

func (*TextSubInline) Text

func (n *TextSubInline) Text(source []byte) []byte

Jump to

Keyboard shortcuts

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