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 compiler names. It is an ugly hack, but so is the…
… rest of this script :/
  • Loading branch information
moritz committed Jul 26, 2011
1 parent f2b12b0 commit 8d948eb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 3 additions & 3 deletions features.txt
@@ -1,7 +1,7 @@
= ABBREVIATIONS
rm Rakudo/master
rn Rakudo/nom
n Niecza
rm Rakudo/master http://rakudo.org/
rn Rakudo/nom http://pmthium.com/2011/02/08/new-nqp-repository-new-nom-rakudo-branch/
n Niecza https://github.com/sorear/niecza

= Basics
Basic control structures: rm+ rn+ n+
Expand Down
10 changes: 8 additions & 2 deletions process.pl
Expand Up @@ -10,6 +10,7 @@
open my $f, '<:encoding(UTF-8)', 'features.txt';
binmode(STDOUT, ":encoding(UTF-8)");
my %abbr_name;
my %abbr_link;
my %abbr_index;
my $index = 0;
my $in_abbr_section;
Expand All @@ -29,8 +30,10 @@
}
else {
if ($in_abbr_section) {
my ($abbr, $name) = split /\s+/, $_, 2;
my ($abbr, $rest) = split /\s+/, $_, 2;
my ($name, $url) = split /\s+(?=http)/, $rest, 2;
$abbr_name{$abbr} = $name;
$abbr_link{$abbr} = $url;
$abbr_index{$abbr} = ++$index;
}
else {
Expand Down Expand Up @@ -63,7 +66,10 @@ sub write_html {
);
my @compilers;
for (keys %abbr_index) {
$compilers[$abbr_index{$_}] = {name => $abbr_name{$_}};
$compilers[$abbr_index{$_}] = {
name => $abbr_name{$_},
link => $abbr_link{$_},
};
}
shift @compilers;
$t->param(compilers => \@compilers);
Expand Down
2 changes: 1 addition & 1 deletion template.html
Expand Up @@ -63,7 +63,7 @@ <h2>Features</h2>
<tr>
<th>Feature</th>
<%loop compilers%>
<th><%var name%></th>
<th><a href="<%var link%>"><%var name%></a></th>
<%/loop%>
</tr>
</thead>
Expand Down

0 comments on commit 8d948eb

Please sign in to comment.