X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/45a41242594517a044099d34be1868be1ddabe6e..v1.13-84-g7d20f0f116:/perl.plp?ds=sidebyside diff --git a/perl.plp b/perl.plp index 02d0348..de4637d 100644 --- a/perl.plp +++ b/perl.plp @@ -85,36 +85,47 @@ for my $vernum (reverse sort keys %{$info}) { say '
'; 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 '%s', - $attr->{experimental}, $title; - $attr->{name} //= $attr->{experimental}; - } - if ($attr->{feature}) { - my $prefix = sprintf 'feature', - $attr->{feature}; - $title = join ', ', $prefix, $title // (); - $attr->{name} //= $attr->{feature}; - } - $desc .= sprintf ' (%s)', $title if $title; - } + $desc .= featattrs($attr); my $ref = defined $attr->{name} && sprintf ' id="%s"', $attr->{name}; say sprintf '%s
%s', $ref, $topic, $desc || '
'; } + if (my $mods = $verrow->{modules}) { + for (@{$mods}) { + my ($name, $desc, $eg) = @{$_}; + my $ref = lc $name =~ s/::/_/gr; + $desc .= sprintf ' {%s}', Entity($_) for $eg // (); + printf '
use %s', $ref, $name; + say '
', $desc; + } + } say sprintf '
Unicode
v%s', $_ for $verrow->{unicode} || (); say '
'; say "\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 '%s', + $attr->{experimental}, $title; + $attr->{name} //= $attr->{experimental}; + } + if ($attr->{feature}) { + my $prefix = sprintf 'feature', + $attr->{feature}; + $title = join ', ', $prefix, $title // (); + $attr->{name} //= $attr->{feature}; + } + return sprintf ' (%s)', $title if $title; + return ''; +}