Render Markup to Terminal
Project description
terminal-markup
Render Markup to Terminal.
Inspired by tml.
Pros:
- Faster than alterntavies like
rich
. - Supports background color and hex-colors.
- Null-dependency.
Install:
pip install terminal-markup
poetry add terminal-markup
After install you can use comand terminal-markup
.
Examples
from terminal_markup import render
print(render("[b][color=#f70000 background=yellow] WARNING [/color]:[/b] [purple]Life leads to [i blue underline]Death[/i].[/purple]"))
Tags
Tag | Description |
---|---|
b , bold |
Bold text |
i , em |
Italic text |
u |
Underline text |
[color=<color>] , <color name> |
Set foreground color |
Non-existent tags do not cause errors.
Common attributes
Attribute | Description |
---|---|
<color name> , color=<color> |
Set foreground color |
background=<color> |
Set background color |
{bold|italic|underline}[={no|off|false|0|...}] |
Set text style |
Unknown attributes are ignored.
Colors
Color names: black, maroon, green, olive, navy, purple, teal, silver, grey, red, lime, yellow, blue, fuchsia, aqua, white (first 16 colors from here). Also supported HEX-codes like #deadbeef
.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
terminal_markup-0.2.4.tar.gz
(7.1 kB
view hashes)
Built Distribution
Close
Hashes for terminal_markup-0.2.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7ac62fa5f9aa89adcbe9da195e36be2476e92beb81b256f65c75946c633c934 |
|
MD5 | 0efd04ce40e56dbcd1803c194e718810 |
|
BLAKE2b-256 | 0c5d24dc11bfb648b754253d20056725ac4588279b1d06bf0c45e5afd1491c27 |