slackline/mrkdwn
Build text in Slack’s mrkdwn format, as described in
https://docs.slack.dev/messaging/formatting-message-text.
mrkdwn.user("U123") <> " shipped " <> mrkdwn.link("https://example.com", "the thing")
// "<@U123> shipped <https://example.com|the thing>"
Values
pub const channel_mention: String
<!channel>: notifies every member of a channel.
pub fn date(
timestamp timestamp: Int,
format format: String,
link link: option.Option(String),
fallback fallback: String,
) -> String
Formats a unix timestamp in each reader’s own timezone:
<!date^timestamp^format^link|fallback>. format may use the tokens
{date_num}, {date}, {date_short}, {date_long}, {date_pretty},
{date_short_pretty}, {date_long_pretty}, {time}, {time_secs} and
{ago}.
pub fn email(address: String, text: String) -> String
An email link: <mailto:address|text>.
pub fn emoji(name: String) -> String
An emoji by name, without colons: emoji("tada") is :tada:.
pub fn escape(text: String) -> String
Escapes the three control characters (&, <, >) so user supplied
text cannot inject mentions or links.
pub const everyone: String
<!everyone>: notifies every non-guest member of the workspace.
pub fn unescape(text: String) -> String
Reverses escape, for text read back from Slack.