webex-markdown
v0.2.1
Published
Webex Teams markdown helper
Downloads
1
Readme
Markdown helper for Webex Teams
If you are writing messages as a human, markdown is great. But if you create messages programatically as a bot, it can be frustrating and error prone to write newlines and string concatenations all over the place.
Goal:
- Never write \n again.
- Don't need to remember markdown syntax
- Avoid string concatenation
- Make working with lists easier
- Programmatic approach instead of string manipulations
Example use case:
const { convert, bold, list, url, mention } = require('webex-markdown');
const hi = `Hi, welcome to ${bold('Markdown')}`;
const hi2 = 'I can do the following:';
const features = list(['Lists', 'Bold', 'Links', 'Code', 'Mention', 'And more']);
const link = `See ${url('npmjs.org', 'our npm page')} for more info`;
const author = mention(`Made by ${mention('[email protected]', 'Tore')}`);
const markdown = convert([hi, hi2, features, link, author]);