textutil

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ElideLabel

func ElideLabel(label string, maxWidth float64) string

ElideLabel truncates labels that exceed maxWidth pixels using middle ellipsis strategy for better readability.

Example:

label := ElideLabel("Cloud Engineering Leadership", 90)
// Returns: "Cloud Engi...dership"

func ElideLabelEnd

func ElideLabelEnd(label string, maxWidth float64) string

ElideLabelEnd truncates labels at the end if they exceed maxWidth.

Example:

label := ElideLabelEnd("Very long description text", 50)
// Returns: "Very long descri..."

func ElideLabelWithContext

func ElideLabelWithContext(label string, maxWidth float64) string

ElideLabelWithContext automatically detects label type and applies the most appropriate elision strategy.

Types

This section is empty.

Jump to

Keyboard shortcuts

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