Skip to content

Commit

Permalink
processor: support :emoji: format in project reamde & summary
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdulrhmnGhanem committed Oct 3, 2022
1 parent b3a30f2 commit f75fd64
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
1 change: 1 addition & 0 deletions processor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"rehype-shift-heading": "^1.0.2",
"rehype-slug": "^5.0.1",
"rehype-stringify": "^9.0.3",
"remark-emoji": "^3.0.2",
"remark-gfm": "^3.0.1",
"remark-parse": "^10.0.1",
"remark-rehype": "^10.1.0",
Expand Down
5 changes: 4 additions & 1 deletion processor/src/tasks/processReadme/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import path from 'node:path'

import { unified } from 'unified'
import globule from 'globule'
import path from 'node:path'
import rehypeAutolinkHeadings from 'rehype-autolink-headings'
import rehypeHighlight from 'rehype-highlight'
import rehypeRaw from 'rehype-raw'
import rehypeSanitize from 'rehype-sanitize'
import rehypeShiftHeading from 'rehype-shift-heading'
import rehypeSlug from 'rehype-slug'
import rehypeStringify from 'rehype-stringify'
import remarkEmoji from 'remark-emoji'
import remarkGfm from 'remark-gfm'
import remarkParse from 'remark-parse'
import remarkRehype from 'remark-rehype'
Expand Down Expand Up @@ -92,6 +94,7 @@ async function renderMarkdown(rawMarkdown: string, ownerName: string, repoName:
readmeFolder: string, originalUrl: string, defaultBranch: string) {
const Remarker = unified()
.use(remarkParse)
.use(remarkEmoji)
.use(remarkGfm)
.use(remarkRehype, { allowDangerousHtml: true })
.use(rehypeRaw)
Expand Down
2 changes: 2 additions & 0 deletions processor/src/tasks/writeKitspaceYaml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { unified } from 'unified'
import rehypeHighlight from 'rehype-highlight'
import rehypeSanitize from 'rehype-sanitize'
import rehypeStringify from 'rehype-stringify'
import remarkEmoji from 'remark-emoji'
import remarkGfm from 'remark-gfm'
import remarkParse from 'remark-parse'
import remarkRehype from 'remark-rehype'
Expand Down Expand Up @@ -43,6 +44,7 @@ async function renderProjectSummary(kitspaceYaml) {
const summary = kitspaceYaml.summary || ''
const Remarker = unified()
.use(remarkParse)
.use(remarkEmoji)
.use(remarkGfm)
.use(remarkRehype)
.use(rehypeHighlight)
Expand Down
23 changes: 22 additions & 1 deletion processor/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,11 @@ emoji-regex@^8.0.0:
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37"
integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==

emoticon@^4.0.0:
version "4.0.1"
resolved "https://registry.yarnpkg.com/emoticon/-/emoticon-4.0.1.tgz#2d2bbbf231ce3a5909e185bbb64a9da703a1e749"
integrity sha512-dqx7eA9YaqyvYtUhJwT4rC1HIp82j5ybS1/vQ42ur+jBe17dJMwZE4+gvL1XadSFfxaPFFGt3Xsw+Y8akThDlw==

encodeurl@~1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59"
Expand Down Expand Up @@ -2998,6 +3003,13 @@ node-cleanup@^2.1.2:
resolved "https://registry.yarnpkg.com/node-cleanup/-/node-cleanup-2.1.2.tgz#7ac19abd297e09a7f72a71545d951b517e4dde2c"
integrity sha1-esGavSl+Caf3KnFUXZUbUX5N3iw=

node-emoji@^1.11.0:
version "1.11.0"
resolved "https://registry.yarnpkg.com/node-emoji/-/node-emoji-1.11.0.tgz#69a0150e6946e2f115e9d7ea4df7971e2628301c"
integrity sha512-wo2DpQkQp7Sjm2A0cq+sN7EHKO6Sl0ctXeBdFZrL9T9+UywORbufTcTZxom8YqpLQt/FqNMUkOpkZrJVYSKD3A==
dependencies:
lodash "^4.17.21"

[email protected]:
version "2.6.7"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad"
Expand Down Expand Up @@ -3493,6 +3505,15 @@ rehype-stringify@^9.0.3:
hast-util-to-html "^8.0.0"
unified "^10.0.0"

remark-emoji@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/remark-emoji/-/remark-emoji-3.0.2.tgz#786e88af1ecae682d74d7e1219989f34708205da"
integrity sha512-hEgxEv2sBtvhT3tNG/tQeeFY3EbslftaOoG14dDZndLo25fWJ6Fbg4ukFbIotOWWrfXyASjXjyHT+6n366k3mg==
dependencies:
emoticon "^4.0.0"
node-emoji "^1.11.0"
unist-util-visit "^4.1.0"

remark-gfm@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/remark-gfm/-/remark-gfm-3.0.1.tgz#0b180f095e3036545e9dddac0e8df3fa5cfee54f"
Expand Down Expand Up @@ -4093,7 +4114,7 @@ unist-util-visit@^3.0.0:
unist-util-is "^5.0.0"
unist-util-visit-parents "^4.0.0"

unist-util-visit@^4.0.0, unist-util-visit@^4.1.1:
unist-util-visit@^4.0.0, unist-util-visit@^4.1.0, unist-util-visit@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-4.1.1.tgz#1c4842d70bd3df6cc545276f5164f933390a9aad"
integrity sha512-n9KN3WV9k4h1DxYR1LoajgN93wpEi/7ZplVe02IoB4gH5ctI1AaF2670BLHQYbwj+pY83gFtyeySFiyMHJklrg==
Expand Down

0 comments on commit f75fd64

Please sign in to comment.