browser

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2025 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultKeymap = Keymap{
	CloseTab: key.NewBinding(
		key.WithKeys("c", "ctrl+w"),
		key.WithHelp("c", "Close tab"),
	),
	NextTab: key.NewBinding(
		key.WithKeys("tab"),
		key.WithHelp("Tab", "Next tab"),
	),
	PrevTab: key.NewBinding(
		key.WithKeys("shift+tab"),
		key.WithHelp("Shift+Tab", "Previous tab"),
	),
	ShowHelp: key.NewBinding(
		key.WithKeys("h", "ctrl+h"),
		key.WithHelp("h", "Help"),
	),
	ToggleOfflineMode: key.NewBinding(
		key.WithKeys("o", "ctrl+o"),
		key.WithHelp("o", "Offline mode"),
	),
}

DefaultKeymap contains the default key bindings for the browser

Functions

This section is empty.

Types

type Help

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

Help is a popup that displays the help page.

func (Help) GetSize added in v1.6.5

func (h Help) GetSize() (width int, height int)

GetSize returns the size of the popup.

func (Help) Init

func (h Help) Init() tea.Cmd

Init initializes the popup.

func (Help) Update

func (h Help) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update updates the popup, in this case it's just static text.

func (Help) View

func (h Help) View() string

View renders the popup.

type Keymap

type Keymap struct {
	CloseTab          key.Binding
	NextTab           key.Binding
	PrevTab           key.Binding
	ShowHelp          key.Binding
	ToggleOfflineMode key.Binding
}

Keymap contains the key bindings for the browser

func (*Keymap) SetEnabled

func (k *Keymap) SetEnabled(enabled bool)

SetEnabled allows to disable/enable shortcuts

type Model

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

Model is used to store the state of the application

func New

func New(colors *theme.Colors, backend *backend.Backend) Model

New returns a new model with some sensible defaults

func (Model) FullHelp

func (m Model) FullHelp() [][]key.Binding

FullHelp returns the full help for the browser.

func (Model) Init

func (m Model) Init() tea.Cmd

Init initializes the model

func (Model) ShortHelp

func (m Model) ShortHelp() []key.Binding

ShortHelp returns the short help for the browser.

func (Model) Update

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

Update handles the terminal size, modifying rss items and modifying tabs

func (Model) View

func (m Model) View() string

View renders the tab bar, the active tab and the status bar

Jump to

Keyboard shortcuts

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