https://github.com/blueglassblock/mdit-py-emoji
Emoji plugin for markdown-it-py. Ported from https://github.com/markdown-it/markdown-it-emoji
https://github.com/blueglassblock/mdit-py-emoji
Last synced: about 1 year ago
JSON representation
Emoji plugin for markdown-it-py. Ported from https://github.com/markdown-it/markdown-it-emoji
- Host: GitHub
- URL: https://github.com/blueglassblock/mdit-py-emoji
- Owner: BlueGlassBlock
- License: mit
- Created: 2022-09-26T06:09:56.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-06-05T10:19:47.000Z (about 3 years ago)
- Last Synced: 2025-04-26T01:59:52.342Z (about 1 year ago)
- Language: Python
- Size: 64.5 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mdit-py-emoji
> Emoji plugin for markdown-it-py. Ported from https://github.com/markdown-it/markdown-it-emoji
[](https://pypi.org/project/mdit-py-emoji)
[](https://pypi.org/project/mdit-py-emoji)
[](https://github.com/psf/black)
[](https://pycqa.github.io/isort/)
[](https://github.com/BlueGlassBlock/mdit-py-emoji/blob/master/LICENSE)
[](https://pdm.fming.dev)
[](https://codecov.io/github/BlueGlassBlock/mdit-py-emoji)
## Installation
Choose your favorite!
```sh
pip install mdit-py-emoji
pdm add mdit-py-emoji
poetry add mdit-py-emoji
```
## Usage
Use it just like other plugins!
```python
from markdown_it import MarkdownIt
from mdit_py_emoji import emoji_plugin
md = MarkdownIt().use(emoji_plugin)
print(md.renderInline(":star: mdit-py-emoji! :star:"))
# ⭐ mdit-py-emoji! ⭐
print(md.renderInline("Is shortcut supported too :/? :white_check_mark:"))
# Is shortcut supported too 😕? ✅
```
## Customization
Pass `defs` and `shortcuts` and that's it!
```python
from markdown_it import MarkdownIt
from mdit_py_emoji import emoji_plugin
md = MarkdownIt().use(
emoji_plugin,
shortcuts={
"arrow_up": [":up_arrow:", ":up_arr:"],
"arrow_down": [":down_arrow:", ":down_arr:"],
},
) # Some tricks like `false = False`
print(md.renderInline(":down_arr: Go Down :down_arrow:"))
# ⬇️ Go Down ⬇️
```
Wondering about the defaults? Check [data.py](./mdit_py_emoji/data.py) !
Note: twemoji shortcuts are enabled by default. pass `shortcuts={}` to disable it.
## License
This project is licensed under [MIT License](./LICENSE).