Liking cljdoc? Tell your friends :D

sugar.browser-dev-console

Converts ANSI SGR-styled strings to browser dev console format: a string with a %c format specifier in place of each SGR sequence, followed by one CSS string per %c. Used by sugar.core/print-styled in browsers.

Converts ANSI SGR-styled strings to browser dev console format: a string with
a %c format specifier in place of each SGR sequence, followed by one CSS
string per %c. Used by sugar.core/print-styled in browsers.
raw docstring

adjusted-char-countclj/s

(adjusted-char-count s)

Given a string containing ANSI SGR tags, returns the character count of the string minus the char count of all the ANSI SGR tags.

Given a string containing ANSI SGR tags, returns the character count of the
string minus the char count of all the ANSI SGR tags.
raw docstring

ansi-sgr-string->browser-dev-console-arrayclj/s

(ansi-sgr-string->browser-dev-console-array s)

Intended to convert an ANSI SGR-tagged string to a format specifier-tagged string, with a corresponding vector of css style strings. The resulting string and styles can be supplied to a browser development console to format messages. See https://developer.chrome.com/docs/devtools/console/format-style for more background.

Replaces all ANSI SGR tags in supplied string with CSS format specifier tag, "%c", after escaping every % in the text as %%. Analyzes all ANSI SGR tags, and produces a vector of corresponding css style strings. Returns a vector of the format-specifier-tagged strings, followed by the contents of the styles array. In ClojureScript, returns an array.

Example usage in ClojureScript:

(def console-array
  (->> :foo
       bling.hifi/hifi
       ansi-sgr-string->browser-dev-console-array))
;; =>
;; ["%c:foo%c",
;;  "color: rgb(122, 62, 157)",
;;  "line-height: 1.4; color: default"]

;; Print the value, with formatting, to dev console:
(.apply js/console.log js/console console-array)
Intended to convert an ANSI SGR-tagged string to a format specifier-tagged
string, with a corresponding vector of css style strings. The resulting string
and styles can be supplied to a browser development console to format
messages. See https://developer.chrome.com/docs/devtools/console/format-style
for more background.

Replaces all ANSI SGR tags in supplied string with CSS format specifier tag,
"%c", after escaping every % in the text as %%. Analyzes all ANSI SGR
tags, and produces a vector of corresponding css style strings. Returns a vector of the format-specifier-tagged strings,
followed by the contents of the styles array. In ClojureScript, returns an
 array.
 
Example usage in ClojureScript:

```Clojure
(def console-array
  (->> :foo
       bling.hifi/hifi
       ansi-sgr-string->browser-dev-console-array))
;; =>
;; ["%c:foo%c",
;;  "color: rgb(122, 62, 157)",
;;  "line-height: 1.4; color: default"]

;; Print the value, with formatting, to dev console:
(.apply js/console.log js/console console-array)
```
raw docstring

escclj/s


sgr-bgc-reclj/s


sgr-color-baseclj/s


sgr-countclj/s

(sgr-count s)

Given a string containing ANSI SGR tags, returns the character count of the ANSI SGR tags. 0 when there are none, or s is nil.

Given a string containing ANSI SGR tags, returns the character count of the
ANSI SGR tags. 0 when there are none, or s is nil.
raw docstring

sgr-fgc-reclj/s


sgr-font-styleclj/s


sgr-font-weightclj/s


sgr-freeformclj/s


sgr-reclj/s


sgr-resetclj/s


sgr-style-by-idclj/s


sgr-text-decorationclj/s


sgr-text-decoration-baseclj/s


sgr-unstyled-spaces-reclj/s


sgr-x256-or-rgb-foreground-color-reclj/s

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