Bill Janssen said:
> Hi. I'm trying to set up a site file for a 2-level site scooped in
> mhtml format. I'd like to add some header material to the top-level
> page, but not to the secondary pages. Apparently I can't use
> StoryPostProcess, because it affects all the pages, not just the top
> page. Or can I? Is there some Perl variable I could examine to see
> if the line being edited is the top-level page? If so, could some kind
> soul please post a short example of doing this that we Perl-impaired
> types could adapt?
For some reason, can't remember why right now ;) there's a PreProcess and
a PostProcess, but there's only a PostProcess for sotry-level pages.
However there's a PreProcess for all levels. So, for example, to add
<p>Some extra text</p> right at the start of the page, do this
substitution:
ContentsHTMLPreProcess: {
s,^,<p>Some extra text</p>,gs;
}
BTW note that the PreProcess functions take place AFTER the StoryStart and
StoryEnd stuff has been stripped off!
Also note that /gs on a perl substitution means "global" and "operate on
string as a single line"; the latter means ^ matches at the start of the
string, regardless of any newlines that may be inside it. (the default is
to match the start of a "line" inside the string, which is not what you
want in this case).
If you need to debug it, the "-admin journal" command generates a journal
of all the stages of stripping and processing as the site is scooped;
could be handy,
cheers,
--j.
_______________________________________________
Sitescooper-talk mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/mailman/listinfo/sitescooper-talk