preview

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package preview renders inline terminal image previews.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Show

func Show(ctx context.Context, imageURL string, opts Options) error

Show downloads an image from imageURL and renders it to opts.Writer. Returns nil on any error (download, decode, render) — never crashes.

Types

type Options

type Options struct {
	// Width in character cells. 0 = auto-detect from terminal.
	Width int
	// Writer receives rendered escape sequences. Typically os.Stderr.
	Writer io.Writer
}

Options configures image preview rendering.

Jump to

Keyboard shortcuts

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