Documentation
¶
Index ¶
- Constants
- Variables
- func CustomFilter(config config.Config) list.FilterFunc
- func GetWslHostName() string
- func IsWSL() bool
- func IsWayland() bool
- func Render(items []list.Item, cmds *Commands, errors []string, cfg *config.Config) (*tea.Program, error)
- type Body
- type Commands
- func (c Commands) Add(url string, name string) error
- func (c Commands) CleanFeeds() error
- func (c Commands) CountUnread() int
- func (c Commands) GetAllFeeds() ([]store.Item, error)
- func (c Commands) GetGlamourisedArticle(ID int) (string, error)
- func (c Commands) ImportFeeds(source string) error
- func (c Commands) List() error
- func (c Commands) Monitor(prog *tea.Program)
- func (c Commands) Refresh() error
- func (c Commands) ShowConfig() error
- func (c *Commands) TUI() error
- type ErrorItem
- type FetchResultError
- type Filterer
- type Head
- type ListKeyMapT
- type OPML
- type Outline
- type OutlineType
- type TUIItem
- type ViewportKeyMapT
Constants ¶
const (
RssOutlineType = "rss"
)
Variables ¶
var ListKeyMap = ListKeyMapT{ Open: key.NewBinding( key.WithKeys("enter"), key.WithHelp("enter", "open"), ), Favourite: key.NewBinding( key.WithKeys("f"), key.WithHelp("f", "favourite"), ), ToggleFavourites: key.NewBinding( key.WithKeys("F"), key.WithHelp("F", "toggle show favourite"), ), Read: key.NewBinding( key.WithKeys("m"), key.WithHelp("m", "mark read"), ), ToggleReads: key.NewBinding( key.WithKeys("M"), key.WithHelp("M", "toggle show read"), ), MarkAllRead: key.NewBinding( key.WithKeys("alt+m"), key.WithHelp("alt+m", "mark all read"), ), Refresh: key.NewBinding( key.WithKeys("r"), key.WithHelp("r", "refresh"), ), OpenInBrowser: key.NewBinding( key.WithKeys("o"), key.WithHelp("o", "open in browser"), ), Sort: key.NewBinding( key.WithKeys("s"), key.WithHelp("s", "sort"), ), EditConfig: key.NewBinding( key.WithKeys("E"), key.WithHelp("E", "edit config in $EDITOR"), ), Suspend: key.NewBinding( key.WithKeys("ctrl+z"), key.WithHelp("ctrl+z", "suspend"), ), // contains filtered or unexported fields }
ListKeyMap shows either (o)verrides or new keybinds
var ViewportKeyMap = ViewportKeyMapT{ Next: key.NewBinding( key.WithKeys("l", "right"), key.WithHelp("l/→", "next"), ), Prev: key.NewBinding( key.WithKeys("h", "left"), key.WithHelp("h/←", "prev"), ), Quit: key.NewBinding( key.WithKeys("ctrl+c"), key.WithHelp("ctrl+c", "quit"), ), Escape: key.NewBinding( key.WithKeys("esc", "q"), key.WithHelp("q/esc", "escape"), ), Suspend: key.NewBinding( key.WithKeys("ctrl+z"), key.WithHelp("ctrl+z", "suspend"), ), OpenInBrowser: key.NewBinding( key.WithKeys("o"), key.WithHelp("o", "open in browser"), ), Favourite: key.NewBinding( key.WithKeys("f"), key.WithHelp("f", "favourite"), ), Read: key.NewBinding( key.WithKeys("m"), key.WithHelp("m", "mark read"), ), GotoStart: key.NewBinding( key.WithKeys("g", "home"), key.WithHelp("g", "top"), ), GotoEnd: key.NewBinding( key.WithKeys("G", "end"), key.WithHelp("G", "bottom"), ), ShowFullHelp: key.NewBinding( key.WithKeys("?"), key.WithHelp("?", "more"), ), CloseFullHelp: key.NewBinding( key.WithKeys("?"), key.WithHelp("?", "close help"), ), }
ViewportKeyMapT shows *all* keybinds, pulling from viewport.DefaultKeyMap()
Functions ¶
func CustomFilter ¶ added in v2.2.0
func CustomFilter(config config.Config) list.FilterFunc
func GetWslHostName ¶
func GetWslHostName() string
Gets the subsystem host ip If the CLI is running under WSL the localhost url will not work so this function should return the real ip that we should redirect to
Types ¶
type Commands ¶
type Commands struct {
// contains filtered or unexported fields
}
func (Commands) CleanFeeds ¶
func (Commands) CountUnread ¶ added in v2.13.0
func (Commands) GetGlamourisedArticle ¶
func (Commands) ImportFeeds ¶ added in v2.18.0
func (Commands) ShowConfig ¶ added in v2.6.2
type FetchResultError ¶
type FetchResultError struct {
// contains filtered or unexported fields
}
type Filterer ¶ added in v2.2.0
type Filterer struct {
FeedNames []string
Tags []string
Term struct {
Title string
FeedNames []string
Tags []string
}
Config config.Config
}
Struct to aid in filtering items into ranks for BubbleTea
func (*Filterer) ExtractFiltersFor ¶ added in v2.2.0
Extracts `tag:.*` from the stored f.Term.Title
type ListKeyMapT ¶ added in v2.2.2
type ListKeyMapT struct {
Open key.Binding
Read key.Binding
Favourite key.Binding
ToggleReads key.Binding
MarkAllRead key.Binding
ToggleFavourites key.Binding
Refresh key.Binding
OpenInBrowser key.Binding
Sort key.Binding
EditConfig key.Binding
Suspend key.Binding
// contains filtered or unexported fields
}
ListKeyMapT shows either (o)verrides or new keybinds
func (ListKeyMapT) FullHelp ¶ added in v2.2.2
func (k ListKeyMapT) FullHelp() []key.Binding
This shows *additional* (or overridden) keybinds alongside built-ins, which *must* take []key.Binding unfortunately.
func (ListKeyMapT) SetOverrides ¶ added in v2.2.2
func (k ListKeyMapT) SetOverrides(l *list.Model)
func (ListKeyMapT) ShortHelp ¶ added in v2.2.2
func (k ListKeyMapT) ShortHelp() []key.Binding
This shows *additional* (or overridden) keybinds alongside built-ins
type Outline ¶ added in v2.18.0
type Outline struct {
XMLName xml.Name `xml:"outline"`
Outlines []Outline `xml:"outline,omitempty"`
Text string `xml:"text,attr"`
Title string `xml:"title,attr,omitempty"`
Type OutlineType `xml:"type,attr,omitempty"`
XMLUrl *url.URL `xml:"xmlUrl,attr,omitempty"`
}
func (*Outline) UnmarshalXML ¶ added in v2.18.0
type OutlineType ¶ added in v2.18.0
type OutlineType string
type TUIItem ¶
type TUIItem struct {
Title string
FeedName string
URL string
ID int
Read bool
Favourite bool
Tags []string
}
func ItemToTUIItem ¶
func (TUIItem) FilterValue ¶
type ViewportKeyMapT ¶ added in v2.2.2
type ViewportKeyMapT struct {
Quit key.Binding
Escape key.Binding
OpenInBrowser key.Binding
Favourite key.Binding
Read key.Binding
GotoStart key.Binding
GotoEnd key.Binding
Next key.Binding
Prev key.Binding
ShowFullHelp key.Binding
CloseFullHelp key.Binding
Suspend key.Binding
}
ViewportKeyMapT shows *all* keybinds, pulling from viewport.DefaultKeyMap()
func (ViewportKeyMapT) FullHelp ¶ added in v2.2.2
func (k ViewportKeyMapT) FullHelp() [][]key.Binding
This show *all* keybinds, as bubbles/viewport doesn't provide a help function
func (ViewportKeyMapT) ShortHelp ¶ added in v2.2.2
func (k ViewportKeyMapT) ShortHelp() []key.Binding
This show *all* keybinds, as bubbles/viewport doesn't provide a help function