rehype-custom-emoji-plugin/README.md

31 lines
783 B
Markdown
Raw Normal View History

2025-03-29 23:04:15 +01:00
# custom emoji plugin for rehype
yeah i'm not writing an actual readme for this yet lmao
## usage
```js
import { unified } from "unified";
import remarkParse from "remark-parse";
import rehypeStringify from "rehype-stringify";
import remarkRehype from "remark-rehype";
import rehypeCustomEmoji from "rehype-custom-emoji-plugin";
import jsonfileData from "./emojis.json" with { type: "json" };
const processor = unified()
.use(remarkParse)
.use(remarkRehype)
.use(rehypeCustomEmoji, {
emojis: jsonfileData.emojis,
sourceFile: jsonfileData.source,
hidpiSourceFile: jsonfileData.hidpiSource,
size: jsonfileData.size,
})
.use(rehypeStringify);
const file = await processor.process(":neofox:");
```
generate a spritesheet file with `generate/generate.js`