ast

package
v0.0.0-...-0f9b62e Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2022 License: MIT Imports: 0 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blockquote

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

Blockquote represents a gemtext blockquote

func NewBlockquote

func NewBlockquote(l []byte) *Blockquote

func (*Blockquote) Bytes

func (l *Blockquote) Bytes() []byte

func (*Blockquote) Type

func (l *Blockquote) Type() LineType

type EmptyLine

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

EmptyLine represents an empty line

func NewEmptyLine

func NewEmptyLine() *EmptyLine

func (*EmptyLine) Bytes

func (l *EmptyLine) Bytes() []byte

func (*EmptyLine) Type

func (l *EmptyLine) Type() LineType

type Heading

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

Heading represents a gemtext heading

func NewHeading

func NewHeading(l []byte, level int) *Heading

func (*Heading) Bytes

func (l *Heading) Bytes() []byte

func (*Heading) Type

func (l *Heading) Type() LineType

type Line

type Line interface {
	//Type returns the LineType of the line
	Type() LineType
	//Bytes returns the raw bytes of the line
	Bytes() []byte
}

Line represents a single line of a gemtext document

type LineType

type LineType int

LineType is the type of the gemtext line

const (
	TypeEmpty LineType = iota
	TypeText
	TypeLink
	TypeHeading
	TypeListItem
	TypeBlockquote
	TypePreformatted
)
type Link struct {
	Url   string
	Label string
	// contains filtered or unexported fields
}

Link represents a gemtext link

func NewLink(l []byte, url string, label string) *Link

func (*Link) Bytes

func (l *Link) Bytes() []byte

func (*Link) Type

func (l *Link) Type() LineType

type ListItem

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

ListItem represents a gemtext list item

func NewListItem

func NewListItem(l []byte) *ListItem

func (*ListItem) Bytes

func (l *ListItem) Bytes() []byte

func (*ListItem) Type

func (l *ListItem) Type() LineType

type Preformatted

type Preformatted struct {
	AltText string
	// contains filtered or unexported fields
}

PreformattedText represents a preformatted line of text

func NewPreformattedText

func NewPreformattedText(l []byte, alt string) *Preformatted

func (*Preformatted) Bytes

func (l *Preformatted) Bytes() []byte

func (*Preformatted) Type

func (l *Preformatted) Type() LineType

type Text

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

Text represents a line of text

func NewText

func NewText(l []byte) *Text

func (*Text) Bytes

func (l *Text) Bytes() []byte

func (*Text) Type

func (l *Text) Type() LineType

Jump to

Keyboard shortcuts

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