WardrikSlack.Blocks (wardrik_slack v0.1.0-rc.1)

Copy Markdown

Builds the Block Kit blocks of Wardrik's Slack messages.

Summary

Functions

Returns an actions block of elements, such as buttons.

Returns a button that sends value under action_id. style is "primary", "danger" or nil.

Returns text cut to max characters. Cut text ends in ….

Returns a line of small mrkdwn text.

Returns a reply to a button press that only the person who pressed sees.

Returns a markdown block, clipped to Slack's limit. Models write this kind of Markdown.

Returns a plain_text object, as buttons and options take.

Returns a section of mrkdwn text.

Functions

actions(block_id, elements)

@spec actions(String.t(), [map()]) :: map()

Returns an actions block of elements, such as buttons.

button(label, action_id, value, style \\ nil)

@spec button(String.t(), String.t(), String.t(), String.t() | nil) :: map()

Returns a button that sends value under action_id. style is "primary", "danger" or nil.

clip(text, max)

@spec clip(String.t(), pos_integer()) :: String.t()

Returns text cut to max characters. Cut text ends in ….

context(text)

@spec context(String.t()) :: map()

Returns a line of small mrkdwn text.

ephemeral(text)

@spec ephemeral(String.t()) :: map()

Returns a reply to a button press that only the person who pressed sees.

markdown(text)

@spec markdown(String.t()) :: map()

Returns a markdown block, clipped to Slack's limit. Models write this kind of Markdown.

plain(text)

@spec plain(String.t()) :: map()

Returns a plain_text object, as buttons and options take.

section(text)

@spec section(String.t()) :: map()

Returns a section of mrkdwn text.