tui

package
v0.4.17 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const UNTITLED = "<UNTITLED>"

Variables

View Source
var HighlightStyle = lipgloss.NewStyle().Background(lipgloss.Color("#D8D7A0")).Foreground(lipgloss.Color("#000000"))

Functions

func AcceptibleSearchError

func AcceptibleSearchError(err error) bool

func GetSearchProgram

func GetSearchProgram(
	ctx context.Context,
	initialQuery string,
	dataProvider search.DataProvider,
	searchProvider search.SearchProvider,
	mapItem *func(x ListItem) list.Item,
) (*tea.Program, error)

@todo Rather than taking providers this should probably take a search function that can handle customized querying. I.e. if I want to return only full-text documents with this current setup i would need to create a new SearchProvider that returns full-text docs for the SearchUrls call

func OpenItem

func OpenItem(item list.Item) error

@todo Support other systems that don't have `open` @todo should prob store a list of the `item` structs that have the URL rather than doing this string manipulation

func ResultToItems

func ResultToItems(result *search.SearchResult, query string, mapItem ItemMapping) []list.Item

Types

type ItemMapping

type ItemMapping func(x ListItem) list.Item

type ListItem

type ListItem struct {
	// @note ItemTitle is thus named so as not to conflict with the Title() method, which is used by bubbletea
	ItemTitle, Desc string
	Body            *string
	Date            *time.Time
	// contains filtered or unexported fields
}

func (ListItem) Description

func (i ListItem) Description() string

func (ListItem) FilterValue

func (i ListItem) FilterValue() string

func (ListItem) Title

func (i ListItem) Title() string

Jump to

Keyboard shortcuts

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