Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CachedScanner ¶
type CachedScanner struct {
// contains filtered or unexported fields
}
CachedScanner wraps Scanner with caching and file watching capabilities
func NewCachedScanner ¶
func NewCachedScanner(scanner *Scanner, ttl time.Duration) (*CachedScanner, error)
NewCachedScanner creates a new cached scanner with file watching
func (*CachedScanner) Close ¶
func (cs *CachedScanner) Close() error
Close stops the file watcher and cleans up resources
func (*CachedScanner) CommandsDir ¶
func (cs *CachedScanner) CommandsDir() string
CommandsDir returns the commands directory path
func (*CachedScanner) ProjectDocsDir ¶
func (cs *CachedScanner) ProjectDocsDir() string
ProjectDocsDir returns the project docs directory path
func (*CachedScanner) ProjectRootDir ¶
func (cs *CachedScanner) ProjectRootDir() string
ProjectRootDir returns the project root directory path
type FileInfo ¶
type FileInfo struct {
Name string // original filename
Filename string // filename with source prefix (e.g., "commands:action/commit.md")
Normalized string // lowercase for matching
Source Source // source type
Path string // absolute path
Size int64 // file size in bytes
Description string // description from frontmatter (if present)
Tags []string // tags from frontmatter (if present)
}
FileInfo contains metadata about a documentation file
type Frontmatter ¶ added in v0.2.0
Frontmatter contains metadata extracted from YAML frontmatter
func ParseFrontmatter ¶ added in v0.2.0
func ParseFrontmatter(content []byte) (frontmatter Frontmatter, strippedContent []byte)
ParseFrontmatter extracts YAML frontmatter from markdown content. Returns frontmatter metadata and content without the frontmatter block. If no frontmatter exists or parsing fails, returns empty metadata and original content.
type Params ¶
type Params struct {
CommandsDir string
ProjectDocsDir string
ProjectRootDir string
MaxFileSize int64
ExcludeDirs []string
}
Params contains parameters for creating a scanner
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner discovers and indexes documentation files from multiple sources
func (*Scanner) CommandsDir ¶
CommandsDir returns the commands directory path
func (*Scanner) ProjectDocsDir ¶
ProjectDocsDir returns the project docs directory path
func (*Scanner) ProjectRootDir ¶
ProjectRootDir returns the project root directory path
type Source ¶
type Source string
Source represents documentation source type
const ( // SourceCommands represents ~/.claude/commands documentation SourceCommands Source = "commands" // SourceProjectDocs represents project docs (with configurable exclusions) SourceProjectDocs Source = "project-docs" // SourceProjectRoot represents root-level markdown files SourceProjectRoot Source = "project-root" )