markdown

package
v0.0.0-...-59e9b9b Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderBytes

func RenderBytes(bs []byte, width int) ([]byte, error)

func RenderString

func RenderString(s string, width int) ([]byte, error)

Types

type AutoLink struct {
	// contains filtered or unexported fields
}

func (AutoLink) String

func (a AutoLink) String() string

func (AutoLink) Visit

func (a AutoLink) Visit(v Visitor)

type CodeSpan

type CodeSpan struct {
	// contains filtered or unexported fields
}

func (CodeSpan) String

func (c CodeSpan) String() string

func (CodeSpan) Visit

func (c CodeSpan) Visit(v Visitor)

type Document

type Document struct {
	// contains filtered or unexported fields
}

func (Document) String

func (d Document) String() string

func (Document) Visit

func (d Document) Visit(v Visitor)

type Emphasis

type Emphasis struct {
	// contains filtered or unexported fields
}

func (Emphasis) String

func (e Emphasis) String() string

func (Emphasis) Visit

func (e Emphasis) Visit(v Visitor)

type Expr

type Expr interface {
	Visit(Visitor)
	String() string
}

type HTMLBlock

type HTMLBlock struct {
	// contains filtered or unexported fields
}

func (HTMLBlock) String

func (h HTMLBlock) String() string

func (HTMLBlock) Visit

func (h HTMLBlock) Visit(v Visitor)

type Heading

type Heading struct {
	// contains filtered or unexported fields
}

func (Heading) String

func (h Heading) String() string

func (Heading) Visit

func (h Heading) Visit(v Visitor)
type Link struct {
	// contains filtered or unexported fields
}

func (Link) String

func (l Link) String() string

func (Link) Visit

func (l Link) Visit(v Visitor)

type List

type List struct {
	// contains filtered or unexported fields
}

func (List) String

func (l List) String() string

func (List) Visit

func (l List) Visit(v Visitor)

type ListContext

type ListContext struct {
	// contains filtered or unexported fields
}

type ListItem

type ListItem struct {
	// contains filtered or unexported fields
}

func (ListItem) String

func (l ListItem) String() string

func (ListItem) Visit

func (l ListItem) Visit(v Visitor)

type Markdown

type Markdown struct {
	// contains filtered or unexported fields
}

func NewMarkdown

func NewMarkdown(width int) *Markdown

func (*Markdown) RenderBytes

func (r *Markdown) RenderBytes(bs []byte) ([]byte, error)

type Paragraph

type Paragraph struct {
	// contains filtered or unexported fields
}

func (Paragraph) String

func (p Paragraph) String() string

func (Paragraph) Visit

func (p Paragraph) Visit(v Visitor)

type Printer

type Printer struct {
	io.Writer
	// contains filtered or unexported fields
}

func NewPrinter

func NewPrinter(w io.Writer, width int) *Printer
func (p *Printer) VisitAutoLink(expr AutoLink)

VisitAutoLink implements Visitor

func (*Printer) VisitCodeSpan

func (p *Printer) VisitCodeSpan(expr CodeSpan)

VisitCodeSpan implements Visitor

func (*Printer) VisitDocument

func (p *Printer) VisitDocument(expr Document)

VisitDocument implements Visitor

func (*Printer) VisitEmphasis

func (p *Printer) VisitEmphasis(expr Emphasis)

func (*Printer) VisitHTMLBlock

func (p *Printer) VisitHTMLBlock(expr HTMLBlock)

VisitHTMLBlock implements Visitor

func (*Printer) VisitHeading

func (p *Printer) VisitHeading(expr Heading)
func (p *Printer) VisitLink(expr Link)

VisitLink implements Visitor

func (*Printer) VisitList

func (p *Printer) VisitList(expr List)

VisitList implements Visitor

func (*Printer) VisitListItem

func (p *Printer) VisitListItem(expr ListItem)

VisitListItem implements Visitor

func (*Printer) VisitParagraph

func (p *Printer) VisitParagraph(expr Paragraph)

VisitParagraph implements Visitor

func (*Printer) VisitRawHTML

func (p *Printer) VisitRawHTML(expr RawHTML)

VisitRawHTML implements Visitor

func (*Printer) VisitString

func (p *Printer) VisitString(expr String)

VisitString implements Visitor

func (*Printer) VisitText

func (p *Printer) VisitText(expr Text)

VisitText implements Visitor

func (*Printer) VisitTextBlock

func (p *Printer) VisitTextBlock(expr TextBlock)

VisitTextBlock implements Visitor

type RawHTML

type RawHTML struct {
	// contains filtered or unexported fields
}

func (RawHTML) String

func (r RawHTML) String() string

func (RawHTML) Visit

func (r RawHTML) Visit(v Visitor)

type Renderer

type Renderer struct {
	// contains filtered or unexported fields
}

An experimental renderer that will build its own ast

func NewRenderer

func NewRenderer(width int) *Renderer

func (*Renderer) AddOptions

func (r *Renderer) AddOptions(...renderer.Option)

AddOptions implements renderer.Renderer

func (*Renderer) Render

func (r *Renderer) Render(w io.Writer, source []byte, node ast.Node) error

Render implements renderer.Renderer

type String

type String struct {
	// contains filtered or unexported fields
}

func (String) String

func (s String) String() string

func (String) Visit

func (s String) Visit(v Visitor)

type Text

type Text struct {
	// contains filtered or unexported fields
}

func (Text) String

func (t Text) String() string

func (Text) Visit

func (t Text) Visit(v Visitor)

type TextBlock

type TextBlock struct {
	// contains filtered or unexported fields
}

func (TextBlock) String

func (t TextBlock) String() string

func (TextBlock) Visit

func (t TextBlock) Visit(v Visitor)

type Visitor

type Visitor interface {
	VisitDocument(expr Document)
	VisitTextBlock(expr TextBlock)
	VisitHTMLBlock(expr HTMLBlock)
	VisitParagraph(expr Paragraph)
	VisitText(expr Text)
	VisitString(expr String)
	VisitList(expr List)
	VisitListItem(expr ListItem)
	VisitCodeSpan(expr CodeSpan)
	VisitRawHTML(expr RawHTML)
	VisitLink(expr Link)
	VisitAutoLink(expr AutoLink)
	VisitHeading(expr Heading)
	VisitEmphasis(expr Emphasis)
}

Jump to

Keyboard shortcuts

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