The simplest (yet ugly) solution is probably like this:


#for docs and faq $text =~ s|</head>.*<body>(¥n)*(<!--¥?)|¥';¥n¥n|s; $text =~ s|</body>.*</html>(¥n)*(<!--¥?)|¥';¥n¥n|s;

$text =~ s|<!--¥?|<?|g;
$text =~ s|¥?-->|?>|g;

$text =~ s|{FINK_([^}]*)}|<? echo FINK_$1 ; ?>|g;

# for news
$text =~ s|</head><body>|';¥n¥ninclude_once "header.inc";¥n?>¥n¥n|s;
$text =~ s|</body></html>|¥n¥n<?¥ include_once "footer.inc"; ?>|s;


See also the attached file. This worked with news, docs and faq on my system.

Below is an explanation of what I did to postprocess.pl

Index: postprocess.pl
===================================================================
RCS file: /cvsroot/fink/web/xml/postprocess.pl,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- postprocess.pl 7 Mar 2004 20:57:54 -0000 1.8
+++ postprocess.pl 10 Jul 2004 12:34:29 -0000 1.9
@@ -20,8 +20,16 @@
while ($text =~ s|(</title>.*[^\\])'(.*</head>)|$1\\'$2|s) {
}
$text =~ s|</title>|";\n\$cvs_author = '$tag_author';\n\$cvs_date = '$tag_date';\n\$metatags = '|s;
-$text =~ s|</head>.*<body>|';\n\ninclude_once "header.inc";\n?>\n\n|s;
-$text =~ s|</body>.*</html>|\n\n<?\ include_once "footer.inc"; ?>|s;
+#$text =~ s|</head>.*<body>|';\n\ninclude_once "header.inc";\n?>\n\n|s;
+#$text =~ s|</body>.*</html>|\n\n<?\ include_once "footer.inc"; ?>|s;

Commented out.

+$text =~ s|</head>.*<body>(\n)*(<!--\?)?|\';\n\n|s;
+$text =~ s|</body>.*</html>|\n\n|s;

Instead, I modified XSLT file to output something like "<!--? include foo; ?-->".

+$text =~ s|<!--\?|<?|g;
+$text =~ s|\?-->|?>|g;

This will modify <!--? include "footer.inc"; ?--> to <? include "footer.inc"; ?>

+$text =~ s|{FINK_([^}]*)}|<? echo FINK_$1 ; ?>|g;

This line is for something else.





Attachment: postprocess.pl
Description: application/applefile

Attachment: postprocess.pl
Description: application/text


-- BABA Yoshihiko

"You can take my freedom but you can't take my beer!!" by aarkzoo

Town Planner (Kyoto Center for Community Collaboration)
Support, Translation and Documentation Team, Fink Project (http://fink.sourceforge.net)

Reply via email to