Documentation
¶
Index ¶
- func ShowContextualHelp(context HelpContext, specific string) error
- func ShowHelp() error
- func ShowHelpTopic(topicID string) error
- type HelpContext
- type HelpManager
- func (hm *HelpManager) FormatForTerminal(text string) string
- func (hm *HelpManager) GetCategories() []string
- func (hm *HelpManager) GetCommandHelp(command string) (string, error)
- func (hm *HelpManager) GetContextualHelp(context HelpContext, specific string) (string, error)
- func (hm *HelpManager) GetRelatedTopics(id string) []*HelpTopic
- func (hm *HelpManager) GetTopic(id string) (*HelpTopic, error)
- func (hm *HelpManager) GetTopicsByCategory(category string) []*HelpTopic
- func (hm *HelpManager) GetTopicsByContext(context HelpContext) []*HelpTopic
- func (hm *HelpManager) ListTopics() []*HelpTopic
- func (hm *HelpManager) RenderTopic(id string) (string, error)
- func (hm *HelpManager) SearchTopics(query string) []*HelpTopic
- func (hm *HelpManager) SetWidth(width int)
- type HelpTopic
- type KeyMap
- type TopicItem
- type ViewerModel
- type ViewerState
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 ShowHelpTopic ¶
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
type TopicItem ¶
type TopicItem struct {
// contains filtered or unexported fields
}
TopicItem implements list.Item for help topics
func (TopicItem) Description ¶
func (TopicItem) FilterValue ¶
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
type ViewerState ¶
type ViewerState int
ViewerState represents the current state of the help viewer
const ( StateTopicList ViewerState = iota StateTopicView StateSearch )