{"id":26878202,"url":"https://github.com/rubenarakelyan/rehype-custom-emoji","last_synced_at":"2025-03-31T12:19:57.465Z","repository":{"id":246820143,"uuid":"823666702","full_name":"rubenarakelyan/rehype-custom-emoji","owner":"rubenarakelyan","description":"Rehype plugin to support custom emoji","archived":false,"fork":false,"pushed_at":"2024-07-03T13:47:54.000Z","size":43,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T19:19:17.912Z","etag":null,"topics":["javsscript","rehype","rehype-plugin"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rubenarakelyan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-03T13:23:44.000Z","updated_at":"2025-03-04T21:48:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"a719263b-4cb6-4caa-95dc-b7e3155a57c5","html_url":"https://github.com/rubenarakelyan/rehype-custom-emoji","commit_stats":null,"previous_names":["rubenarakelyan/rehype-custom-emoji"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubenarakelyan%2Frehype-custom-emoji","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubenarakelyan%2Frehype-custom-emoji/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubenarakelyan%2Frehype-custom-emoji/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rubenarakelyan%2Frehype-custom-emoji/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rubenarakelyan","download_url":"https://codeload.github.com/rubenarakelyan/rehype-custom-emoji/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246465249,"owners_count":20781919,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javsscript","rehype","rehype-plugin"],"created_at":"2025-03-31T12:19:56.849Z","updated_at":"2025-03-31T12:19:57.449Z","avatar_url":"https://github.com/rubenarakelyan.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @rubenarakelyan/rehype-custom-emoji\n\n[![CI][ci-badge]][ci]\n[![npm][npm-badge]][npm]\n\n[@rubenarakelyan/rehype-custom-emoji][npm] is a [rehype](https://github.com/rehypejs/rehype) plugin to replace `:emoji:`\nwith custom-defined images.\n\nHeavily inspired by [remark-emoji](https://github.com/rhysd/remark-emoji).\n\n## Usage\n\n```\nrehype().use(emoji, options);\n```\n\n```javascript\nimport { rehype } from \"rehype\";\nimport customEmoji from \"@rubenarakelyan/rehype-custom-emoji\";\n\nconst doc = \"Emojis in this text will be replaced: :dog:\";\nconst processor = rehype().use(customEmoji, {\n  emoji: {\n    dog: \"/images/dog.png\"\n  }\n});\nconst file = await processor.process(doc);\n\nconsole.log(String(file));\n// =\u003e Emojis in this text will be replaced: \u003cimg src=\"/images/dog.png\" alt=\"dog emoji\" class=\"custom-emoji\" aria-hidden\u003e\n```\n\nRemember to import the `global.css` stylesheet to apply some basic styling to your custom emoji. This mostly ensures that\nthe emoji are the same size as the surrounding text so they act like real emoji.\n\nIf you are using the TailwindCSS `typography` extension's `prose` styling, you will need some extra CSS to remove the top\nand bottom margins it applies to all images.\n\n## Options\n\n### `options.emoji`\n\nAn object where the keys are the emoji shortcodes, and values are paths to the custom emoji images. For example,\n\n```javascript\n{\n  dog: \"/images/dog.png\"\n}\n```\n\nwill register the shortcode `:dog:`, which will be replaced with an HTML `\u003cimg\u003e` tag pointing to `/images/dog.png`.\n\n## Licence\n\n[MIT licence](LICENSE).\n\n[ci-badge]: https://github.com/rubenarakelyan/rehype-custom-emoji/actions/workflows/ci.yml/badge.svg\n[ci]: https://github.com/rubenarakelyan/rehype-custom-emoji/actions/workflows/ci.yml\n[npm-badge]: https://badge.fury.io/js/rubenarakelyan%2Frehype-custom-emoji.svg\n[npm]: https://www.npmjs.com/package/@rubenarakelyan/rehype-custom-emoji\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubenarakelyan%2Frehype-custom-emoji","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frubenarakelyan%2Frehype-custom-emoji","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubenarakelyan%2Frehype-custom-emoji/lists"}