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

Commit dc890f2

Browse files
committed
implement links for feature names
1 parent c2212b0 commit dc890f2

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

features.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ Ranges: rm+ rn+ n+
6868
Sets, KeySet, KeyBag, ...: rn- n-
6969
Buf: rm+ rn- n-
7070
Native operators: rm- rn- n-
71-
Compact arrays: rm- rn- n-
72-
Shaped arrays/hashes: rm- rn- n-
71+
Compact arrays http://perlcabal.org/syn/S09.html#Compact_arrays: rm- rn- n-
72+
Shaped arrays/hashes http://perlcabal.org/syn/S09.html#Fixed-size_arrays: rm- rn- n-
7373

7474
= Multi dispatch
7575
Multi method dispatch: rm+ rn+ n+

process.pl

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
my %abbr_name;
1818
my %abbr_link;
1919
my %abbr_index;
20-
my $index = 0;
20+
my $index = 1;
2121
my $in_abbr_section;
2222
my @sections;
2323

@@ -42,8 +42,11 @@
4242
$abbr_index{$abbr} = ++$index;
4343
}
4444
else {
45-
my ($name, $rest) = split /:\s*/, $_, 2;
46-
push @{$sections[-1]}, [$name];
45+
my ($section, $rest) = split qr{:(?!//)\s*}, $_, 2;
46+
my ($name, $url) = split /\s+(?=http)/, $section, 2;
47+
# use Data::Dumper;
48+
# print Dumper [$name, $url, $rest];
49+
push @{$sections[-1]}, [$name, $url];
4750
while ($rest =~ m/(\w+)([+-]+)\s*(?:\(([^()]+)\)\s*)?/g) {
4851
my ($abbr, $rating, $comment) = ($1, $2, $3);
4952
die "Unknown abbreviation '$abbr'"
@@ -100,7 +103,8 @@ sub write_html {
100103
for (@sec) {
101104
my %ht_row;
102105
my @row = @$_;
103-
$ht_row{feature} = shift @row;
106+
$ht_row{feature} = $row[0];
107+
$ht_row{link} = $row[1];
104108
$ht_row{compilers} = [ map {
105109
my $h = {
106110
status => $row[$_][0] // '?',
@@ -111,7 +115,7 @@ sub write_html {
111115
$h->{ftext} = $f;
112116
}
113117
$h;
114-
} 0..($index - 1) ];
118+
} 2..$index ];
115119
push @rows, \%ht_row;
116120
}
117121
}

template.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ <h2>Features</h2>
7777
<%if section%>
7878
<th class="subsection"><%var section%></th>
7979
<%else%>
80-
<td><%var feature%></td>
80+
<td><%if link%><a href="<%var link%>"><%var feature%></a>
81+
<%else%><%var feature%>
82+
<%/if%></td>
8183
<%loop compilers%>
8284
<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>
8385
<%/loop%>

0 commit comments

Comments
 (0)