docs

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: MIT Imports: 24 Imported by: 0

README

Docs

Core logic and TUI rendering for the interactive documentation browser.

Includes:

  • Interactive TUI doc viewer
  • Asynchronous documentation search
  • AI-powered Q&A integration

For detailed documentation on the TUI and search capabilities, see the Docs Component Documentation.

Documentation

Index

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, log.Level), providerOverride ...string) (string, error)

AskAI encapsulates the logic to query the AI about the documentation. logFn is optional, if provided it receives log output.

func GetAllMarkdownContent

func GetAllMarkdownContent(fsys fs.FS) (string, error)

GetAllMarkdownContent walks the FS and concatenates all .md files.

func ResolveProvider

func ResolveProvider(p *props.Props, providerOverride ...string) chat.Provider

ResolveProvider determines the AI provider to use based on override, config, and defaults.

func Serve

func Serve(ctx context.Context, fsys fs.FS, port int) error

Serve starts a documentation server on the given port serving the provided filesystem.

Types

type AskFunc

type AskFunc func(question string, log func(string, log.Level)) (string, error)

type AskLogMsg

type AskLogMsg struct {
	Log string
	Ch  <-chan string
}

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 AskResultMsg struct {
	Response string
	Err      error
}

type ListItem

type ListItem struct {
	Title    string
	Path     string
	IsGroup  bool
	Children []NavNode
}

type LogFinishedMsg

type LogFinishedMsg struct{}

type MkDocsConfig

type MkDocsConfig struct {
	Nav []any `yaml:"nav"`
}

type Model

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

func NewModel

func NewModel(fsys fs.FS, opts ...Option) *Model

func (*Model) Init

func (m *Model) Init() tea.Cmd

func (*Model) Update

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

func (*Model) View

func (m *Model) View() string
type NavNode struct {
	Title    string
	Path     string
	Children []NavNode
}

type Option

type Option func(*Model)

func WithAskFunc

func WithAskFunc(fn AskFunc) Option

func WithTitle

func WithTitle(title string) Option

type SearchResult

type SearchResult struct {
	Title   string
	Path    string
	Excerpt string
}

type SearchResultMessage

type SearchResultMessage struct {
	Results []SearchResult
	Query   string
}

Directories

Path Synopsis
vcs

Jump to

Keyboard shortcuts

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