my @termlist = qw( cga xterm tango app html xkcd );
push @termlist, qw( c64 msx2 mac2 risc arnegame ) if exists $get{v};
for my $term (@termlist) {
- my ($name, @index) = @{ $palettes->{$term} };
- my $caption = $name // $term;
+ my ($info, @index) = @{ $palettes->{$term} };
+ my $caption = $info->{name} // $term;
+ $caption = sprintf('<%s %s>%s</%1$s>',
+ $info->{href} ? 'a' : 'span',
+ join(' ',
+ map { sprintf '%s="%s"', $_, $info->{$_} }
+ grep { defined $info->{$_} }
+ qw( href title )
+ ),
+ $caption,
+ ) if $info->{href} or $info->{title};
print '<table>', "\n";
printf "<caption>%s</caption>\n", $caption;