spec

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Cache Spec

	TOC           *api.InteractionResponseData
	Subcomponents = map[string][]discord.SelectOption{}
)
View Source
var (
	GoBack = discord.SelectOption{
		Label: "Go Back",
		Value: "back",
		Emoji: &discord.ComponentEmoji{Name: "↩️"},
	}
)

Functions

func NodesSelect

func NodesSelect(nodes []*Node) *discord.ContainerComponents

Types

type Code

type Code string

func (Code) Markdown

func (c Code) Markdown() string

type Heading

type Heading struct {
	Level int
	Text  string
}

func (Heading) Markdown

func (h Heading) Markdown() string

type Italic

type Italic string

func (Italic) Markdown

func (i Italic) Markdown() string
type Link struct {
	Text     string
	Location string
}

func (Link) Markdown

func (t Link) Markdown() string

type List

type List struct {
	Ordered bool
	Items   []Paragraph
}

func (List) Markdown

func (l List) Markdown() string

type Node

type Node struct {
	Level   int
	Heading string
	Content []Note
	Nodes   []*Node
}

func (Node) Match

func (n Node) Match() string

func (Node) Render

func (n Node) Render(limit int) (string, bool)

type Note

type Note interface {
	Markdown() string
}

type Paragraph

type Paragraph []Note

func (Paragraph) Markdown

func (p Paragraph) Markdown() string

type Pre

type Pre string

func (Pre) Markdown

func (p Pre) Markdown() string

type Spec

type Spec struct {
	Nodes []*Node

	Keywords map[string][]*Node
	Headings map[string]*Node
	// contains filtered or unexported fields
}

func QuerySpec

func QuerySpec() (Spec, error)

func (Spec) Search

func (s Spec) Search(query string) []*Node

type Text

type Text string

func (Text) Markdown

func (t Text) Markdown() string

Jump to

Keyboard shortcuts

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