Skip to main content

Render Markup to Terminal

Project description

terminal-markup

PyPI - Python Version PyPI - Version Total Downloads

Render Markup to Terminal.

Inspired by tml.

Pros:

  • Faster than alternatvies like rich.
  • Supports background colors and hex.
  • Null-dependency.

Install:

pip install terminal-markup
poetry add terminal-markup

After install you can use command terminal-markup.

Examples

from terminal_markup import render

# let's render bricks
print(render("[b][color=#f70000 background=yellow] WARNING [/color]:[/b] [purple]Life leads to [i blue underline]Death[/i].[/purple]"))

image

Tags

Tag Description
b, bold Bold text
i, em Italic text
u Underline text
blink --
dim Dimmed color
rev Reversed foreground and background colors
[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|dim|reversed|blink}[={no|off|false|0|...}] Set 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 #87CEEB.

Tags Escaping

\[ - escaped [.

Case Insensetive

Tag names, attributes and color names are case insensetive.

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.8.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

terminal_markup-0.2.8-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file terminal_markup-0.2.8.tar.gz.

File metadata

  • Download URL: terminal_markup-0.2.8.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.6 Linux/6.6.8-arch1-1

File hashes

Hashes for terminal_markup-0.2.8.tar.gz
Algorithm Hash digest
SHA256 631a7ece3485299c5cfd33c6145fb8ded58f45ef697b13638109c254d902e83e
MD5 d5ac2c08e597130af0bbc01ccd3bbe03
BLAKE2b-256 2dcb4e0aa6999ff10e1b09d65b2662f89266804a7ef3a58919caeea5407398e3

See more details on using hashes here.

File details

Details for the file terminal_markup-0.2.8-py3-none-any.whl.

File metadata

  • Download URL: terminal_markup-0.2.8-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.6 Linux/6.6.8-arch1-1

File hashes

Hashes for terminal_markup-0.2.8-py3-none-any.whl
Algorithm Hash digest
SHA256 a365f5ef96e0d3a3e1bcfc05726d3d2619ab48d694dac4c8e13fc9b09ca5eeac
MD5 6f8f9b9275beac7a7e4ecdb5c148fe6e
BLAKE2b-256 9734e7a54d9d222e4d94819781d53085aa44047b358ede4252bb2e702b2b8b44

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page