Liking cljdoc? Tell your friends :D

clj-string-layout.width

Display-width helpers for use with the :display-width layout option.

Display-width helpers for use with the :display-width layout option.
raw docstring

ansi-widthclj

(ansi-width value)

Returns the display width of value after removing ANSI escape sequences.

Use as :display-width width/ansi-width for colored terminal output where SGR color/style codes should not count as visible columns.

Returns the display width of value after removing ANSI escape sequences.

Use as `:display-width width/ansi-width` for colored terminal output where SGR
color/style codes should not count as visible columns.
sourceraw docstring

codepoint-widthclj

(codepoint-width codepoint)

Returns a terminal-style display width for one Unicode code point.

Control, combining, enclosing, spacing-combining, and format code points are treated as zero-width. East Asian wide/fullwidth code points are treated as two columns. Other code points are treated as one column.

Returns a terminal-style display width for one Unicode code point.

Control, combining, enclosing, spacing-combining, and format code points are
treated as zero-width. East Asian wide/fullwidth code points are treated as two
columns. Other code points are treated as one column.
sourceraw docstring

strip-ansiclj

(strip-ansi value)

Removes ANSI escape sequences from value and returns a string.

This covers common CSI color/style sequences, OSC sequences such as terminal hyperlinks, and single-byte ESC sequences. It does not interpret Unicode grapheme width; use a Unicode-aware width function when wide glyphs are present.

Removes ANSI escape sequences from value and returns a string.

This covers common CSI color/style sequences, OSC sequences such as terminal
hyperlinks, and single-byte ESC sequences. It does not interpret Unicode
grapheme width; use a Unicode-aware width function when wide glyphs are
present.
sourceraw docstring

terminal-widthclj

(terminal-width value)

Returns Unicode display width after removing ANSI escape sequences.

Use as :display-width width/terminal-width when terminal output may contain both ANSI styling and wide Unicode glyphs.

Returns Unicode display width after removing ANSI escape sequences.

Use as `:display-width width/terminal-width` when terminal output may contain
both ANSI styling and wide Unicode glyphs.
sourceraw docstring

unicode-widthclj

(unicode-width value)

Returns a terminal-style display width for Unicode text.

This is a code-point based helper for common monospace terminal output. It handles combining marks and East Asian wide/fullwidth characters, but does not attempt full grapheme-cluster shaping for emoji ZWJ sequences.

Returns a terminal-style display width for Unicode text.

This is a code-point based helper for common monospace terminal output. It
handles combining marks and East Asian wide/fullwidth characters, but does not
attempt full grapheme-cluster shaping for emoji ZWJ sequences.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close