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.
sourceraw docstring

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.
sourceraw docstring

chunk->hiccupclj/s

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

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.
sourceraw docstring

color-24-bitclj/s

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

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.
sourceraw docstring

color-schemesclj/s

Color schemes used in popular applications.

Color schemes used in popular applications.
sourceraw 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. 
sourceraw docstring

csi-patternclj/s

Regex to match a Control Sequence Introducer

Regex to match a Control Sequence Introducer
sourceraw docstring

ESCclj/s

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

In ClojureScript: returns a single character String.

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

In ClojureScript: returns a single character String.
sourceraw docstring

get-colorclj/s

(get-color n)
source

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.
sourceraw 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'.
sourceraw docstring

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.
sourceraw docstring

parse-intclj/s

(parse-int s)
source

rgb->cssclj/s

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

str-lengthclj/s

(str-length s)

Fast string length

Fast string length
sourceraw 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.
sourceraw 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.
sourceraw 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.
sourceraw docstring

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

× close