Documentation
¶
Overview ¶
Package config loads and merges repolens configuration.
Two trust domains (ADR-005): the in-repo .repolens.yml may only affect rendering (site, ignore, render, rules, theme, view, agent), while source, output and access are honored only from the external --config file and CLI flags. Precedence: CLI > external config > in-repo config > defaults. Render rules cascade in order, later rules overriding earlier ones. View.TOCPanel accepts "floating" or "inline"; invalid values are reported as warnings and rendered with the floating fallback by site assembly. View.Search is a site-level browser UI switch and does not cascade.
Index ¶
- func Load(repoRoot, externalPath string, flags Flags) (*Config, []Warning, error)
- type Access
- type Agent
- type AgentFullText
- type CodeOptions
- type Config
- type Encrypt
- type FileOptions
- type Flags
- type HTMLOptions
- type MarkdownOptions
- type Output
- type Rule
- type Site
- type Source
- type Theme
- type View
- type Warning
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Agent ¶
type Agent struct {
LLMSTxt bool `yaml:"llms_txt"`
LLMSFull AgentFullText `yaml:"llms_full"`
IndexJSON bool `yaml:"index_json"`
}
Agent configures machine-readable outputs.
type AgentFullText ¶
AgentFullText configures llms-full.txt.
type CodeOptions ¶
CodeOptions configures code rendering.
type Config ¶
type Config struct {
Source Source `yaml:"source"`
Output Output `yaml:"output"`
Access Access `yaml:"access"`
Site Site `yaml:"site"`
Ignore []string `yaml:"ignore"`
Render FileOptions `yaml:"render"`
Rules []Rule `yaml:"rules"`
Theme Theme `yaml:"theme"`
View View `yaml:"view"`
Agent Agent `yaml:"agent"`
}
Config is the fully merged repolens configuration.
func (*Config) OptionsFor ¶
func (c *Config) OptionsFor(filePath string) FileOptions
OptionsFor returns the effective rendering options for a repo-relative path.
type Encrypt ¶
type Encrypt struct {
Enabled bool `yaml:"enabled"`
Paths []string `yaml:"paths"`
PasswordEnv string `yaml:"password_env"`
}
Encrypt reserves the v1 client-side encryption schema.
type FileOptions ¶
type FileOptions struct {
Render bool `yaml:"render"`
Markdown MarkdownOptions `yaml:"markdown"`
HTML HTMLOptions `yaml:"html"`
Code CodeOptions `yaml:"code"`
MaxFileSize int64 `yaml:"max_file_size"`
}
FileOptions are the effective rendering options for one file.
type HTMLOptions ¶
type HTMLOptions struct {
View string `yaml:"view"`
}
HTMLOptions configures browser pages for HTML files.
type MarkdownOptions ¶
type MarkdownOptions struct {
TOC bool `yaml:"toc"`
TOCMinHeadings int `yaml:"toc_min_headings"`
Anchors bool `yaml:"anchors"`
Mermaid bool `yaml:"mermaid"`
Math bool `yaml:"math"`
FrontmatterTitle bool `yaml:"frontmatter_title"`
}
MarkdownOptions configures Markdown rendering.
type Rule ¶
type Rule struct {
Match string `yaml:"match"`
Render *bool `yaml:"render"`
Markdown *MarkdownOptions `yaml:"markdown"`
HTML *HTMLOptions `yaml:"html"`
Code *CodeOptions `yaml:"code"`
MaxFileSize *int64 `yaml:"max_file_size"`
// contains filtered or unexported fields
}
Rule applies file option overrides to paths matching Match.
Option fields hold only what the rule explicitly sets; unset fields are Go zero values, not effective defaults. Always resolve effective options through Config.OptionsFor rather than reading these fields directly.
type Site ¶
type Site struct {
Title string `yaml:"title"`
Language string `yaml:"language"`
Home string `yaml:"home"`
}
Site configures site-level metadata.
type Theme ¶
type Theme struct {
Vars map[string]string `yaml:"vars"`
CSS string `yaml:"css"`
Templates string `yaml:"templates"`
}
Theme configures user-overridable theme inputs.
type View ¶
type View struct {
TreePosition string `yaml:"tree_position"`
TreeExpandDepth int `yaml:"tree_expand_depth"`
// TOCPanel controls Markdown TOC placement: "floating" or "inline".
TOCPanel string `yaml:"toc_panel"`
// Search controls the browser-layer filename and heading search UI.
Search bool `yaml:"search"`
}
View configures browser UI layout.