Skip to content
This repository has been archived by the owner on Nov 16, 2020. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
implement links for feature names
  • Loading branch information
moritz committed Jul 26, 2011
1 parent c2212b0 commit dc890f2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
4 changes: 2 additions & 2 deletions features.txt
Expand Up @@ -68,8 +68,8 @@ Ranges: rm+ rn+ n+
Sets, KeySet, KeyBag, ...: rn- n-
Buf: rm+ rn- n-
Native operators: rm- rn- n-
Compact arrays: rm- rn- n-
Shaped arrays/hashes: rm- rn- n-
Compact arrays http://perlcabal.org/syn/S09.html#Compact_arrays: rm- rn- n-
Shaped arrays/hashes http://perlcabal.org/syn/S09.html#Fixed-size_arrays: rm- rn- n-

= Multi dispatch
Multi method dispatch: rm+ rn+ n+
Expand Down
14 changes: 9 additions & 5 deletions process.pl
Expand Up @@ -17,7 +17,7 @@
my %abbr_name;
my %abbr_link;
my %abbr_index;
my $index = 0;
my $index = 1;
my $in_abbr_section;
my @sections;

Expand All @@ -42,8 +42,11 @@
$abbr_index{$abbr} = ++$index;
}
else {
my ($name, $rest) = split /:\s*/, $_, 2;
push @{$sections[-1]}, [$name];
my ($section, $rest) = split qr{:(?!//)\s*}, $_, 2;
my ($name, $url) = split /\s+(?=http)/, $section, 2;
# use Data::Dumper;
# print Dumper [$name, $url, $rest];
push @{$sections[-1]}, [$name, $url];
while ($rest =~ m/(\w+)([+-]+)\s*(?:\(([^()]+)\)\s*)?/g) {
my ($abbr, $rating, $comment) = ($1, $2, $3);
die "Unknown abbreviation '$abbr'"
Expand Down Expand Up @@ -100,7 +103,8 @@ sub write_html {
for (@sec) {
my %ht_row;
my @row = @$_;
$ht_row{feature} = shift @row;
$ht_row{feature} = $row[0];
$ht_row{link} = $row[1];
$ht_row{compilers} = [ map {
my $h = {
status => $row[$_][0] // '?',
Expand All @@ -111,7 +115,7 @@ sub write_html {
$h->{ftext} = $f;
}
$h;
} 0..($index - 1) ];
} 2..$index ];
push @rows, \%ht_row;
}
}
Expand Down
4 changes: 3 additions & 1 deletion template.html
Expand Up @@ -77,7 +77,9 @@ <h2>Features</h2>
<%if section%>
<th class="subsection"><%var section%></th>
<%else%>
<td><%var feature%></td>
<td><%if link%><a href="<%var link%>"><%var feature%></a>
<%else%><%var feature%>
<%/if%></td>
<%loop compilers%>
<td><div class="<%var class%>"><%var status%><%if footnote%><sup class="footnote_link">&nbsp;<a href="#footnote_<%var footnote%>" title="<%var ftext%>"><%var footnote%></a></sup><%/if%></div></td>
<%/loop%>
Expand Down

0 comments on commit dc890f2

Please sign in to comment.