Liking cljdoc? Tell your friends :D

lambdaisland.ansi


*color-scheme*clj/s

Color scheme currently in use during parsing.

Color scheme currently in use during parsing.
raw docstring

=iclj/s


apply-propsclj/s

(apply-props rf)

Stateful transducer, apply it over the output of token-stream to know which styling should be applied over each piece of text.

The results are pairs consisting of a property map and a string.

Stateful transducer, apply it over the output of token-stream to know which
styling should be applied over each piece of text.

The results are pairs consisting of a property map and a string.
raw docstring

chunk->hiccupclj/s

(chunk->hiccup [{:keys [foreground background bold] :as props} text])

code->attrsclj/s

(code->attrs code)

Given a CSI code, return a map of properties it sets. A value of nil means the property gets unset.

Given a CSI code, return a map of properties it sets. A value of `nil` means
the property gets unset.
raw docstring

color-24-bitclj/s

(color-24-bit [r g b])

color-8-bitclj/s

(color-8-bit code)

Parse a "8-bit" color, given the code that follows on ESC[38;5;<code>m.

Parse a "8-bit" color, given the code that follows on ESC[38;5;<code>m.
raw docstring

color-schemesclj/s

Color schemes used in popular applications.

Color schemes used in popular applications.
raw docstring

csi->attrsclj/s

(csi->attrs csi)

Given a CSI specifier, excluding ESC[ but including the final "m", convert it to a map of properties that it sets or unsets. Property values of nil indicate a reset/unset.

Given a CSI specifier, excluding ESC[ but including the final "m", convert it
to a map of properties that it sets or unsets. Property values of nil indicate
a reset/unset. 
raw docstring

ESCclj/s

ASCII escape character (codepoint 27, hex 1b, octal 33).

ASCII escape character (codepoint 27, hex 1b, octal 33).
raw docstring

get-colorclj/s

(get-color n)

has-escape-char?clj/s

(has-escape-char? s)

Efficient check to see if a string contains an escape character.

Efficient check to see if a string contains an escape character.
raw docstring

hiccup-xformclj/s

Transducer that consumes strings of input, and produces hiccup elements. Useful when dealing with streaming input, since it will carry over the 'terminal state'.

Transducer that consumes strings of input, and produces hiccup elements. Useful
when dealing with streaming input, since it will carry over the 'terminal
state'.
raw docstring

next-csiclj/s

(next-csi s)
(next-csi s start)

parse-colorclj/s

(parse-color fg-or-bg [colorspace & more])

Handle CSI code 38 and 48, used to specify 8 or 24 bit colors. This may consume up to 5 codes in total (ESC [38;2;r;g;bm). Returns the map of properties that get set, and the remaining, unconsumed codes.

Handle CSI code 38 and 48, used to specify 8 or 24 bit colors. This may consume
up to 5 codes in total (ESC [38;2;r;g;bm). Returns the map of properties that
get set, and the remaining, unconsumed codes.
raw docstring

parse-intclj/s

(parse-int s)

rgb->cssclj/s

(rgb->css [_ r g b])

str-lengthclj/s

(str-length s)

Fast string length

Fast string length
raw docstring

str-scanclj/s

(str-scan pos s min max)

Starting at position pos, move forward as long as the characters at the current position are within the given range. Returns the new position.

Starting at position pos, move forward as long as the characters at the current
position are within the given range. Returns the new position.
raw docstring

str-splitclj/s

(str-split s sep)

Like clojure.string/split, but uses a single character instead of a regex, allowing for faster operation.

Like clojure.string/split, but uses a single character instead of a regex,
allowing for faster operation.
raw docstring

text->hiccupclj/s

(text->hiccup text)

Convenience function for the basic case where you have a string of terminal output and want to turn it into hiccup. Returns a seq of [:span] elements.

Convenience function for the basic case where you have a string of terminal
output and want to turn it into hiccup. Returns a seq of [:span] elements.
raw docstring

token-streamclj/s

(token-stream string)

Tokenize a string, whereby each CSI sequence gets transformed into a map of properties. The result is a vector of strings and maps.

Tokenize a string, whereby each CSI sequence gets transformed into a map of
properties. The result is a vector of strings and maps.
raw docstring

with-color-schemeclj/smacro

(with-color-scheme name & body)

Execute code with the given color scheme active, name must be one of :vga :cmd :osx :putty :mirc :xterm :ubuntu. For finer control bind to color-scheme directly.

Execute code with the given color scheme active, name must be one
of :vga :cmd :osx :putty :mirc :xterm :ubuntu. For finer control bind to
*color-scheme* directly.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close