renderer

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 27, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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

func FontStyleCSS(fs theme.FontStyle) map[string]string

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL