f44e2a5e69
git-svn-id: svn://localhost/ardour2/trunk@2649 d708f5d6-7413-0410-9779-e7cbd77b26cf
82 lines
1.4 KiB
Perl
Executable File
82 lines
1.4 KiB
Perl
Executable File
#! @PERL_PATH@
|
|
#
|
|
# @configure_input@
|
|
#
|
|
|
|
#sub main()
|
|
{
|
|
my $directory = ".";
|
|
$directory = $ARGV[0] unless scalar(@ARGV) == 0;
|
|
print "processing directory $directory...\n" unless $directory =~ /^\.?$/;
|
|
|
|
foreach(`find "$directory" -type f -name '*.html'`)
|
|
{
|
|
chomp;
|
|
/([^\/]+)$/;
|
|
print "processing $1...\n";
|
|
&process($_);
|
|
}
|
|
|
|
exit 0;
|
|
}
|
|
|
|
sub process($)
|
|
{
|
|
my ($file) = @_;
|
|
my @outbuf;
|
|
|
|
open(FILE, '<', $file);
|
|
|
|
while(<FILE>)
|
|
{
|
|
if(/<a class="el"/)
|
|
{
|
|
# return value
|
|
s/ & /& /;
|
|
s/ \* /* /;
|
|
|
|
# arg list
|
|
s/ &/&/g;
|
|
s/&\b/& /g;
|
|
s/ \*/*/g;
|
|
s/\*\b/* /g;
|
|
|
|
# templates
|
|
s/\btemplate<\b/template </;
|
|
while(s/(.*<) +(.+) +(>.*)/$1$2$3/) {}
|
|
}
|
|
elsif(/<td class="md(|name)"/)
|
|
{
|
|
# left parenthesis
|
|
s/\( /(/;
|
|
|
|
# return value
|
|
s/ & /& /g;
|
|
s/ \* /* /g;
|
|
|
|
# arg list
|
|
s/ & /& /g;
|
|
s/ \* /* /g;
|
|
|
|
# templates
|
|
s/\btemplate<\b/template </;
|
|
while(s/(.*<) +(.+) +(>.*)/$1$2$3/) {}
|
|
}
|
|
else
|
|
{
|
|
# template decls
|
|
s/^(|<h\d>)template<\b/$1template </;
|
|
}
|
|
|
|
push(@outbuf, $_);
|
|
}
|
|
|
|
open(FILE, '>', $file);
|
|
|
|
# write the whole buffer back
|
|
print FILE "$_" foreach(@outbuf);
|
|
|
|
close(FILE);
|
|
}
|
|
|