navigation

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2021 License: MIT Imports: 3 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"
	Query string
}

Search represents the current search

func (*Search) Begin added in v0.7.0

func (s *Search) Begin()

Begin a new search (deletes old buffer)

func (*Search) Delete added in v0.7.0

func (s *Search) Delete()

Delete the last keystroke from the buffer

func (*Search) Done added in v0.7.0

func (s *Search) Done()

Mark Search as Done - Do not delete 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) Write added in v0.7.0

func (s *Search) Write(key string)

Write a keystroke to the buffer

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