11 releases (7 breaking)
new 0.8.1 | Dec 4, 2024 |
---|---|
0.8.0 | Oct 24, 2024 |
0.7.0 | Aug 21, 2024 |
0.6.0 | Jul 30, 2024 |
0.5.0 | Mar 12, 2024 |
#277 in Text processing
112 downloads per month
51KB
784 lines
About
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:
- Headings: Setext headings
- Unordered lists:
*
- Ordered lists: numbered,
.
- Rules:
---
- Tables
Notes
-
This crate does not do syntax highlighting or terminal colors. For that, please check out
bat
andsyntect
. -
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 usespulldown-cmark
instead.
Command line
$ 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.1
$ 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'
๐๐ฌ๐ฒ๐ฏ ๐ฑ๐ข๐ต๐ฑ ๐ฅ๐ข๐ฏ๐ข
Library
See the API documentation.
Dependencies
~5โ14MB
~194K SLoC