Documentation
¶
Overview ¶
Package help provides display-agnostic help content management.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateID ¶
GenerateID creates a URL-safe ID from a title. "Getting Started" -> "getting-started"
Types ¶
type Catalog ¶
type Catalog struct {
// contains filtered or unexported fields
}
Catalog manages help topics.
func DefaultCatalog ¶
func DefaultCatalog() *Catalog
DefaultCatalog returns a catalog with built-in topics.
func (*Catalog) Search ¶
func (c *Catalog) Search(query string) []*SearchResult
Search searches for topics.
type Frontmatter ¶
type Frontmatter struct {
Title string `yaml:"title"`
Tags []string `yaml:"tags"`
Related []string `yaml:"related"`
Order int `yaml:"order"`
}
Frontmatter represents YAML frontmatter metadata.
func ExtractFrontmatter ¶
func ExtractFrontmatter(content string) (*Frontmatter, string)
ExtractFrontmatter extracts YAML frontmatter from markdown content. Returns the parsed frontmatter and the remaining content.
type SearchResult ¶
type SearchResult struct {
Topic *Topic
Section *Section // nil if topic-level match
Score float64
Snippet string // Context around match
}
SearchResult represents a search match.
type Section ¶
type Section struct {
ID string `json:"id"`
Title string `json:"title"`
Level int `json:"level"`
Line int `json:"line"` // Start line in content (1-indexed)
Content string `json:"content"` // Content under heading
}
Section represents a heading within a topic.
func ExtractSections ¶
ExtractSections parses markdown and returns sections.
type Topic ¶
type Topic struct {
ID string `json:"id"`
Title string `json:"title"`
Path string `json:"path"`
Content string `json:"content"`
Sections []Section `json:"sections"`
Tags []string `json:"tags"`
Related []string `json:"related"`
Order int `json:"order"` // For sorting
}
Topic represents a help topic/page.
Click to show internal directories.
Click to hide internal directories.