blyxyas / mdbook-emojicodes

MDBook preprocessor for converting emojicodes (e.g. `: cat :`) into emojis šŸ±
https://crates.io/crates/mdbook-emojicodes
MIT License
12 stars 2 forks source link
emoji emoji-unicode emojis mdbook mdbook-preprocessor

mdbook-emojicodes


mdbook-emojicodes is a MDBook preprocessor to replace your emojicodes (e.g. :cat:) to emojis. No more copy-pasting!

šŸ“¦ Installation

Using crates.io

$   cargo install mdbook-emojicodes

Manual installation

Clone the repo

$   git clone https://github.com/blyxyas/mdbook-emojicodes

Build & Install the preprocessor

$   cd mdbook-emojicodes;
    cargo install --path .

ā“ Usage

Write this in your book.toml:

[preprocessor.emojicodes]

Now, āœØ It's ready to use! āœØ.

You can use emojis by writing an emojicode in your files.

Example

<!-- my_chapter.md -->

# My :cat: cat journey

I love cats :cat: and dogs :dog:, I have two, one's gray, like a raccoon :raccoon:, and the other one is black, like the night :night_with_stars:.

This will render to:

<!-- my_chapter.md -->

# My šŸ± cat journey

I love cats šŸ± and dogs šŸ¶, I have two, one's gray, like a raccoon šŸ¦ and the other one is black, like the night šŸŒƒ

Now, when you run mdbook build, all your emojis will be converted.

šŸŽ” Custom Emojis

You can use your own emojis as .svg files. Just create a directory called custom_emojis in src; there you can include your custom emojis, like this:

.
ā”œā”€ā”€ book.toml
ā””ā”€ā”€ src
    ā”œā”€ā”€ chapter_1.md
    ā”œā”€ā”€ custom_emojis
    ā”‚Ā Ā  ā””ā”€ā”€ myemoji.svg
    ā””ā”€ā”€ SUMMARY.md
# Chapter 1
:myemoji:

These emojis will be automatically sized to the correct size.


Stargazers

Stargazers repo roster for @blyxyas/mdbook-emojicodes

License

This software uses the MIT License. Check the file LICENSE for more details