Documentation
¶
Index ¶
- func BuildTree(result *ast.TokensResult, opts *ast.CodeToHTMLOptions) *ast.Element
- func FontStyleCSS(fs theme.FontStyle) map[string]string
- func RenderANSI(w io.Writer, result *ast.TokensResult, opts *ast.CodeToANSIOptions) error
- func RenderPlainText(w io.Writer, result *ast.TokensResult) error
- func RenderSVG(w io.Writer, result *ast.TokensResult, opts *ast.CodeToSVGOptions) error
- func TokenStyles(tok ast.ThemedToken) map[string]string
- func TokenStylesMulti(tok ast.ThemedToken, defaultColor bool) map[string]string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildTree ¶
func BuildTree(result *ast.TokensResult, opts *ast.CodeToHTMLOptions) *ast.Element
BuildTree converts a TokensResult into an HTML element tree, applying decorations and transformer hooks.
func FontStyleCSS ¶
FontStyleCSS converts a FontStyle bitmask to CSS property map.
func RenderANSI ¶
func RenderANSI(w io.Writer, result *ast.TokensResult, opts *ast.CodeToANSIOptions) error
RenderANSI writes ANSI-escaped highlighted code to w.
func RenderPlainText ¶
func RenderPlainText(w io.Writer, result *ast.TokensResult) error
RenderPlainText writes token content to w with no formatting.
func RenderSVG ¶
func RenderSVG(w io.Writer, result *ast.TokensResult, opts *ast.CodeToSVGOptions) error
RenderSVG writes highlighted code as a self-contained SVG document to w.
func TokenStyles ¶
func TokenStyles(tok ast.ThemedToken) map[string]string
TokenStyles converts a token's style into an inline style map (single-theme).
func TokenStylesMulti ¶
func TokenStylesMulti(tok ast.ThemedToken, defaultColor bool) map[string]string
TokenStylesMulti converts a token's style into a combined style map (multi-theme).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.