https://github.com/fxfactorial/ocaml-emoji
Emojis in OCaml, use them in your CLIs or whatever
https://github.com/fxfactorial/ocaml-emoji
cli cute emoji ocaml
Last synced: 9 months ago
JSON representation
Emojis in OCaml, use them in your CLIs or whatever
- Host: GitHub
- URL: https://github.com/fxfactorial/ocaml-emoji
- Owner: fxfactorial
- Created: 2017-01-22T00:12:29.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-05-24T00:24:58.000Z (about 2 years ago)
- Last Synced: 2025-01-14T01:31:52.841Z (over 1 year ago)
- Topics: cli, cute, emoji, ocaml
- Language: OCaml
- Homepage: hyegar.com/ocaml-emoji
- Size: 945 KB
- Stars: 27
- Watchers: 4
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Emoji
OCaml library providing byte sequences of all the Unicode (v17.0) emoji
characters and sequences
```
$ opam install emoji
```
You can see them by printing to the screen:
```ocaml
# Emoji.distorted_face;;
- : string = ""
# Emoji.hairy_creature;;
- : string = ""
# Emoji.orca;;
- : string = ""
```
You can also get all emojis from the same category or subcategory:
```ocaml
# let best_animals = Emoji.sub_category_animal_reptile;;
val best_animals : string array =
[|"🐊"; "🐉"; "🐲"; "🦎"; "🦕"; "🐍"; "🦖"; "🐢"|]
```
Using `ocp-browser` shows the emoji

# Development
To generate `emoji.ml`, first update the source html files:
```
$ wget "https://www.unicode.org/emoji/charts/full-emoji-list.html"
$ wget "https://www.unicode.org/emoji/charts/full-emoji-modifiers.html"
```
then run:
```
$ dune exec gencode/gencode.exe > src/emoji.ml
```
test with `dune runtest`, you can then `dune promote` to apply [mdx](https://github.com/realworldocaml/mdx) changes to keep this file up to date.