Skip to content

Markup

The terminal is a unique interface. It is purely text-based yet capable of displaying colors and formatting, using ANSI escape codes. These codes are difficult to remember and use, so pls uses a custom approach.

Markup

The markup language used by pls is similar to XML. The directives are written inside < and > and wrapped around the text to style. The closing tag always matches the last opened tag, regardless of the text inside it, so it's customary to leave it blank.

You can use a single directive, or a combination of directives, separated by spaces.

<bold>bold text</> <bold italic>bold italic text</>
bold text bold italic text

Tags can be nested inside each other and will be joined in order.

<bold><italic>bold italic text</> only bold text</>

bold italic text only bold text

To overwrite all outer tags and start a fresh context, use clear.

<bold><clear blue><clear>plain text</> only blue text</> only bold text</>
plain text only blue text only bold text

Directives

Styles

Terminals can style text in many ways. pls allows you to use any permutation of these styles in your configs.

  • blink
  • bold
  • dimmed
  • hidden
  • italic
  • reversed
  • strikethrough
  • underline

You can use a single style directive.

<bold>bold text</>
bold text

You can use any combination of style directives.

<bold italic underline strikethrough>BIUS text</>
BIUS text

Colors

Color support in terminals can range from 16 named colors to 16 million RGB colors! pls allows you to use all the colors supported by your terminal.

Named

Named colors consist of 8 regular colors and 8 bright colors (one for each of the regular ones).

  • black
  • red
  • green
  • yellow
  • blue
  • magenta
  • cyan
  • white

To use the named colors in pls you can use the color name directly as a directive in the tag.

<blue>blue text</>
blue text

To use the bright variant, you can prefix bright_ before the color name.

<bright_red>orange text</> <bright_magenta>violet text</>
orange text violet text

To use a color as the background, you can prefix bg: before the color name.

<bg:blue><black>black text</> <white>white text</></>
black text white text

True colors

pls also supports using RGB colors. These colors can be specified using a triplet of three u8 numbers, each between 0 and 255, both inclusive.

<rgb(0,255,0)>pure green text</>
pure green text

To use a color as the background, you can prefix bg: before the color name.

<bg:rgb(255,0,0)><black>black text</> <white>white text</></>
black text white text