Cowrie.Transforms (cowrie v0.3.2)

Defines functions that transform (a.k.a. mutate) text. These functions do not print the text and they do not apply ANSI formatting.

Link to this section Summary

Functions

Prepends a Danger emoji to the given text.

Prepends an Info emoji to the given text.

Prepends a Success emoji to the given text.

Prepends a Warning emoji to the given text.

Appends a newline to the text.

Draws a box around the given text. The text must be less than one line and it should not contain newlines.

Centers the given text using the configured column width (:cols)

Creates a horizontal line

Formats a list item for an ordered list by applying the :n character.

Prepends a newline to the text.

Formats a list item for an unordered list by applying the :li_bullet character.

Link to this section Functions

Link to this function

alert_danger(text, opts)

Prepends a Danger emoji to the given text.

Link to this function

alert_info(text, opts)

Prepends an Info emoji to the given text.

Link to this function

alert_success(text, opts)

Prepends a Success emoji to the given text.

Link to this function

alert_warning(text, opts)

Prepends a Warning emoji to the given text.

Link to this function

append_newline(text, opts)

Appends a newline to the text.

Link to this function

box(text, opts \\ [])

Draws a box around the given text. The text must be less than one line and it should not contain newlines.

Available configuration:

:box_chars - a map with keys containing for the top(t), top-right(tr), right (right), bottom-right (br), bottom (b), bottom-left (bl), left (l), and top-left (tl) characters to be used when drawing the box.

Default:

  %{
    t: "═",
    tr: "╗",
    r: "║",
    br: "╝",
    b: "═",
    bl: "╚",
    l: "║",
    tl: "╔"
  }

:box_padding - integer representing the number of columns of empty space between the box's left and right borders and the text, default: 1

Link to this function

capitalize(text, opts \\ [])

A wrapper for String.capitalize/2

Link to this function

center(text, opts \\ [])

Centers the given text using the configured column width (:cols)

Link to this function

downcase(text, opts)

A wrapper for String.downcase/2

Creates a horizontal line

Link to this function

ol_li(text, opts)

Formats a list item for an ordered list by applying the :n character.

Link to this function

prepend_newline(text, opts)

Prepends a newline to the text.

Link to this function

ul_li(text, opts)

Formats a list item for an unordered list by applying the :li_bullet character.

Link to this function

upcase(text, opts)

A wrapper for String.upcase/2