Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ThemeVariants = map[string]string{
"technical": "干净、专业的风格,适合技术文档和IT领域的书籍",
"elegant": "优雅的风格,使用衬线字体,适合文学和出版类书籍",
"minimal": "极简风格,简洁干净,大量空白,高度可读性",
}
ThemeVariants 定义可用的主题变体及其描述
Functions ¶
func GetThemeDescription ¶
GetThemeDescription 获取主题的描述
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:"codeBg"`
// 代码文本颜色
CodeText string `yaml:"codeText"`
// 强调颜色
Accent string `yaml:"accent"`
// 边框颜色
Border string `yaml:"border"`
}
ColorScheme 定义颜色方案
type MarginSettings ¶
type MarginSettings struct {
// 上边距
Top float64 `yaml:"top"`
// 下边距
Bottom float64 `yaml:"bottom"`
// 左边距
Left float64 `yaml:"left"`
// 右边距
Right float64 `yaml:"right"`
}
MarginSettings 定义边距设置 (单位: mm)
type Theme ¶
type Theme struct {
// 主题名称
Name string `yaml:"name"`
// 页面大小 (A4, Letter等)
PageSize string `yaml:"pageSize"`
// 字体族
FontFamily string `yaml:"fontFamily"`
// 字体大小 (pt)
FontSize int `yaml:"fontSize"`
// 代码主题
CodeTheme string `yaml:"codeTheme"`
// 行高
LineHeight float64 `yaml:"lineHeight"`
// 颜色设置
Colors ColorScheme `yaml:"colors"`
// 边距设置
Margins MarginSettings `yaml:"margins"`
// 页眉模板
HeaderTemplate string `yaml:"headerTemplate"`
FooterTemplate string `yaml:"footerTemplate"`
}
Theme 定义了文档的主题样式
type ThemeManager ¶
type ThemeManager struct {
// contains filtered or unexported fields
}
ThemeManager 管理主题的加载和获取
func (*ThemeManager) LoadFromFile ¶
func (tm *ThemeManager) LoadFromFile(path string) (*Theme, error)
LoadFromFile 从YAML文件加载主题
Click to show internal directories.
Click to hide internal directories.