Examples cleanup
[maxima.git] / doc / info / create_index
blobda4fd75daeaab403c770b43b37351a73656ed0bf
1 #!/usr/bin/perl -w
4 # Creating contents.hhc ...
7 open(CONTENTS, ">./contents.hhc") || die "Can't create contents.hhc";
8 open(MAXIMA_TOC, "./maxima_toc.html") || die "Can't open maxima_toc.html";
10 while (<MAXIMA_TOC>) {
12 if ( m#.*<ul class="toc"># ) {
13 print CONTENTS "<ul>\n";
16 if ( m#.*</ul># ) {
17 print CONTENTS "</ul>\n";
20 if ( m#.*?<li><a\sname="(.*?)"\shref="(.*?)">.*?\s(.*?)</a># ) {
21 print CONTENTS "<li><object type=\"text/sitemap\">\n";
22 print CONTENTS " <param name=\"Local\" value=\"$2\">\n";
23 print CONTENTS " <param name=\"Name\" value=\"$3\"></object>\n";
27 close(MAXIMA_TOC);
28 close(CONTENTS);
31 # Creating index.hhk ...
34 open(INDEX, ">./index.hhk") || die "Can't create index.hhk";
36 $i = 1;
37 %index_content = ();
39 while (open(MAXIMA_N,"./maxima_$i.html")) {
40 while (<MAXIMA_N>) {
42 if ( m#.*?"top"><a\shref="maxima_(.*?)"><code>(.*?)</code></a># ||
43 m#.*?"top"><a\shref="maxima_(.*?)">(.*?)</a># ) {
44 unless ( $index_content{$2} ) {
45 print INDEX "<li><object type=\"text/sitemap\">\n";
46 print INDEX " <param name=\"Local\" value=\"maxima_$1\">\n";
47 print INDEX " <param name=\"Name\" value=\"$2\"></object>\n";
48 $index_content{$2} = 1;
53 close(MAXIMA_N);
54 $i++;
57 close(INDEX);