Documentation
¶
Overview ¶
Package merge handles CLAUDE.md section parsing and merging.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Merge ¶
func Merge(layers []Layer, opts MergeOptions) string
Merge combines layers into a single document. Order: team (base) -> personal -> project Returns the merged markdown content.
func MergeSimple ¶
MergeSimple merges multiple markdown contents without layer metadata. Useful for simple cases where source tracking isn't needed.
func MergeWithLanguages ¶
func MergeWithLanguages(layers []Layer, opts MergeOptions) string
MergeWithLanguages performs the full merge including language configs. First merges base layers, then appends a language-specific section.
Types ¶
type Document ¶
type Document struct {
Preamble string // Content before the first H2
Sections []Section // H2-delimited sections
}
Document represents a parsed markdown document.
func (*Document) FindSection ¶
FindSection finds a section by header name (case-insensitive).
func (*Document) HasSection ¶
HasSection checks if a section exists (case-insensitive).
func (*Document) SectionHeaders ¶
SectionHeaders returns all section header names.
type MergeOptions ¶
type MergeOptions struct {
AnnotateSources bool // Add source comments
TeamRepo string // For header annotation (e.g., "acme/standards")
Languages []string // Active languages to include
LanguageFiles map[string][]*language.LanguageFile // Language files by language ID
}
MergeOptions controls merge behavior.