- use List::Util 'min';
-
-:><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
-<html lang="en">
-
-<head>
-<meta http-equiv="content-type" content="utf-8">
-<title>terminal colour cheat sheet</title>
-<:= stylesheet(qw'light dark') :>
-<link rel="icon" type="image/png" href="/clip.png">
-</head>
+Html({
+ title => 'terminal colour cheat sheet',
+ version => '1.0',
+ description => [
+ "Index of all terminal/console colour codes,",
+ "with an example result of various environments.",
+ ],
+ keywords => [qw'
+ color code terminal console escape table xterm rxvt
+ '],
+ data => ['termcol.inc.pl'],
+ stylesheet => [qw'light dark'],
+});
+
+my @draw = map { [$_, s/\W+\z//] } grep { $_ } split m(/),
+ $get{img} // exists $get{img} && 'indi.png';
+
+my @termlist;
+push @termlist, split /\W+/, $ENV{PATH_INFO} || 'default';
+
+my %termgroup = (
+ default => [qw( ansi xkcd ansi88 )],
+ more => [qw( ansi mirc legacy ansi256 )],
+ msx => [qw( msx1 msx2 arnejmp )],
+ ansi => [qw( cga xterm tango app html )],
+ legacy => [qw( c64 msx2 mac2 risc arnegame cpc )],
+);
+@{$_} = map { $termgroup{$_} ? @{ $termgroup{$_} } : $_ } @{$_}
+ for values %termgroup, \@termlist;