export

package
v0.0.0-...-0d6f639 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyToClipboard

func CopyToClipboard(content string, w io.Writer) error

CopyToClipboard writes the content to the terminal clipboard using OSC52. The writer defaults to stdout when nil.

func Render

func Render(result *diff.DiffResult, format Format, opts Options) (string, error)

Render returns the diff in the requested format.

Types

type Format

type Format string

Format represents the desired export format.

const (
	// FormatHTML emits an HTML document for the diff.
	FormatHTML Format = "html"
	// FormatMarkdown emits a Markdown diff code block.
	FormatMarkdown Format = "markdown"
	// FormatANSI emits an ANSI-colored string.
	FormatANSI Format = "ansi"
)

type Options

type Options struct {
	// Title will be shown in HTML/Markdown outputs when provided.
	Title string
	// ShowLineNumbers determines whether line numbers are included.
	ShowLineNumbers bool
}

Options control how a diff is exported.

Jump to

Keyboard shortcuts

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