satoshinm / modpack

0 stars 0 forks source link

Add categorized mod list table & spotlights to readme #80

Closed satoshinm closed 7 years ago

satoshinm commented 7 years ago

Derived from modlist.md but using HTML tables instead of Markdown tables, only mod name + link and version and description, and roughly categorizing into themed sections instead of strictly alphabetically.

Created by copying modlist.md table to spreadsheet, manipulating, then pasting back from CSV to HTML table:

pbpaste|perl -pe's/^/<tr><td>/g'|perl -pe's/\t/<\/td> <td>/g'|perl -pe'chomp;$_.="<\/td><\/tr>\n"'|pbcopy

then links restored with quick and dirty script:

#!/usr/bin/perl
use strict;
use warnings;
use File::Slurp qw/slurp/;
my @matches = (slurp("modlist.md") =~ m/\[([^]]+)\]\(([^)]+)\)/g);
my %modlinks;

my $r = slurp("README.md");
for (my $i = 0; $i < @matches; $i += 2) {
    my $name = $matches[$i];
    my $link = $matches[$i + 1];
    #$modlinks{$name}=$link;

    $r =~ s(<td>\Q$name\E</td>)(<td><a href="$link">$name</a></td>)g;
}
#use Data::Dumper;
#print Dumper \%modlinks;

print $r;