Skip to content

Commit

Permalink
feat: emoji (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
Flower-F authored Oct 17, 2022
1 parent b5edd92 commit d3b5acd
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/en/api/config-extension.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ The remark plugins that will be used to parse markdown files. There are followin
- [remark-gfm](https://www.npmjs.com/package/remark-gfm): Parse common markdown syntaxes `GFM` (GitHub Flavored Markdown).
- [remark-frontmatter](https://www.npmjs.com/package/remark-frontmatter): Parse front matter info in markdown files.
- [remark-mdx-frontmatter](https://www.npmjs.com/package/remark-mdx-frontmatter): Parse front matter info in mdx files.
- [remark-gemoji](https://www.npmjs.com/package/remark-gemoji): Turn gemoji shortcodes `(:+1:)` into emoji (:+1:).

You can also use this option to add some extra remark plugins. For example:

Expand Down
14 changes: 14 additions & 0 deletions docs/en/guide/use-mdx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,20 @@ This is a dangerous warning.
`tip` as a custom container of the bottom-line type.
:::

## Emoji

**Input:**

````bash
:tada: :100: :laughing:
````

**Output:**

:tada: :100: :laughing:

The complete emoji list cound be found in the [Emoji Cheat Sheet](https://www.webfx.com/tools/emoji-cheat-sheet/).

## Code Line Highlighting

Island.js supports highlighting of specified code lines. You can specify line highlighting in any of the following ways.
Expand Down
1 change: 1 addition & 0 deletions docs/zh/api/config-extension.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ remark 和 rehype 插件的选项。
- [remark-gfm](https://www.npmjs.com/package/remark-gfm): 解析常用 markdown 语法 `GFM` (GitHub Flavored Markdown)。
- [remark-frontmatter](https://www.npmjs.com/package/remark-frontmatter): 解析 Markdown 文件中的 Front Matter 信息。
- [remark-mdx-frontmatter](https://www.npmjs.com/package/remark-mdx-frontmatter): 解析 MDX 文件中的 Front Matter 信息。
- [remark-gemoji](https://www.npmjs.com/package/remark-gemoji): 将 gemoji 缩写 `(:+1:)` 转换为 emoji (:+1:)。

你还可以使用此选项添加一些额外的 remark 插件。例如:

Expand Down
14 changes: 14 additions & 0 deletions docs/zh/guide/use-mdx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,20 @@ title: Hello World
`tip` 作为兜底类型的 `block`
:::

## Emoji

**输入:**

````bash
:tada: :100: :laughing:
````

**输出:**

:tada: :100: :laughing:

完整的表情列表可以在 [Emoji Cheat Sheet](https://www.webfx.com/tools/emoji-cheat-sheet/) 中查看。

## 指定代码行高亮

Island.js 支持指定代码行的高亮显示。你可以用以下任意方式指定代码行高亮。
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
"rehype-slug": "^5.0.1",
"remark-directive": "^2.0.1",
"remark-frontmatter": "^4.0.1",
"remark-gemoji": "^7.0.1",
"remark-gfm": "^3.0.1",
"remark-mdx-frontmatter": "^2.0.3",
"sass": "^1.54.5",
Expand Down
15 changes: 15 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/node/plugin-mdx/pluginMdxRollup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import remarkPluginGFM from 'remark-gfm';
import remarkPluginFrontMatter from 'remark-frontmatter';
import remarkDirective from 'remark-directive';
import remarkPluginMDXFrontMatter from 'remark-mdx-frontmatter';
import remarkGemoji from 'remark-gemoji';
import { remarkPluginNormalizeLink } from './remarkPlugins/link';
import rehypePluginAutolinkHeadings from 'rehype-autolink-headings';
import rehypePluginSlug from 'rehype-slug';
Expand All @@ -29,6 +30,7 @@ export async function pluginMdxRollup(
// The following two plugin for frontmatter
remarkPluginFrontMatter,
[remarkPluginMDXFrontMatter, { name: 'frontmatter' }],
remarkGemoji,
remarkPluginToc,
remarkDirective,
remarkPluginTip,
Expand Down

1 comment on commit d3b5acd

@vercel
Copy link

@vercel vercel bot commented on d3b5acd Oct 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.