Revert po vs. template kludges.

This reverts commits dcd57dd5c9,
d4136aea8a and
d877b9644b.
master
intrigeri 2010-07-11 11:00:43 +02:00
parent c99d26030e
commit 4a1cb092ba
7 changed files with 9 additions and 19 deletions

View File

@ -1403,16 +1403,14 @@ sub preprocess ($$$;$$) {
return $content;
}
sub filter ($$$;$) {
sub filter ($$$) {
my $page=shift;
my $destpage=shift;
my $content=shift;
my $fullpage=shift;
$fullpage = 0 unless defined $fullpage;
run_hooks(filter => sub {
$content=shift->(page => $page, destpage => $destpage,
content => $content, fullpage => $fullpage);
content => $content);
});
return $content;

View File

@ -187,7 +187,7 @@ sub cgi_editpage ($$) {
my $preview=htmlize($page, $page, $type,
linkify($page, $page,
preprocess($page, $page,
filter($page, $page, $content, 'fullpage'), 0, 1)));
filter($page, $page, $content), 0, 1)));
run_hooks(format => sub {
$preview=shift->(
page => $page,

View File

@ -403,7 +403,7 @@ sub preprocess_inline (@) {
linkify($page, $params{destpage},
preprocess($page, $params{destpage},
filter($page, $params{destpage},
readfile(srcfile($file)), 'fullpage')));
readfile(srcfile($file)))));
}
else {
$ret.="\n".
@ -474,7 +474,7 @@ sub get_inline_content ($$) {
linkify($page, $destpage,
preprocess($page, $destpage,
filter($page, $destpage,
readfile(srcfile($file)), 'fullpage'))));
readfile(srcfile($file))))));
$nested--;
if (isinternal($page)) {
# make inlined text of internal pages searchable

View File

@ -259,12 +259,6 @@ sub filter (@) {
my $page = $params{page};
my $destpage = $params{destpage};
my $content = $params{content};
my $fullpage = $params{fullpage};
unless ($fullpage) {
return $content;
}
if (istranslation($page) && ! alreadyfiltered($page, $destpage)) {
$content = po_to_markup($page, $content);
setalreadyfiltered($page, $destpage);

View File

@ -89,7 +89,7 @@ sub sidebar_content ($) {
return IkiWiki::htmlize($sidebar_page, $page, $sidebar_type,
IkiWiki::linkify($sidebar_page, $page,
IkiWiki::preprocess($sidebar_page, $page,
IkiWiki::filter($sidebar_page, $page, $content, 'fullpage'))));
IkiWiki::filter($sidebar_page, $page, $content))));
}
}

View File

@ -232,7 +232,7 @@ sub render ($$) {
linkify($page, $page,
preprocess($page, $page,
filter($page, $page,
readfile($srcfile), 'fullpage'))));
readfile($srcfile)))));
my $output=htmlpage($page);
writefile($output, $config{destdir}, genpage($page, $content));
@ -837,7 +837,7 @@ sub commandline_render () {
my $content=readfile($srcfile);
my $page=pagename($file);
$pagesources{$page}=$file;
$content=filter($page, $page, $content, 'fullpage');
$content=filter($page, $page, $content);
$content=preprocess($page, $page, $content);
$content=linkify($page, $page, $content);
$content=htmlize($page, $page, $type, $content);

View File

@ -200,9 +200,7 @@ value is ignored.
Runs on the raw source of a page, before anything else touches it, and can
make arbitrary changes. The function is passed named parameters "page",
"destpage", "content" and "fullpage". "fullpage" is a true value if,
and only if, a full page's content is being filtered, e.g. as opposed
to a directive parameter. It should return the filtered content.
"destpage", and "content". It should return the filtered content.
### preprocess