Terminal Markup Language based on BBCode
Project description
terml
Terminal Markup Language based on BBCode.
Inspired by Go:tml and Python:rich.
Installation:
pip install terml
poetry add terml
Examples
from terml import format
print(format("[b][color=#f70000 background=yellow] WARNING [/color]:[/b] [magenta]Life leads to [i blue underline]Death[/i].[/magenta]"))
Tags
Tag | Description |
---|---|
b |
Bold text |
i |
Italic text |
u |
Underline text |
[color=<color>] , <color name> |
Set foreground color |
Non-existent tags do not cause errors.
Common attributes
Attribute | Description |
---|---|
bold , italic , underline |
Apply the same style |
<color name> , color=<color> |
Set foreground color |
background=<color> |
Set background color |
Unknown attributes are ignored.
Colors
Color name: black
, red
, green
, yellow
, blue
, magenta
, cyan
, white
. Also supported HEX-codes like #deadbeef
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
terml-0.1.0.tar.gz
(5.8 kB
view hashes)
Built Distribution
terml-0.1.0-py3-none-any.whl
(7.4 kB
view hashes)