Docute plugin for transforming emoji aliases within Markdown.
Get the UMD build and load it before you initialize Docute inside your index.html
file:
<script src="https://unpkg.com/docute-emojify"></script>
Then, configure the plugin.
docute.init({
plugins: [
docuteEmojify(),
],
});
This plugin requires Docute v3.
Emoji aliases will be replaced with their respective Unicode characters within your Markdown documents. For instance,
This is **Markdown** with :100: emoji support :ok_hand:
will render as
This is Markdown with 💯 emoji support 👌
All emoji aliases are scraped from the gemoji repository.
You can add additional aliases for existing emoji by providing an aliases
object when you configure the plugin.
docuteEmojify({
aliases: {
100: 'hundo',
thinking: [
'thunking',
'thonk',
],
},
});
This will replace :hundo:
with 💯 and :thunking:
or :thonk:
with 🤔.
Aliases may be blacklisted by providing an array of aliases as the blacklist
option.
docuteEmojify({
blacklist: [
'100',
'+1',
],
});
This will make :100:
and :+1:
render as typed rather than as an emoji character.
By default, aliases found in code formatting (i.e. surrounded by matching backticks) are not transformed. This behaviour can be toggled using the emojifyCode
option.
docuteEmojify({
emojifyCode: true,
});
We will now see
See emoji code below `:+1:`
```
:100:
```
render as
See emoji code below
👍
💯