Help us shape the future of Go! Take the 2026 Go Developer Survey

render

package
v1.22.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package render rasterizes a compact subset of HTML and CSS to a PNG entirely in-process: no browser, no subprocess, no cgo. It is intended for generating design previews that a model can inspect as an image.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Width      int    // CSS px viewport width; if <=0 default 1200
	Height     int    // CSS px viewport height; if <=0 grow to fit content
	Scale      int    // device pixel ratio; if <=0 default 2; clamp to 1..4
	Background string // page background if body/html sets none; default "#ffffff"
}

type Result

type Result struct {
	PNG      []byte
	Width    int
	Height   int
	Warnings []string
}

func Render

func Render(htmlSrc, cssSrc string, opts Options) (Result, error)

Jump to

Keyboard shortcuts

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