Fix 600d3bb56b
[org-mode.git] / mk / manfull.pl
blob680b87862e6c32cbe043c73ab0cb4b9c67ed867c
1 #!/usr/bin/perl
4 while ($page = shift) {
5 system "mv $page $page.orig";
6 open IN,"<$page.orig" or die "Cannot read from $page.orig\n";
7 open OUT,">$page" or die "Cannot write to $page\n";
9 while (<IN>) {
10 if (/<meta http-equiv="Content-Style-Type" content="text\/css">/) {
11 print OUT;
12 print OUT '<link rel="stylesheet" href="http://orgmode.org/org-manual.css" type="text/css" />';
13 } elsif (/<div class="contents">/) {
14 print OUT;
15 print OUT '<p>This is the official manual for the latest <a href="http://orgmode.org">Org-mode</a> release.</p><div id="table-of-contents">';
16 } elsif (/<h2>Table of Contents<\/h2>/) {
17 print OUT;
18 print OUT '<a href="http://orgmode.org">http://orgmode.org</a><br/><div id="text-table-of-contents">';
19 $toc = 1;
20 } elsif (/<\/div>/ and $toc) {
21 print OUT "</div></div></div>";
22 $toc = 0;
23 } else {
24 print OUT;
27 system "rm $page.orig";