Documentation
¶
Overview ¶
Package docs provides a documentation system with two subsystems: a generation engine that parses Cobra command trees into Markdown files with hierarchy-aware index management, and a TUI browser built on Bubbles with split-pane navigation, async search, and AI-powered Q&A via retrieval-augmented generation (RAG).
Documentation is typically embedded in the binary via props.Assets under an assets/docs path, and the feature can be toggled via the DocsCmd feature flag.
Index ¶
- func AskAI(ctx context.Context, p *props.Props, fsys fs.FS, question string, ...) (string, error)
- func GetAllMarkdownContent(fsys fs.FS) (string, error)
- func ResolveProvider(p *props.Props, providerOverride ...string) chat.Provider
- func Serve(ctx context.Context, fsys fs.FS, port int) error
- type AskDeltaMsg
- type AskFunc
- type AskLogMsg
- type AskResponse
- type AskResultMsg
- type ListItem
- type LogFinishedMsg
- type MkDocsConfig
- type Model
- type NavNode
- type Option
- type SearchResult
- type SearchResultMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AskAI ¶
func AskAI(ctx context.Context, p *props.Props, fsys fs.FS, question string, logFn func(string, logger.Level), deltaFn func(string), providerOverride ...string) (string, error)
AskAI queries the AI about the embedded documentation. If the provider supports streaming, deltas are delivered via deltaFn as they arrive. logFn receives status messages. Either callback may be nil.
func GetAllMarkdownContent ¶
GetAllMarkdownContent walks the FS and concatenates all .md files.
func ResolveProvider ¶
ResolveProvider determines the AI provider to use based on override, config, and defaults.
Types ¶
type AskDeltaMsg ¶ added in v1.8.0
type AskFunc ¶
type AskFunc func(question string, logFn func(string, logger.Level), deltaFn func(string)) (string, error)
AskFunc is the callback signature for AI Q&A. logFn receives status messages; deltaFn receives streamed text fragments as they arrive (may be nil).
type AskResponse ¶
type AskResponse struct {
Answer string `json:"answer" jsonschema:"description=The comprehensive answer to the user's question based on the documentation provided."`
}
type AskResultMsg ¶
type LogFinishedMsg ¶
type LogFinishedMsg struct{}
type MkDocsConfig ¶
type MkDocsConfig struct {
}
type SearchResult ¶
type SearchResultMessage ¶
type SearchResultMessage struct {
Results []SearchResult
Query string
}