-<:
-use utf8;
-use strict;
-use warnings;
-use open IO => ':utf8';
-
-use Unicode::UCD qw(charinfo);
-
-our $VERSION = '1.0';
-
-$header{content_type} = 'text/html; charset=utf-8';
-
-:><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-
-<head>
-<title>digraph cheat sheet</title>
-<meta http-equiv="content-type" content="utf-8">
-<style>
-h1 {
- text-align: center;
- margin: 0 auto 0.2em;
-}
-table {
- border-collapse: collapse;
- table-layout: fixed; /* prevent resizing, notably in msie6 */
-}
-#legend {
- margin-top: 1em;
-}
-#legend table {
- width: 100%;
- table-layout: auto;
-#}
-#legend td {
- padding: 0 0.2em;
+<(common.inc.plp)><:
+
+my $mode = $Request || 'vim';
+my $include = 'digraphs' . ($mode ne 'vim' && "-$mode");
+my $cmp = exists $get{cmp} ? ($get{cmp} // 1) : !!$Request;
+
+my $di = eval { Data($include) } || {};
+warn "error in $include: ", @{$@} if ref $@;
+
+Html({
+ title => "$mode digraph cheat sheet",
+ version => '1.4',
+ description => $di->{description} // [
+ "Complete table of digraph characters from",
+ ($di->{title} // $mode) . ".",
+ ],
+ keywords => [@{ $di->{keywords} // [] }, qw'
+ digraph mnemonic compose composition pair
+ character char glyph table unicode vim
+ '],
+ stylesheet => [qw'light'],
+ data => ["data/$include.json"],
+});
+
+%{$di} or Abort(
+ "Requested digraphs <q>$mode</q> not available",
+ '404 request not found',
+);
+
+say "<h1>$di->{title} Digraphs</h1>";
+say "<p>$_</p>" for $di->{intro} // ();
+
+if (exists $get{v}) {
+ # show characters for inverted mnemonics (vim alternatives)
+ $di->{key}->{ substr($_, 1, 1) . substr($_, 0, 1) } ||= [
+ $di->{key}->{$_}->[0], '', 'l0 ex', '', $di->{key}->{$_}->[4]
+ ] for grep { ref $di->{key}->{$_} } keys %{ $di->{key} };