view

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Nerd iconType = "nerd"
	Text iconType = "text"
)

Variables

View Source
var DefaultIconConfig = &IconConfig{
	IconType: Nerd,
	Icons:    &NerdIcons,
}
View Source
var NerdIcons = Icons{
	None:   "  ",
	Done:   " ",
	Undone: " ",

	Inbox:    " ",
	Favorite: " ",

	Indent:     "│ ",
	LastIndent: "└ ",
}
View Source
var TextIcons = Icons{
	None:   "  ",
	Done:   "[x]",
	Undone: "[ ]",

	Inbox:    "IN",
	Favorite: "* ",

	Indent:     "  ",
	LastIndent: "  ",
}

Functions

func NewSectionView

func NewSectionView(sections []*model.Section, icons *Icons) *sectionView

Types

type IconConfig

type IconConfig struct {
	IconType iconType `toml:"default"`
	*Icons
}

func (*IconConfig) UnmarshalTOML

func (c *IconConfig) UnmarshalTOML(p any) error

type Icons

type Icons struct {
	None   string `toml:"none"`
	Done   string `toml:"done"`
	Undone string `toml:"undone"`

	Inbox    string `toml:"inbox"`
	Favorite string `toml:"favorite"`

	Indent     string `toml:"indent"`
	LastIndent string `toml:"last_indent"`
}

type ReorderItem

type ReorderItem struct {
	ID          string
	Description string
}

type ReorderView

type ReorderView interface {
	View
	Reorder() ([]string, error)
}

func NewReorderView

func NewReorderView(items []*ReorderItem) ReorderView

type TaskViewConfig

type TaskViewConfig struct {
	Tree        bool `json:"-"`
	Description bool `json:"-"`
}

type View

type View interface {
	Render() string
}

func NewFilterView

func NewFilterView(filters []*sync.Filter, icons *Icons) View

func NewLabelView

func NewLabelView(labels []*model.Label, icons *Icons) View

func NewProjectView

func NewProjectView(projects []*sync.Project, icons *Icons) View

func NewTaskView

func NewTaskView(tasks []*model.Task, icons *Icons, config *TaskViewConfig) View

Jump to

Keyboard shortcuts

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