emoji

package
v3.38.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render

func Render(text string) string

Render expands emoji shortcodes in text using termoji. Standard Unicode emoji (e.g. :checkered_flag:) are converted to their Unicode code points on all terminals. Buildkite custom emoji (e.g. :docker:) are rendered as inline images on terminals that support the iTerm2 or Kitty graphics protocol; on other terminals they are left unchanged.

Because inline-image escape sequences embed foreground-colour resets, callers should not wrap the result in ANSI foreground styling (e.g. lipgloss). For coloured output, use Split to separate the emoji prefix so it can be rendered outside the colour span.

func Split

func Split(text string) (prefix, rest string)

Split separates leading emoji shortcodes from the rest of the text. Whitespace between the emoji and text is trimmed from both sides so callers can control spacing consistently.

Split(":docker: Build image")         → (":docker:", "Build image")
Split(":docker: :go: Build")          → (":docker: :go:", "Build")
Split("Build image")                  → ("", "Build image")
Split(":pipeline:")                   → (":pipeline:", "")

This is useful for coloured output: render the prefix with Render outside the ANSI colour span, and style only the rest.

Types

This section is empty.

Jump to

Keyboard shortcuts

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