tree

package
v0.0.0-...-b82ce1f Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GTNode

type GTNode struct {
	Node
	Path  string
	Guide *guides.Guide
}

type GTTree

type GTTree struct {
	Model
	// contains filtered or unexported fields
}

type KeyMap

type KeyMap struct {
	Bottom      key.Binding
	Top         key.Binding
	SectionDown key.Binding
	SectionUp   key.Binding
	Down        key.Binding
	Up          key.Binding
	Quit        key.Binding

	ShowFullHelp  key.Binding
	CloseFullHelp key.Binding
}

KeyMap holds the key bindings for the table.

func DefaultKeyMap

func DefaultKeyMap() KeyMap

DefaultKeyMap is the default key bindings for the table.

type Model

type Model struct {
	KeyMap KeyMap
	Styles Styles

	Help help.Model

	AdditionalShortHelpKeys func() []key.Binding
	// contains filtered or unexported fields
}

func New

func New(nodes []Node, width int, height int) Model

func (Model) Cursor

func (m Model) Cursor() int

func (Model) FullHelp

func (m Model) FullHelp() [][]key.Binding

func (*Model) GetSelectedNode

func (m *Model) GetSelectedNode() (Node, error)

func (Model) Height

func (m Model) Height() int

func (*Model) NavDown

func (m *Model) NavDown()

func (*Model) NavUp

func (m *Model) NavUp()

func (Model) Nodes

func (m Model) Nodes() []Node

func (*Model) NumberOfNodes

func (m *Model) NumberOfNodes() int

func (*Model) SetCursor

func (m *Model) SetCursor(cursor int)

func (*Model) SetHeight

func (m *Model) SetHeight(newHeight int)

func (*Model) SetNodes

func (m *Model) SetNodes(nodes []Node)

func (*Model) SetShowHelp

func (m *Model) SetShowHelp() bool

func (*Model) SetSize

func (m *Model) SetSize(width, height int)

func (*Model) SetWidth

func (m *Model) SetWidth(newWidth int)

func (Model) ShortHelp

func (m Model) ShortHelp() []key.Binding

func (Model) Update

func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)

func (Model) View

func (m Model) View() string

func (Model) Width

func (m Model) Width() int

type Node

type Node struct {
	Value    string
	Desc     string
	Children []Node
}

func ExampleResourceTree

func ExampleResourceTree() []Node

func GenerateGuideTree

func GenerateGuideTree(path string) []Node

func GenerateResourceTree

func GenerateResourceTree(m core.ResourceList) []Node

func InitResourceTree

func InitResourceTree() []Node

The default model of the resource tree in the downloads view

type Styles

type Styles struct {
	Shapes     lipgloss.Style
	Selected   lipgloss.Style
	Unselected lipgloss.Style
	Help       lipgloss.Style
}

Jump to

Keyboard shortcuts

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