Crates.io | unidown |
lib.rs | unidown |
version | 0.8.0 |
source | src |
created_at | 2024-03-09 18:29:22.587168 |
updated_at | 2024-10-24 20:21:52.851746 |
description | Convert Markdown to Unicode |
homepage | |
repository | https://github.com/qtfkwk/unidown |
max_upload_size | |
id | 1168055 |
size | 70,295 |
Convert Markdown to Unicode:
Input | Result |
---|---|
*Emphasis* |
๐๐ฎ๐ฑ๐ฉ๐ข๐ด๐ช๐ด |
**Strong** |
๐๐ญ๐ซ๐จ๐ง๐ |
`Code` |
๐ฒ๐๐๐ |
~~Strike~~ |
Sฬถtฬถrฬถiฬถkฬถeฬถ |
***Emphasis strong*** |
๐ฌ๐๐๐๐๐๐๐ ๐๐๐๐๐๐ |
***Emphasis* strong** |
๐ฌ๐๐๐๐๐๐๐ ๐ฌ๐ญ๐ซ๐จ๐ง๐ |
***Strong** emphasis* |
๐บ๐๐๐๐๐ ๐ฆ๐ฎ๐ฑ๐ฉ๐ข๐ด๐ช๐ด |
*`Emphasis code`* |
โฐ๐๐ ๐ฝ๐ถ๐๐พ๐ ๐ธโด๐นโฏ |
**`Strong code`** |
๐ข๐ฝ๐ป๐ธ๐ท๐ฐ ๐ฌ๐ธ๐ญ๐ฎ |
***`Emphasis strong code`*** |
โบโโโโโขโโข โขโฃโกโโโ โโโโ |
~~*Strike emphasis*~~ |
๐ฬถ๐ตฬถ๐ณฬถ๐ชฬถ๐ฌฬถ๐ฆฬถ ฬถ๐ฆฬถ๐ฎฬถ๐ฑฬถ๐ฉฬถ๐ขฬถ๐ดฬถ๐ชฬถ๐ดฬถ |
~~**Strike strong**~~ |
๐ฬถ๐ญฬถ๐ซฬถ๐ขฬถ๐คฬถ๐ฬถ ฬถ๐ฌฬถ๐ญฬถ๐ซฬถ๐จฬถ๐งฬถ๐ ฬถ |
~~***Strike emphasis strong***~~ |
๐บฬถ๐ฬถ๐ฬถ๐ฬถ๐ฬถ๐ฬถ ฬถ๐ฬถ๐ฬถ๐ฬถ๐ฬถ๐ฬถ๐ฬถ๐ฬถ๐ฬถ ฬถ๐ฬถ๐ฬถ๐ฬถ๐ฬถ๐ฬถ๐ฬถ |
~~`Strike code`~~ |
๐ฬถ๐ฬถ๐ฬถ๐ฬถ๐ฬถ๐ฬถ ฬถ๐ฬถ๐ฬถ๐ฬถ๐ฬถ |
~~*`Strike emphasis code`*~~ |
๐๐ฑ๐ฏ๐ฆ๐จ๐ข ๐ข๐ช๐ญ๐ฅ๐๐ฐ๐ฆ๐ฐ ๐ ๐ฌ๐ก๐ข |
~~**`Strike strong code`**~~ |
๐พ๐๐๐๐๐ ๐๐๐๐๐๐ ๐๐๐๐ |
~~***`Strike emphasis strong code`***~~ |
๐๐ฅ๐ฃ๐๐๐ ๐๐๐ก๐๐๐ค๐๐ค ๐ค๐ฅ๐ฃ๐ ๐๐ ๐๐ ๐๐ |
Uses pulldown-cmark
and a modified version of its push_html
to do real Markdown parsing and
rendering.
As a result, it normalizes:
*
.
---
This crate does not do syntax highlighting or terminal colors.
For that, please check out bat
and syntect
.
This crate outputs Unicode text using the Mathematical Alphanumeric Symbols and Enclosed Alphanumerics blocks, however your ability to see the effects depends on the specific applications (terminal, text editor, web browser, etc) you're using and their configurations (fonts, etc). For instance, it's very probable that regular and monospace look identical in a terminal or text editor, because the font is probably monospace. If a non-monospace font is configured or another application is used that uses a non-monospace font, or the output bytes are examined more closely, you will see the effect.
This crate can be considered an improved version of the markdown2unicode
crate but contains
no copyrighted nor GPLv3 licensed code from its original upstream source (USBashka's
markdown2unicode) and uses pulldown-cmark
instead.
$ unidown -h
Convert Markdown to Unicode
Usage: unidown [OPTIONS] [STRING]...
Arguments:
[STRING]... Markdown string(s)
Options:
-s <STYLE> Style [possible values: italic, bold, monospace, strike,
bold-italic, script, bold-script, circled, strike-italic,
strike-bold, strike-bold-italic, strike-monospace, fraktur,
bold-fraktur, double-struck, all, demo]
-i <PATH> Input file(s)
-r Print readme
-h, --help Print help
-V, --version Print version
$ unidown -V
unidown 0.8.0
$ unidown 'Here is some *emphasis*, **strong**, ***strong emphasis***, ~~strike~~, and `code` text.'
Here is some ๐ฆ๐ฎ๐ฑ๐ฉ๐ข๐ด๐ช๐ด, ๐ฌ๐ญ๐ซ๐จ๐ง๐ , ๐๐๐๐๐๐ ๐๐๐๐๐๐๐๐, sฬถtฬถrฬถiฬถkฬถeฬถ, and ๐๐๐๐ text.
$ unidown -s all 'Your text here'
๐ ๐ฐ๐ถ๐ณ ๐ต๐ฆ๐น๐ต ๐ฉ๐ฆ๐ณ๐ฆ
๐๐จ๐ฎ๐ซ ๐ญ๐๐ฑ๐ญ ๐ก๐๐ซ๐
๐๐๐๐ ๐๐๐ก๐ ๐๐๐๐
Yฬถoฬถuฬถrฬถ ฬถtฬถeฬถxฬถtฬถ ฬถhฬถeฬถrฬถeฬถ
๐๐๐๐ ๐๐๐๐ ๐๐๐๐
๐ดโด๐๐ ๐โฏ๐๐ ๐ฝโฏ๐โฏ
๐จ๐ธ๐พ๐ป ๐ฝ๐ฎ๐๐ฝ ๐ฑ๐ฎ๐ป๐ฎ
โโโคโก โฃโโงโฃ โโโกโ
๐ ฬถ๐ฐฬถ๐ถฬถ๐ณฬถ ฬถ๐ตฬถ๐ฆฬถ๐นฬถ๐ตฬถ ฬถ๐ฉฬถ๐ฆฬถ๐ณฬถ๐ฆฬถ
๐ฬถ๐จฬถ๐ฎฬถ๐ซฬถ ฬถ๐ญฬถ๐ฬถ๐ฑฬถ๐ญฬถ ฬถ๐กฬถ๐ฬถ๐ซฬถ๐ฬถ
๐ฬถ๐ฬถ๐ฬถ๐ฬถ ฬถ๐ฬถ๐ฬถ๐ฬถ๐ฬถ ฬถ๐ฬถ๐ฬถ๐ฬถ๐ฬถ
๐ฬถ๐ฬถ๐ฬถ๐ฬถ ฬถ๐ฬถ๐ฬถ๐กฬถ๐ฬถ ฬถ๐ฬถ๐ฬถ๐ฬถ๐ฬถ
๐๐ฌ๐ฒ๐ฏ ๐ฑ๐ข๐ต๐ฑ ๐ฅ๐ข๐ฏ๐ข
๐๐๐๐ ๐๐๐๐ ๐๐๐๐
๐๐ ๐ฆ๐ฃ ๐ฅ๐๐ฉ๐ฅ ๐๐๐ฃ๐
$ unidown -s demo 'Your text here'
| Input | Result | Style |
|----------------------------------|----------------|--------------------|
| `` *Your text here* `` | ๐ ๐ฐ๐ถ๐ณ ๐ต๐ฆ๐น๐ต ๐ฉ๐ฆ๐ณ๐ฆ | italic |
| `` **Your text here** `` | ๐๐จ๐ฎ๐ซ ๐ญ๐๐ฑ๐ญ ๐ก๐๐ซ๐ | bold |
| `` `Your text here` `` | ๐๐๐๐ ๐๐๐ก๐ ๐๐๐๐ | monospace |
| `` ~~Your text here~~ `` | Yฬถoฬถuฬถrฬถ ฬถtฬถeฬถxฬถtฬถ ฬถhฬถeฬถrฬถeฬถ | strike |
| `` ***Your text here*** `` | ๐๐๐๐ ๐๐๐๐ ๐๐๐๐ | bold-italic |
| `` *`Your text here`* `` | ๐ดโด๐๐ ๐โฏ๐๐ ๐ฝโฏ๐โฏ | script |
| `` **`Your text here`** `` | ๐จ๐ธ๐พ๐ป ๐ฝ๐ฎ๐๐ฝ ๐ฑ๐ฎ๐ป๐ฎ | bold-script |
| `` ***`Your text here`*** `` | โโโคโก โฃโโงโฃ โโโกโ | circled |
| `` ~~*Your text here*~~ `` | ๐ ฬถ๐ฐฬถ๐ถฬถ๐ณฬถ ฬถ๐ตฬถ๐ฆฬถ๐นฬถ๐ตฬถ ฬถ๐ฉฬถ๐ฆฬถ๐ณฬถ๐ฆฬถ | strike-italic |
| `` ~~**Your text here**~~ `` | ๐ฬถ๐จฬถ๐ฎฬถ๐ซฬถ ฬถ๐ญฬถ๐ฬถ๐ฑฬถ๐ญฬถ ฬถ๐กฬถ๐ฬถ๐ซฬถ๐ฬถ | strike-bold |
| `` ~~***Your text here***~~ `` | ๐ฬถ๐ฬถ๐ฬถ๐ฬถ ฬถ๐ฬถ๐ฬถ๐ฬถ๐ฬถ ฬถ๐ฬถ๐ฬถ๐ฬถ๐ฬถ | strike-bold-italic |
| `` ~~`Your text here`~~ `` | ๐ฬถ๐ฬถ๐ฬถ๐ฬถ ฬถ๐ฬถ๐ฬถ๐กฬถ๐ฬถ ฬถ๐ฬถ๐ฬถ๐ฬถ๐ฬถ | strike-monospace |
| `` ~~*`Your text here`*~~ `` | ๐๐ฌ๐ฒ๐ฏ ๐ฑ๐ข๐ต๐ฑ ๐ฅ๐ข๐ฏ๐ข | fraktur |
| `` ~~**`Your text here`**~~ `` | ๐๐๐๐ ๐๐๐๐ ๐๐๐๐ | bold-fraktur |
| `` ~~***`Your text here`***~~ `` | ๐๐ ๐ฆ๐ฃ ๐ฅ๐๐ฉ๐ฅ ๐๐๐ฃ๐ | double-struck |
$ unidown -s fraktur 'Your text here'
๐๐ฌ๐ฒ๐ฏ ๐ฑ๐ข๐ต๐ฑ ๐ฅ๐ข๐ฏ๐ข
See the API documentation.