1 #!/usr/local/bin/perl -w
2 # -----------------------------------------------------------------------------
6 foreach my $srcfile (@ARGV) {
7 my $dstfile = $srcfile;
8 $dstfile =~ s/\.xhtml$/.shtml/;
11 $func =~ s
|^(.*/)?gnumeric
-||;
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";
25 if (m
'<body>' ... m
'</body>') {
29 if (s
|(<div
class="refnamediv")|<p
>$1| .. m{</div>}) {
32 s/<(span class="(function|parameter)")\s+style="font-family: monospace;\s*"\s*>/<$1>/g;
35 s
|<pre
class="synopsis">(.*)</pre
>|$1|;
37 s/(href=\".*\.)xhtml\"/$1shtml\"/g;
43 print DST
'<!--#include virtual="../footer.shtml" -->', "\n";
49 # -----------------------------------------------------------------------------