This crate provides a markup language to quickly write colorful and styled terminal text(of [tui] crate) in plain text.
This is the output of cargo run --example help
:
The source markup text of this article can be found in [examples/help.txt].
Only one syntax <tag content>
to add style to content.
tag
is a style
list sep by ,
.
style
has format of mode:value
, available mode
are:
fg:
for foreground color.bg:
for background color.mod:
for modifiers.Mode prefix is optional except bg:
, so fg:66ccf
= 66ccff
, and mod:b
= b
.
Some examples:
<green text>
for a green color text, <66ccff text>
for a #66ccff color text.<bg:blue text>
for a blue background text, <bg:66ccff text>
for a #66ccff background text.<b text>
for a bold text, <i text>
for a italic/slant text.<bg:blue one<green two>>
, is a blue background one followed by a blue background and green foreground two.<bg:blue,green,b,i text>
is a blue background, green foreground, bold, italic text.The forma syntax spec can be found in crate document, with complete list of available color and modifiers.
BSD-3-Clause-Clear, See [LICENSE].