No description
dist | ||
generate | ||
src | ||
.gitignore | ||
package.json | ||
pnpm-lock.yaml | ||
README.md | ||
tsconfig.json |
custom emoji plugin for rehype
yeah i'm not writing an actual readme for this yet lmao
usage
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