Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
When execute command line : --cfg=value against --cfg value.
[simgrid.git] / tools / doxygen / bibtex2html_wrapper.pl
1 #!/usr/bin/perl -w
2 use utf8;
3 use strict;
4
5 my $file = shift @ARGV || die "USAGE: bibtex2html_wrapper <file>\n";
6
7 my $output;
8
9 open IN,"bibtex2html -single-output -nv -force -sort year -copy-icons ${file}.bib -output -|iconv -f latin1 -t utf8 -|";
10
11 $write=0;
12 while($line = <IN>) {
13     chomp $line;
14     next if $line =~ /WARNING: unknown field type/;
15     
16     if($line =~ /table width/) {
17         $line = <IN>;
18         chomp $line;
19         if($line =~ /height="50"/) {
20             ## Skip preembule
21             $write=1;
22             do {
23                 $line = <IN>;
24                 chomp $line;
25             } while (!($line =~ /table/));
26             next;
27         }
28         if($line =~ /height="35"/) {
29             ## Change this uggly table into a h2
30             do {
31                 $line = <IN>;
32                 chomp $line;
33             } while (($line =~ /</));
34             $title=$line;
35             do {
36                 $line = <IN>;
37                 chomp $line;
38             } while (!($line =~ /table/));
39             $output .= "<h1>$title</h1>\n";
40             next;
41         }
42     }
43     $line =~ s/<ol>/<ul>/g;
44     $line =~ s/<\/ol>/<\/ul>/g;
45
46     if($line =~ /Disclaimer:/ || $line =~ /body>/) {
47         $write=0;
48         next;
49     }
50     if($line =~ /This document was translated f/) {
51         $write=1;
52     }
53
54     if($write) {
55         $output .= $line."\n";
56     }
57     
58 }