ui

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package ui provides a user interface for searching.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunTemplatePicker

func RunTemplatePicker(templatesPath string) (string, error)

RunTemplatePicker launches the interactive UI for selecting a markdown template. It returns the path to the chosen template or an error if none was selected.

Types

type SearchModel

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

SearchModel is a Bubble Tea model to provide interactive UI for search using bleve.

func NewSearchModel

func NewSearchModel(idx bleve.Index) SearchModel

NewSearchModel initializes SearchModel with bleve index.

func (SearchModel) Chosen

func (m SearchModel) Chosen() string

Chosen returns the path of the selected note. It returns an empty string if none is selected or the search is aborted.

func (SearchModel) Init

func (m SearchModel) Init() tea.Cmd

func (SearchModel) Update

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

func (SearchModel) View

func (m SearchModel) View() string

type TemplatePickerModel

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

TemplatePickerModel represents the Bubble Tea state for the template selection UI.

func NewTemplatePicker

func NewTemplatePicker(templatesDir string) (TemplatePickerModel, error)

NewTemplatePicker initializes the model with available markdown templates.

func (TemplatePickerModel) Init

func (m TemplatePickerModel) Init() tea.Cmd

Init implements tea.Model.

func (TemplatePickerModel) Update

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

Update implements tea.Model, handling keyboard navigation.

func (TemplatePickerModel) View

func (m TemplatePickerModel) View() string

View implements tea.Model, rendering the list of templates.

Jump to

Keyboard shortcuts

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