summaryrefslogtreecommitdiffstats
path: root/application/libraries/contrib/process-geshi-css.pl
blob: dbf76c2948285b8350814cf9e187c6f4fac36771 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/perl
use warnings;
use strict;

open INPUT, "<", "geshi.css" or die $!;

my $last="";

while (<INPUT>) {
	my $line = $_;
	my ($lang, $rest) = split / /;
	$lang =~ s/\.//;
	$lang =~ s/^_+//;
	chomp $lang;

	next if ($lang eq "");

	if ($lang ne $last) {
		$last = $lang;
		unlink "paste-$lang.css";
		print STDERR "processing $lang\n";
	}
	open OUT, ">>", "paste-$lang.css";
	print OUT "$line";
	close OUT;
}