solve: do not call MEVAL.
[maxima.git] / doc / info / create_index
blob85517fa4bb4f17bb39f823fe399a1368a7a8cad6
1 #!/usr/bin/env perl
4 # Creating contents.hhc ...
7 use warnings;
9 if(!defined $ARGV[0]){
10 die "create_index: No name of the file containing the index was Specified!\n";
13 open(CONTENTS, ">./contents.hhc") || die "Can't create contents.hhc";
14 open(MAXIMA_TOC, $ARGV[0]) || die "Can't open " . $ARGV[0];
16 while (<MAXIMA_TOC>) {
18 if ( m#.*<ul class="no-bullet"># ) {
19 print CONTENTS "<ul>\n";
22 if ( m#.*</ul># ) {
23 print CONTENTS "</ul>\n";
26 if ( m#.*?<li><a\sname="(.*?)"\shref="(.*?)">.*?\s(.*?)</a># ) {
27 print CONTENTS "<li><object type=\"text/sitemap\">\n";
28 print CONTENTS " <param name=\"Local\" value=\"$2\">\n";
29 print CONTENTS " <param name=\"Name\" value=\"$3\"></object>\n";
33 close(MAXIMA_TOC);
34 close(CONTENTS);
37 # Creating index.hhk ...
40 open(INDEX, ">./index.hhk") || die "Can't create index.hhk";
42 $i = 1;
43 %index_content = ();
45 while (open(MAXIMA_N,"./maxima_$i.html")) {
46 while (<MAXIMA_N>) {
48 if ( m#.*?"top"><a\shref="maxima_(.*?)"><code>(.*?)</code></a># ||
49 m#.*?"top"><a\shref="maxima_(.*?)">(.*?)</a># ) {
50 unless ( $index_content{$2} ) {
51 print INDEX "<li><object type=\"text/sitemap\">\n";
52 print INDEX " <param name=\"Local\" value=\"maxima_$1\">\n";
53 print INDEX " <param name=\"Name\" value=\"$2\"></object>\n";
54 $index_content{$2} = 1;
59 close(MAXIMA_N);
60 $i++;
63 close(INDEX);