Versions in this module Expand all Collapse all v1 v1.0.1 Jun 25, 2026 v1.0.0 Jun 25, 2026 Changes in this version + const FontStyleBold + const FontStyleItalic + const FontStyleNone + const FontStyleStrikethrough + const FontStyleUnderline + func CreateInlineSVGURL(svg string) string + type AdjustTargets int + const AdjustBackgrounds + const AdjustForegrounds + type AssetFile struct + Content string + Filename string + Hash string + type Assets struct + CSS AssetFile + JS AssetFile + type BlockDefaults struct + Frame Frame + HangingIndent int + LineNumbers bool + PreserveIndent bool + Wrap bool + type BlockDefaultsFileConfig struct + Frame *string + HangingIndent *int + LineNumbers *bool + PreserveIndent *bool + Wrap *bool + type CollapseOptions struct + Disabled bool + Enabled bool + Ranges []Range + Style *CollapseStyle + Threshold *int + type CollapseStyle int + const CollapseCollapsibleAuto + const CollapseCollapsibleEnd + const CollapseCollapsibleStart + const CollapseGithub + type CollapsibleConfig struct + CollapseButtonText string + CollapsedAnnouncement string + DefaultCollapsed bool + ExpandButtonText string + ExpandedAnnouncement string + LineThreshold int + PreserveIndent bool + PreviewLines int + Style CollapseStyle + type CollapsibleFileConfig struct + CollapseButtonText *string + CollapsedAnnouncement *string + DefaultCollapsed *bool + ExpandButtonText *string + ExpandedAnnouncement *string + LineThreshold *int + PreserveIndent *bool + PreviewLines *int + Style *string + type DarkMode interface + func BothMode(selector string) DarkMode + func MediaQueryMode() DarkMode + func SelectorMode(selector string) DarkMode + type DarkModeFileConfig struct + Kind string + Selector string + type DualThemeTokenizer interface + TokenizeDual func(code, lang, lightTheme, darkTheme string) (light, dark [][]Token, err error) + type Engine struct + func New(opts ...Option) *Engine + func (e *Engine) Assets() Assets + func (e *Engine) CSS() string + func (e *Engine) EnableCodeGroups() + func (e *Engine) JS() string + func (e *Engine) Render(code string, opts Options) (string, error) + func (e *Engine) RenderWithMeta(code string, metaStr string) (string, error) + func (e *Engine) ThemeCSS() string + func (e *Engine) Tokenize(code string, lang string) ([][]Token, error) + type FileConfig struct + CascadeLayer *string + Collapsible *CollapsibleFileConfig + ContentExclusion *bool + CopyButton *bool + DarkMode *DarkModeFileConfig + DataLineCount *bool + Defaults *BlockDefaultsFileConfig + FileIcons *bool + FileNameExtraction *bool + FrameDetection *bool + FullscreenButton *bool + LanguageAliases map[string]string + LanguageBadge *bool + LanguageDefaults map[string]BlockDefaultsFileConfig + LanguageIconMode *string + LineNumbers *bool + Links *bool + Locale *string + MermaidPassThrough *bool + MinContrast *float64 + Minify *bool + StyleOverrides map[string]any + StyleReset *bool + TabWidth *int + TerminalCommentStripping *bool + TerminalDotStyle *string + ThemeCSSRoot *string + ThemeToggleButton *bool + ThemedScrollbars *bool + ThemedSelection *bool + Themes *ThemesFileConfig + UIStrings map[string]string + WrapButton *bool + func ParseConfig(data []byte, format string) (*FileConfig, error) + type Frame int + const FrameAuto + const FrameCode + const FrameNone + const FrameTerminal + type Highlighter interface + GetLoadedLanguages func() []string + GetThemeColors func(theme string) (ThemeInfo, error) + Tokenize func(code, lang, theme string) ([][]Token, error) + type InlineMarker struct + IsRegex bool + Text string + Type MarkerType + type LangIconMode int + const LangIconAndText + const LangIconNone + const LangIconOnly + type LineMarker struct + Label string + Lines []Range + Type MarkerType + type MarkerType int + const MarkerDel + const MarkerIns + const MarkerMark + type Option func(*engineBuilder) + func FileConfigToOptions(fc *FileConfig) ([]Option, error) + func LoadConfig(path string) ([]Option, error) + func WithCascadeLayer(name string) Option + func WithCollapsible(c CollapsibleConfig) Option + func WithConfigDir(dir string) Option + func WithContentExclusion(enabled bool) Option + func WithCopyButton(enabled bool) Option + func WithDarkMode(dm DarkMode) Option + func WithDataLineCount(enabled bool) Option + func WithDefaults(d BlockDefaults) Option + func WithFileIconResolver(f func(ext string) string) Option + func WithFileIcons(enabled bool) Option + func WithFileNameExtraction(enabled bool) Option + func WithFrameDetection(enabled bool) Option + func WithFullscreenButton(enabled bool) Option + func WithHighlighter(hl Highlighter) Option + func WithLanguageAliases(m map[string]string) Option + func WithLanguageBadge(enabled bool) Option + func WithLanguageDefaults(m map[string]BlockDefaults) Option + func WithLanguageIconMode(mode LangIconMode) Option + func WithLineNumbers(enabled bool) Option + func WithLinks(enabled bool) Option + func WithLocale(loc string) Option + func WithMermaidPassThrough(enabled bool) Option + func WithMinContrast(ratio float64) Option + func WithMinify(enabled bool) Option + func WithStyleOverrides(overrides map[string]string) Option + func WithStyleReset(enabled bool) Option + func WithTabWidth(n int) Option + func WithTerminalCommentStripping(enabled bool) Option + func WithTerminalDotStyle(style TerminalDotStyle) Option + func WithThemeAdjustments(adj ThemeAdjustments) Option + func WithThemeCSSRoot(selector string) Option + func WithThemeCustomizer(f func(themeName string, colors ThemeInfo) ThemeInfo) Option + func WithThemeToggle(enabled bool) Option + func WithThemedScrollbars(enabled bool) Option + func WithThemedSelectionColors(enabled bool) Option + func WithThemedStyleOverrides(overrides map[string]StyleValue) Option + func WithThemes(light, dark string) Option + func WithUIStrings(overrides map[string]string) Option + func WithWarningHandler(f func(string)) Option + func WithWrapButton(enabled bool) Option + type Options struct + Collapse *CollapseOptions + DiffLang string + FocusLines []Range + Frame *Frame + HangingIndent *int + InlineMarkers []InlineMarker + Lang string + LineMarkers []LineMarker + LineNumbers *bool + PreserveIndent *bool + StartLineNumber *int + Theme string + Title string + Wrap *bool + type Range struct + End int + Start int + type StyleValue struct + Dark string + Light string + Value string + func (sv StyleValue) DarkValue() string + func (sv StyleValue) IsThemed() bool + func (sv StyleValue) LightValue() string + type TerminalDotStyle int + const DotsColored + const DotsMinimal + type ThemeAdjustments struct + Chroma *float64 + Hue *float64 + Targets AdjustTargets + type ThemeInfo struct + BG string + FG string + FoldBG string + LineNumberFG string + SelectionBG string + type ThemesFileConfig struct + Dark string + Light string + type Token struct + BgColor string + Color string + Content string + FontStyle int