Introspection fixes
[gnumeric.git] / tools / make-func-www
blob4f4ccdf12a7c4a2cffa62705780cca76315b15fa
1 #!/usr/local/bin/perl -w
2 # -----------------------------------------------------------------------------
4 use strict;
6 foreach my $srcfile (@ARGV) {
7 my $dstfile = $srcfile;
8 $dstfile =~ s/\.xhtml$/.shtml/;
10 my $func = $srcfile;
11 $func =~ s|^(.*/)?gnumeric-||;
12 $func =~ s/\..*$//;
14 local (*SRC, *DST);
15 open (SRC, "<$srcfile") || die "Cannot read $srcfile: $!\n";
16 open (DST, ">$dstfile") || die "Cannot write $dstfile: $!\n";
18 print DST '<!--#set var="title" value="Gnumeric function ', $func, '" -->';
19 print DST '<!--#set var="rootdir" value=".." -->';
20 print DST '<!--#include virtual="../header-begin.shtml" -->', "\n";
21 print DST '<link rel="stylesheet" href="../style/function.css" type="text/css"/>', "\n";
22 print DST '<!--#include virtual="../header-end.shtml" -->', "\n";
24 while (<SRC>) {
25 if (m'<body>' ... m'</body>') {
26 s|^.*<body>||;
27 s|</body>.*$||;
29 if (s|(<div class="refnamediv")|<p>$1| .. m{</div>}) {
30 s|</div>|</div></p>|;
32 s/<(span class="(function|parameter)")\s+style="font-family: monospace;\s*"\s*>/<$1>/g;
33 s/\&\#10;\s*//g;
35 s|<pre class="synopsis">(.*)</pre>|$1|;
37 s/(href=\".*\.)xhtml\"/$1shtml\"/g;
39 print DST;
43 print DST '<!--#include virtual="../footer.shtml" -->', "\n";
45 close (DST);
46 close (SRC);
49 # -----------------------------------------------------------------------------