say '<dl>';
for (@{ $verrow->{new} }) {
my ($topic, $desc, $attr) = @{$_};
- if ($attr) {
- my $title;
- if (defined $attr->{experimental}) {
- $title = 'experimental';
- }
- if ($attr->{dropped}) {
- next unless exists $get{v};
- $title = sprintf 'removed in %vd', $attr->{dropped};
- }
- elsif ($attr->{stable}) {
- $title .= sprintf ' until %vd', $attr->{stable};
- }
- if ($attr->{experimental}) {
- $title = sprintf '<span title="experimental::%s">%s</span>',
- $attr->{experimental}, $title;
- $attr->{name} //= $attr->{experimental};
- }
- if ($attr->{feature}) {
- my $prefix = sprintf '<span title="%s">feature</span>',
- $attr->{feature};
- $title = join ', ', $prefix, $title // ();
- $attr->{name} //= $attr->{feature};
- }
- $desc .= sprintf ' <em class="ex">(%s)</em>', $title if $title;
- }
+ $desc .= featattrs($attr);
my $ref = defined $attr->{name} && sprintf ' id="%s"', $attr->{name};
say sprintf '<dt%s>%s<dd>%s', $ref, $topic, $desc || '<br/>';
}
say "</div>\n";
}
+sub featattrs ($attr) {
+ my $title;
+ if (defined $attr->{experimental}) {
+ $title = 'experimental';
+ }
+ if ($attr->{dropped}) {
+ next unless exists $get{v};
+ $title = sprintf 'removed in %vd', $attr->{dropped};
+ }
+ elsif ($attr->{stable}) {
+ $title .= sprintf ' until %vd', $attr->{stable};
+ }
+ if ($attr->{experimental}) {
+ $title = sprintf '<span title="experimental::%s">%s</span>',
+ $attr->{experimental}, $title;
+ $attr->{name} //= $attr->{experimental};
+ }
+ if ($attr->{feature}) {
+ my $prefix = sprintf '<span title="%s">feature</span>',
+ $attr->{feature};
+ $title = join ', ', $prefix, $title // ();
+ $attr->{name} //= $attr->{feature};
+ }
+ return sprintf ' <em class="ex">(%s)</em>', $title if $title;
+ return '';
+}