help

package
v0.0.0-...-d61613f Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShowContextualHelp

func ShowContextualHelp(context HelpContext, specific string) error

ShowContextualHelp shows help for a specific context

func ShowHelp

func ShowHelp() error

ShowHelp shows the help viewer as a standalone TUI

func ShowHelpTopic

func ShowHelpTopic(topicID string) error

ShowHelpTopic shows a specific help topic

Types

type HelpContext

type HelpContext string

HelpContext represents different contexts where help can be accessed

const (
	ContextCommand         HelpContext = "command"
	ContextTUI             HelpContext = "tui"
	ContextError           HelpContext = "error"
	ContextGettingStarted  HelpContext = "getting-started"
	ContextConfiguration   HelpContext = "configuration"
	ContextTroubleshooting HelpContext = "troubleshooting"
)

type HelpManager

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

HelpManager manages the help system

func NewHelpManager

func NewHelpManager() (*HelpManager, error)

NewHelpManager creates a new help manager

func (*HelpManager) FormatForTerminal

func (hm *HelpManager) FormatForTerminal(text string) string

FormatForTerminal formats text for terminal display with proper wrapping

func (*HelpManager) GetCategories

func (hm *HelpManager) GetCategories() []string

GetCategories returns all available categories

func (*HelpManager) GetCommandHelp

func (hm *HelpManager) GetCommandHelp(command string) (string, error)

GetCommandHelp returns contextual help for a specific command

func (*HelpManager) GetContextualHelp

func (hm *HelpManager) GetContextualHelp(context HelpContext, specific string) (string, error)

GetContextualHelp provides help based on current context

func (*HelpManager) GetRelatedTopics

func (hm *HelpManager) GetRelatedTopics(id string) []*HelpTopic

GetRelatedTopics retrieves topics related to a given topic ID

func (*HelpManager) GetTopic

func (hm *HelpManager) GetTopic(id string) (*HelpTopic, error)

GetTopic retrieves a help topic by ID

func (*HelpManager) GetTopicsByCategory

func (hm *HelpManager) GetTopicsByCategory(category string) []*HelpTopic

GetTopicsByCategory retrieves help topics by category

func (*HelpManager) GetTopicsByContext

func (hm *HelpManager) GetTopicsByContext(context HelpContext) []*HelpTopic

GetTopicsByContext retrieves help topics for a specific context

func (*HelpManager) ListTopics

func (hm *HelpManager) ListTopics() []*HelpTopic

ListTopics returns all available help topics

func (*HelpManager) RenderTopic

func (hm *HelpManager) RenderTopic(id string) (string, error)

RenderTopic renders a help topic as markdown

func (*HelpManager) SearchTopics

func (hm *HelpManager) SearchTopics(query string) []*HelpTopic

SearchTopics searches for help topics by keyword or title

func (*HelpManager) SetWidth

func (hm *HelpManager) SetWidth(width int)

SetWidth sets the rendering width for the help content

type HelpTopic

type HelpTopic struct {
	ID          string   `json:"id"`
	Title       string   `json:"title"`
	Category    string   `json:"category"`
	Keywords    []string `json:"keywords"`
	RelatedTo   []string `json:"related_to"`
	FilePath    string   `json:"file_path"`
	Context     string   `json:"context"` // command, tui, error, getting-started
	Priority    int      `json:"priority"`
	Description string   `json:"description"`
}

HelpTopic represents a help topic with metadata

type KeyMap

type KeyMap struct {
	Up       key.Binding
	Down     key.Binding
	Left     key.Binding
	Right    key.Binding
	Back     key.Binding
	Enter    key.Binding
	Search   key.Binding
	Help     key.Binding
	Quit     key.Binding
	Escape   key.Binding
	PageUp   key.Binding
	PageDown key.Binding
	Home     key.Binding
	End      key.Binding
}

KeyMap defines key bindings for the help viewer

func DefaultKeyMap

func DefaultKeyMap() KeyMap

DefaultKeyMap returns the default key map

type TopicItem

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

TopicItem implements list.Item for help topics

func (TopicItem) Description

func (i TopicItem) Description() string

func (TopicItem) FilterValue

func (i TopicItem) FilterValue() string

func (TopicItem) Title

func (i TopicItem) Title() string

type ViewerModel

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

ViewerModel represents the help viewer TUI model

func NewViewerModel

func NewViewerModel() (*ViewerModel, error)

NewViewerModel creates a new help viewer model

func (ViewerModel) Init

func (m ViewerModel) Init() tea.Cmd

Init initializes the model

func (ViewerModel) Update

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

Update handles messages

func (ViewerModel) View

func (m ViewerModel) View() string

View renders the help viewer

type ViewerState

type ViewerState int

ViewerState represents the current state of the help viewer

const (
	StateTopicList ViewerState = iota
	StateTopicView
	StateSearch
)

Jump to

Keyboard shortcuts

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