blyxyas / mdbook-emojicodes

MDBook preprocessor for converting emojicodes (e.g. `: cat :`) into emojis 🐱
https://crates.io/crates/mdbook-emojicodes
MIT License
11 stars 2 forks source link

Feature Request: custom emoji #4

Closed savbran closed 1 year ago

savbran commented 1 year ago

Hi, I'm wondering if it's possible to use custom emojis for example contained in a folder at the same level of the md file to convert.

For example, if the containing folder's name is: custom_icons and you have in it some svg emojis like urgent.svg, in the markdown document could be used the emoji shortcode :custom_icons_urgent: (i.e. the shortcode could be composed by the folder name and the image name).

Do you think it's a good idea?

blyxyas commented 1 year ago

I could see it being implemented. Im currently a little bit busy, so it will take some days / weeks. If you want to implement it yourself, I'll gladly accept it.

savbran commented 1 year ago

@blyxyas thanks for your answer. I'm not a Rust expert but I'm learning it. Considering this is an interesting feature, take you time no problem. Meanwhile I'll try to clone your repository and give a look, trying to understand how the "crate content" works :) ... regards.

blyxyas commented 1 year ago

Ok I implemented it:

Now you can have a my_svg.svg in the directory src/custom_emojis and use it like any other emoji.

image

# Chapter 1

:my_svg:

image

blyxyas commented 1 year ago

@savbran let me know if this is what you meant, the size obviously depends on the size of your vector graphic

savbran commented 1 year ago

@blyxyas did you push the update on the master branch? I ask because I can't see any recent change. Anyway, the size should be the one of emojis, like on this text row with the emojis: 🐞 😃 If you push the update I can try... many thanks!

blyxyas commented 1 year ago

@savbran This feature has been successfully implemented and available in version 0.2.1. Let me know if you need anything.