util

package
v0.0.0-...-5fc3c60 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTMLToText

func HTMLToText(s string, width int) string

HTMLToText converts an HTML string to readable terminal text. Links become clickable OSC 8 hyperlinks, truncated to width with "…". Block elements, lists, and entities are converted to clean plain text. Pass width <= 0 to skip link truncation.

func MakeHyperlink(url, displayText string) string

MakeHyperlink creates a terminal hyperlink using OSC 8 escape sequences. This allows URLs to be clickable without displaying the full URL text. Most modern terminals support this standard (iTerm2, Konsole, GNOME Terminal, Windows Terminal, etc.)

func TruncateText

func TruncateText(s string, maxLen int) string

TruncateText truncates s to maxLen runes, appending "…" if truncated.

Types

This section is empty.

Jump to

Keyboard shortcuts

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