NAME
Term;;ANSIEncode
SYNOPSIS
A markup language to generate basic ANSI text. A terminal that supports UTF-8 is required if you wish to have special characters, both graphical and international.
USAGE
my $ansi = Term::ANSIEncode->new;
my $string = '[% CLS %]Some markup encoded string';
$ansi->ansi_output($string);
TOKENS
GENERAL
- [% RETURN %]
-
ASCII RETURN (13)
- [% LINEFEED %]
-
ASCII LINEFEED (10)
- [% NEWLINE %]
-
RETURN + LINEFEED (13 + 10)
- [% CLS %]
-
Places cursor at top left, screen cleared
- [% CLEAR %]
-
Clear screen only, cursor remains where it was
- [% CLEAR LINE %]
-
Clear to the end of line
- [% CLEAR DOWN %]
-
Clear down from current cursor position
- [% CLEAR UP %]
-
Clear up from current cursor position
- [% RESET %]
-
Reset all colors and attributes
CURSOR
- [% HOME %]
-
Moves the cursor to the location 1,1.
- [% UP %]
-
Moves cursor up one step
- [% DOWN %]
-
Moves cursor down one step
- [% RIGHT %]
-
Moves cursor right one step
- [% LEFT %]
-
Moves cursor left one step
- [% SAVE %]
-
Save cursor position
- [% RESTORE %]
-
Place cursor at saved position
- [% BOLD %]
-
Bold text (not all terminals support this)
- [% FAINT %]
-
Faded text (not all terminals support this)
- [% ITALIC %]
-
Italicized text (not all terminals support this)
- [% UNDERLINE %]
-
Underlined text
- [% SLOW BLINK %]
-
Slow cursor blink
- [% RAPID BLINK %]
-
Rapid cursor blink
- [% LOCATE column,row %]
-
Set cursor position
ATTRIBUTES
- [% INVERT %]
-
Invert text (flip background and foreground attributes)
- [% REVERSE %]
-
Reverse
- [% CROSSED OUT %]
-
Crossed out
- {% DEFAULT FONT %]
-
Default font
FRAMES
- [% BOX color,x,y,width,height,type %] text here [% ENDBOX %]
-
Draw a frame around text
Types = THIN, ROUND, THICK, BLOCK, WEDGE, DOTS, DIAMOND, STAR, SQUARE
COLORS
FOREGROUND
There are many more foreground colors available than the sixteen below. However, the ones below should work on any color terminal. Other colors may require 256 and 16 million color support. Most Linux X-Windows and Wayland terminal software should support the extra colors. Some Windows terminal software should have 'Term256' and 'truecolor' features. You can used the '-t' option (in the executable "ansi-encode" file) for all of the color tokens available or use the 'RGB' token for access to 16 million colors.
- BLACK = Black
- RED = Red
- GREEN = Green
- YELLOW = Yellow
- BLUE = Blue
- MAGENTA = Magenta
- CYAN = Cyan
- WHITE = White
- DEFAULT = Default foreground color
- BRIGHT BLACK = Bright black (dim grey)
- BRIGHT RED = Bright red
- BRIGHT GREEN = Lime
- BRIGHT YELLOW = Bright Yellow
- BRIGHT BLUE = Bright blue
- BRIGHT MAGENTA = Bright magenta
- BRIGHT CYAN = Bright cyan
- BRIGHT WHITE = Bright white
BACKGROUND
There are many more background colors available than the sixteen below. However, the ones below should work on any color terminal. Other colors may requite 256 and 16 million color support. Most Linux X-Windows and Wayland terminal software should support the extra colors. Some Windows terminal software should have 'Term256' features. You can used the '-t' option for all of the color tokens available or use the 'B_RGB' token for access to 16 million colors.
- B_BLACK = Black
- B_RED = Red
- B_GREEN = Green
- B_YELLOW = Yellow
- B_BLUE = Blue
- B_MAGENTA = Magenta
- B_CYAN = Cyan
- B_WHITE = White
- B_DEFAULT = Default background color
- BRIGHT B_BLACK = Bright black (grey)
- BRIGHT B_RED = Bright red
- BRIGHT B_GREEN = Lime
- BRIGHT B_YELLOW = Bright yellow
- BRIGHT B_BLUE = Bright blue
- BRIGHT B_MAGENTA = Bright magenta
- BRIGHT B_CYAN = Bright cyan
- BRIGHT B_WHITE = Bright white
HORIZONAL RULES
Makes a solid blank line, the full width of the screen with the selected color
For example, for a color of blue, use the following
[% HORIZONTAL RULE BLUE %]
FRAMES
Makes a "dialog box" at the selected location and type
For example: [% BOX BLUE,10,10,40,4,DOUBLE %]Text that will be wrapped inside the box[% ENDBOX %]
AUTHOR & COPYRIGHT
Richard Kelsch
Copyright (C) 2025 Richard Kelsch
All Rights Reserved
Perl Artistic License
This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at;
http://www.perlfoundation.org/artistic_license_2_0
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 1543:
You forgot a '=back' before '=head1'