From: Pavel Pisa Date: Sat, 18 May 2013 18:17:55 +0000 (+0200) Subject: Script to generate projects list/directory page updated for English pages version. X-Git-Url: https://rtime.felk.cvut.cz/gitweb/edu/osp-wiki.git/commitdiff_plain/3c39429ae2318ec4ece04c316929bfd56766a548 Script to generate projects list/directory page updated for English pages version. Signed-off-by: Pavel Pisa --- diff --git a/student/projects.pl b/student/projects.pl index bc4ff582..81c988b0 100755 --- a/student/projects.pl +++ b/student/projects.pl @@ -5,7 +5,7 @@ use Data::Dumper; my %projects; -foreach my $year (qw/2010 2011 2012/) { +foreach my $year (qw/2010 2011 2012 2013/) { open LIST, "projects$year"; while () { chomp; @@ -13,8 +13,14 @@ foreach my $year (qw/2010 2011 2012/) { my ($project, $url, $name); open PAGE, $file; while () { + if (/Project name and homepage[:* ]*\[([^\[\]]*)\]\(([^()]*)\)/) { + $project = $1; + $url = $2; + } if (/(Název projektu|Project name)[:* ]*(.*)/) { - $project = $2; + if (!$project) { + $project = $2; + } } if (/(Domovská stránka projektu|Project home ?page)[:* ]*<(.*)>/) { $url = $2; @@ -24,6 +30,10 @@ foreach my $year (qw/2010 2011 2012/) { } } + if (!$project or !$name or !$url) { + print STDERR "Expected field missing in $file\n"; + } + print STDERR "Working on student $name ($year)\n"; if (!$projects{$project}) { $projects{$project} = {}; @@ -37,6 +47,9 @@ foreach my $year (qw/2010 2011 2012/) { print '[[!meta title="Projekty"]]'."\n"; print '[[!meta stylesheet="/columns" rel="stylesheet"]]'."\n"; +print "\n"; +print 'This page lists the projects and which students worked on them in the'."\n"; +print 'past years.'."\n"; foreach (sort(keys(%projects))) { print "\n* [$_](", $projects{$_}{'url'}, ")\n";