@clearfeed-ai/slack-to-html 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.babelrc ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "presets": ["es2015", "babili"]
3
+ }
package/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ 6.5.0
package/README.md ADDED
@@ -0,0 +1,64 @@
1
+ # Slack to HTML
2
+
3
+ Forked originally from https://github.com/swiftype/slack-hawk-down
4
+
5
+ Slack markdown to HTML
6
+
7
+ ## Installation
8
+ ```
9
+ npm install --save slack-to-html
10
+ ```
11
+
12
+ ## Usage
13
+
14
+ ### Render universal Slack markdown as HTML
15
+ ```
16
+ import { escapeForSlack, escapeForSlackWithMarkdown } from 'slack-hawk-down'
17
+
18
+ escapeForSlack(':wave:') // => 'Ґ'
19
+ escapeForSlackWithMarkdown('`this is a code block`) // => '<span class="slack_code">this is a code block</span>'
20
+ ```
21
+
22
+ You can view the rest of the markdown styles [here](https://get.slack.help/hc/en-us/articles/202288908-Format-your-messages)
23
+
24
+ ### Replace Slack user IDs with user names
25
+
26
+ ```
27
+ escapeForSlack('<@U123|david> did you see my pull request?', { users: { 'U123': 'david', ... } }) // => '@david did you see my pull request?'
28
+ ```
29
+ You can get a list of the users in your Slack team by requesting [this endpoint](https://api.slack.com/methods/users.list) with a `users:read` scope
30
+
31
+ ### Replace Slack channel IDs with channel names
32
+
33
+ ```
34
+ escapeForSlack('<#C123> please fill out this poll', { channels : { '#C123': 'general', ... } }) // => '#general please fill out this poll'
35
+ ```
36
+ You can get a list of the users in your Slack team by requesting [this endpoint](https://api.slack.com/methods/channels.list) with a `channels:read` scope
37
+
38
+ ### Replace Custom Slack emojis
39
+
40
+ ```
41
+ escapeForSlack(':facepalm:', { customEmoji: { facepalm: 'http://emojis.slackmojis.com/emojis/images/1450319441/51/facepalm.png', ... } }) // => '<img alt="facepalm" src="http://emojis.slackmojis.com/emojis/images/1450319441/51/facepalm.png" />'
42
+ ```
43
+ You can get a list of custom emoji for your Slack team by requesting [this endpoint](https://api.slack.com/methods/emoji.list) with a `emoji:read` scope
44
+
45
+ ### Replace subteam names (for paid accounts)
46
+ ```
47
+ escapeForSlack('<!subteam^S123>', { usergroups: { 'S123': 'swiftype-eng', ...} }) // => 'swiftype-eng'
48
+ ```
49
+ You can get a list of user groups for your Slack team by requesting [this endpoint](https://api.slack.com/methods/usergroups.list) with a `usergroups:read` scope
50
+
51
+ ## Testing
52
+
53
+ ```
54
+ npm test
55
+ ```
56
+
57
+ ## Upcoming
58
+ - Customizeable element and class names for markdown elements
59
+
60
+ ## Contribution
61
+ Please open a pull request or issue
62
+
63
+ ## License
64
+ MIT