const em = text => `_${text}_`; const strong = text => `*${text}*`; const strike = text => `~${text}~`; const br = '\n'; const p = text => `\n${text}\n`; const blockquote = text => `> ${text}`; const code = text => `\`${text}\``; const pre = text => `\`\`\`${text}\`\`\``; const a = ({href}, text) => `<${href}${text ? `|${text}` : ''}>`; const hr = {type: 'divider'}; const blocks = (...items) => {return {blocks: items};}; const header = (text) => { return { type: 'header', text: plain_text(text), }; } const section = (text, {plain = false} = {}) => { return { type: 'section', text: plain ? plain_text(text) : mrkdwn(text), }; }; const context = (...elements) => { return { type: 'context', elements, }; }; const mrkdwn = (text, {verbatim = true} = {}) => { return { type: 'mrkdwn', text, verbatim, }; }; const plain_text = (text, {emoji = true} = {}) => { return { type: 'plain_text', text, emoji, }; }; const image = (url, alt_text) => { return { type: 'image', url, ...(alt_text ? {alt_text} : {}), }; };