Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ThemeVariants = map[string]string{
"technical": "Clean, professional style for technical documentation and IT books",
"elegant": "Elegant serif-based style for fiction, essays, and publishing",
"minimal": "Minimal style with generous whitespace and high readability",
}
ThemeVariants lists available theme variants and their descriptions.
Functions ¶
func GetThemeDescription ¶
GetThemeDescription returns the human-readable description for a theme.
Types ¶
type ColorScheme ¶
type ColorScheme struct {
Text string `yaml:"text"`
Background string `yaml:"background"`
Heading string `yaml:"heading"`
Link string `yaml:"link"`
CodeBg string `yaml:"code_bg"`
CodeText string `yaml:"code_text"`
Accent string `yaml:"accent"`
Border string `yaml:"border"`
}
ColorScheme defines the color palette for a theme.
type MarginSettings ¶
type MarginSettings struct {
Top float64 `yaml:"top"`
Bottom float64 `yaml:"bottom"`
Left float64 `yaml:"left"`
Right float64 `yaml:"right"`
}
MarginSettings defines page margins in millimeters.
type Theme ¶
type Theme struct {
Name string `yaml:"name"`
PageSize string `yaml:"page_size"` // e.g. A4, Letter
FontFamily string `yaml:"font_family"`
FontSize int `yaml:"font_size"` // in pt
CodeTheme string `yaml:"code_theme"`
LineHeight float64 `yaml:"line_height"`
Colors ColorScheme `yaml:"colors"`
Margins MarginSettings `yaml:"margins"`
HeaderTemplate string `yaml:"header_template"`
}
Theme defines the document theme styling.
type ThemeManager ¶
type ThemeManager struct {
// contains filtered or unexported fields
}
ThemeManager manages theme loading and retrieval.
func NewThemeManager ¶
func NewThemeManager() *ThemeManager
NewThemeManager creates a new theme manager pre-loaded with built-in themes.
func (*ThemeManager) Get ¶
func (tm *ThemeManager) Get(name string) (*Theme, error)
Get returns the theme with the given name.
func (*ThemeManager) List ¶
func (tm *ThemeManager) List() []string
List returns the names of all available themes.
func (*ThemeManager) LoadFromFile ¶
func (tm *ThemeManager) LoadFromFile(path string) (*Theme, error)
LoadFromFile loads a theme from a YAML file.
Click to show internal directories.
Click to hide internal directories.