navigation

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model added in v0.7.0

type Model interface {
	CurrentPage() int
	SetPage(page int)
	Pages() []string
}

Model is an interface for models.model, so that cycle imports are avoided

type Search struct {
	// Active - Show search bar instead of author and date?
	// Store keystrokes in Query?
	Active bool
	// Query stores the current "search term"
	SearchTextInput textinput.Model
}

Search represents the current search

func NewSearch added in v0.7.2

func NewSearch() Search

NewSearch creates and returns a new search model with the default settings.

func (*Search) Begin added in v0.7.0

func (s *Search) Begin()

Begin a new search (deletes old buffer)

func (*Search) Done added in v0.7.0

func (s *Search) Done()

Done marks the search as done, but does not delete the search buffer. This is useful if, for example, you want to jump to the next result and you therefore still need the buffer.

func (*Search) Execute added in v0.7.0

func (s *Search) Execute(m Model)

Execute search

func (*Search) Query added in v0.7.0

func (s *Search) Query() string

Query returns the text input's value.

func (*Search) SetQuery added in v0.7.2

func (s *Search) SetQuery(query string)

SetQuery sets the text input's value

type State

type State struct {
	Buffer      string
	Page        int
	TotalSlides int
}

State tracks the current buffer, page, and total number of slides

func Navigate(state State, keyPress string) State

Navigate receives the current State and keyPress, and returns the new State.

Jump to

Keyboard shortcuts

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