perl: indicate features distinct from experimental
[sheet.git] / perl.plp
index 0a13fdc95115081778fb6b5f12f68ba5371499e0..ff3054e679b8575e87d8ecaebaf1fc560cceae89 100644 (file)
--- a/perl.plp
+++ b/perl.plp
@@ -29,24 +29,30 @@ for my $vernum (reverse sort keys %{$info}) {
        print '<div class="section">'."\n";
        printf '<h2>%vd <small>%s</small></h2><dl>'."\n", $vernum, $verrow->{release};
        for (@{ $verrow->{new} }) {
-               if (defined (my $experimental = $_->[2])) {
-                       my $title = 'experimental';
-                       my $class = ' class="ex"';
-                       if (ref \$experimental eq 'VSTRING') {
-                               my $dropped = $experimental =~ s/^\0//
-                                       and (exists $get{v} or next);
-                               $title = sprintf('%s %vd',
-                                       $dropped ? 'removed in ' : "$title until",
-                                       $experimental,
-                               );
-                               $experimental = $_->[3];  # optional additional class
+               my ($topic, $desc, $attr) = @{$_};
+               if ($attr) {
+                       my $title;
+                       if (defined $attr->{experimental}) {
+                               $title = 'experimental';
                        }
-                       if ($experimental) {
-                               $class .= sprintf ' title="%s"', $experimental;
+                       if ($attr->{dropped}) {
+                               next unless exists $get{v};
+                               $title = sprintf 'removed in %vd', $attr->{dropped};
                        }
-                       $_->[1] .= qq{ <em$class>($title)</em>};
+                       elsif ($attr->{stable}) {
+                               $title .= sprintf ' until %vd', $attr->{stable};
+                       }
+                       if ($attr->{experimental}) {
+                               $title = sprintf '<span title="experimental::%s">%s</span>',
+                                       $attr->{experimental}, $title;
+                       }
+                       if ($attr->{feature}) {
+                               $title = sprintf('<span title="%s">feature</span>', $attr->{feature})
+                                       . (defined $title && ", $title");
+                       }
+                       $desc .= sprintf ' <em class="ex">(%s)</em>', $title;
                }
-               printf '<dt>%s<dd>%s'."\n", @{$_}, '<br/>'
+               printf '<dt>%s<dd>%s'."\n", $topic, $desc || '<br/>';
        }
        printf '<dt>Unicode</dt><dd>v%s'."\n", $_ for $verrow->{unicode} || ();
        print "</dl>\n";