feed

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: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultKeymap = Keymap{
	Open: key.NewBinding(
		key.WithKeys("enter"),
		key.WithHelp("Enter", "Open"),
	),
	ToggleFocus: key.NewBinding(
		key.WithKeys("left", "right", "h", "l"),
		key.WithHelp("←/→", "Move left/right"),
	),
	RefreshArticles: key.NewBinding(
		key.WithKeys("r", "ctrl+r"),
		key.WithHelp("r/ctrl+r", "Refresh"),
	),
	OpenInPager: key.NewBinding(
		key.WithKeys("p", "ctrl+p"),
		key.WithHelp("p/ctrl+p", "Open in pager"),
	),
	SaveArticle: key.NewBinding(
		key.WithKeys("s", "ctrl+s"),
		key.WithHelp("s/ctrl+s", "Save"),
	),
	DeleteFromSaved: key.NewBinding(
		key.WithKeys("d", "ctrl+d"),
		key.WithHelp("d/ctrl+d", "Delete from saved"),
	),
	CycleSelection: key.NewBinding(
		key.WithKeys("g"),
		key.WithHelp("g", "Cycle selection"),
	),
	MarkAsUnread: key.NewBinding(
		key.WithKeys("u"),
		key.WithHelp("u", "Mark as unread"),
	),
}

DefaultKeymap contains the default key bindings for this tab

Functions

This section is empty.

Types

type Keymap

type Keymap struct {
	Open            key.Binding
	ToggleFocus     key.Binding
	RefreshArticles key.Binding
	OpenInPager     key.Binding
	SaveArticle     key.Binding
	DeleteFromSaved key.Binding
	CycleSelection  key.Binding
	MarkAsUnread    key.Binding
}

Keymap contains the key bindings for this tab

func (*Keymap) SetEnabled added in v1.5.1

func (m *Keymap) SetEnabled(enabled bool)

SetEnabled allows to disable/enable shortcuts

type Model

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

Model contains the state of this tab

func New

func New(colors *theme.Colors, width, height int, title string, fetcher backend.ArticleFetcher) Model

New creates a new feed tab with sensible defaults

func (Model) DisableDeleting

func (m Model) DisableDeleting() Model

DisableDeleting disables the deleting of the article

func (Model) DisableSaving

func (m Model) DisableSaving() Model

DisableSaving disables the saving of the article

func (Model) FullHelp

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

FullHelp returns the full help for the tab

func (Model) Init

func (m Model) Init() tea.Cmd

Init initializes the tab

func (Model) SetSize

func (m Model) SetSize(width, height int) tab.Tab

SetSize sets the dimensions of the tab

func (Model) ShortHelp

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

ShortHelp returns the short help for the tab

func (Model) Style

func (m Model) Style() tab.Style

Style returns the style of the tab

func (Model) Title

func (m Model) Title() string

Title returns the title of the tab

func (Model) Update

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

Update the variables of the tab

func (Model) View

func (m Model) View() string

View the tab

Jump to

Keyboard shortcuts

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