Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FontFamily ¶
type FontFamily string
FontFamily 表示要使用的字体族。 项目直接使用 Go 自带字体字节,这样不依赖系统字体文件。
const ( FontRegular FontFamily = "regular" FontBold FontFamily = "bold" FontItalic FontFamily = "italic" FontBoldItalic FontFamily = "bolditalic" FontMono FontFamily = "mono" )
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
Renderer 负责 Markdown 的解析、布局与绘制。
为了性能更稳定,这里采用“三段式”流程: 1. Markdown AST 转内部结构 2. 根据目标宽度做布局 3. 一次性绘制到图片
type Theme ¶
type Theme struct {
Width int
Padding float64
BlockGap float64
ParagraphGap float64
ListItemGap float64
QuotePaddingX float64
QuotePaddingY float64
QuoteBarWidth float64
ListIndent float64
CodePaddingX float64
CodePaddingY float64
InlineCodePaddingX float64
InlineCodePaddingY float64
RuleSpacing float64
BaseFontSize float64
BaseLineHeight float64
CodeLineHeight float64
HeadingScale [6]float64
Radius float64
Background color.Color
Text color.Color
MutedText color.Color
Link color.Color
Rule color.Color
QuoteBar color.Color
QuoteFill color.Color
CodeFill color.Color
CodeText color.Color
InlineCode color.Color
}
Theme 定义整体视觉风格、间距和颜色方案。
func GitHubDarkTheme ¶
GitHubDarkTheme 提供偏 GitHub Markdown 的深色主题。
Click to show internal directories.
Click to hide internal directories.