* Add a new %destsources hash, which maps between a destination file and
the source page used to create it, ie it's the reverse of %renderedfiles. * Use %destsources in htmllink and urlto for 20-50% speedup.master
parent
7afb843a00
commit
06b955b84a
18
IkiWiki.pm
18
IkiWiki.pm
|
@ -9,8 +9,8 @@ use URI::Escape q{uri_escape_utf8};
|
||||||
use open qw{:utf8 :std};
|
use open qw{:utf8 :std};
|
||||||
|
|
||||||
use vars qw{%config %links %oldlinks %pagemtime %pagectime %pagecase
|
use vars qw{%config %links %oldlinks %pagemtime %pagectime %pagecase
|
||||||
%renderedfiles %oldrenderedfiles %pagesources %depends %hooks
|
%renderedfiles %oldrenderedfiles %pagesources %destsources
|
||||||
%forcerebuild $gettext_obj};
|
%depends %hooks %forcerebuild $gettext_obj};
|
||||||
|
|
||||||
use Exporter q{import};
|
use Exporter q{import};
|
||||||
our @EXPORT = qw(hook debug error template htmlpage add_depends pagespec_match
|
our @EXPORT = qw(hook debug error template htmlpage add_depends pagespec_match
|
||||||
|
@ -328,9 +328,13 @@ sub will_render ($$;$) { #{{{
|
||||||
$renderedfiles{$page}=[$dest, grep { $_ ne $dest } @{$renderedfiles{$page}}];
|
$renderedfiles{$page}=[$dest, grep { $_ ne $dest } @{$renderedfiles{$page}}];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
foreach my $old (@{$renderedfiles{$page}}) {
|
||||||
|
delete $destsources{$old};
|
||||||
|
}
|
||||||
$renderedfiles{$page}=[$dest];
|
$renderedfiles{$page}=[$dest];
|
||||||
$cleared{$page}=1;
|
$cleared{$page}=1;
|
||||||
}
|
}
|
||||||
|
$destsources{$dest}=$page;
|
||||||
} #}}}
|
} #}}}
|
||||||
|
|
||||||
sub bestlink ($$) { #{{{
|
sub bestlink ($$) { #{{{
|
||||||
|
@ -455,7 +459,7 @@ sub urlto ($$) { #{{{
|
||||||
return beautify_url(baseurl($from));
|
return beautify_url(baseurl($from));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! grep { $_ eq $to } map { @{$_} } values %renderedfiles) {
|
if (! $destsources{$to}) {
|
||||||
$to=htmlpage($to);
|
$to=htmlpage($to);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -489,10 +493,10 @@ sub htmllink ($$$;@) { #{{{
|
||||||
return "<span class=\"selflink\">$linktext</span>"
|
return "<span class=\"selflink\">$linktext</span>"
|
||||||
if length $bestlink && $page eq $bestlink;
|
if length $bestlink && $page eq $bestlink;
|
||||||
|
|
||||||
if (! grep { $_ eq $bestlink } map { @{$_} } values %renderedfiles) {
|
if (! $destsources{$bestlink}) {
|
||||||
$bestlink=htmlpage($bestlink);
|
$bestlink=htmlpage($bestlink);
|
||||||
}
|
|
||||||
if (! grep { $_ eq $bestlink } map { @{$_} } values %renderedfiles) {
|
if (! $destsources{$bestlink}) {
|
||||||
return $linktext unless length $config{cgiurl};
|
return $linktext unless length $config{cgiurl};
|
||||||
return "<span><a href=\"".
|
return "<span><a href=\"".
|
||||||
cgiurl(
|
cgiurl(
|
||||||
|
@ -502,6 +506,7 @@ sub htmllink ($$$;@) { #{{{
|
||||||
).
|
).
|
||||||
"\">?</a>$linktext</span>"
|
"\">?</a>$linktext</span>"
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$bestlink=abs2rel($bestlink, dirname(htmlpage($page)));
|
$bestlink=abs2rel($bestlink, dirname(htmlpage($page)));
|
||||||
$bestlink=beautify_url($bestlink);
|
$bestlink=beautify_url($bestlink);
|
||||||
|
@ -723,6 +728,7 @@ sub loadindex () { #{{{
|
||||||
$oldlinks{$page}=[@{$items{link}}];
|
$oldlinks{$page}=[@{$items{link}}];
|
||||||
$links{$page}=[@{$items{link}}];
|
$links{$page}=[@{$items{link}}];
|
||||||
$depends{$page}=$items{depends}[0] if exists $items{depends};
|
$depends{$page}=$items{depends}[0] if exists $items{depends};
|
||||||
|
$destsources{$_}=$page foreach @{$items{dest}};
|
||||||
$renderedfiles{$page}=[@{$items{dest}}];
|
$renderedfiles{$page}=[@{$items{dest}}];
|
||||||
$oldrenderedfiles{$page}=[@{$items{dest}}];
|
$oldrenderedfiles{$page}=[@{$items{dest}}];
|
||||||
$pagecase{lc $page}=$page;
|
$pagecase{lc $page}=$page;
|
||||||
|
|
|
@ -10,8 +10,11 @@ ikiwiki (1.50) UNRELEASED; urgency=low
|
||||||
[ Joey Hess ]
|
[ Joey Hess ]
|
||||||
* Add support for PROFILE=1 to the Makefile, this turns on profiling of the
|
* Add support for PROFILE=1 to the Makefile, this turns on profiling of the
|
||||||
wiki build using Devel::Profiler (Dprof can't handle ikiwiki).
|
wiki build using Devel::Profiler (Dprof can't handle ikiwiki).
|
||||||
|
* Add a new %destsources hash, which maps between a destination file and
|
||||||
|
the source page used to create it, ie it's the reverse of %renderedfiles.
|
||||||
|
* Use %destsources in htmllink and urlto for 20-50% speedup.
|
||||||
|
|
||||||
-- Joey Hess <joeyh@debian.org> Mon, 09 Apr 2007 20:22:44 -0400
|
-- Joey Hess <joeyh@debian.org> Mon, 09 Apr 2007 21:09:32 -0400
|
||||||
|
|
||||||
ikiwiki (1.49) unstable; urgency=low
|
ikiwiki (1.49) unstable; urgency=low
|
||||||
|
|
||||||
|
|
|
@ -266,9 +266,9 @@ use the following hashes, using a page name as the key:
|
||||||
|
|
||||||
* `links` lists the names of each page that a page links to, in an array
|
* `links` lists the names of each page that a page links to, in an array
|
||||||
reference.
|
reference.
|
||||||
* `%renderedfiles` lists names of the files rendered by a page, in an array
|
* `%destsources` contains the name of the source file used to create each
|
||||||
reference.
|
destination file.
|
||||||
* `%pagesources` contains the name of the source file for a page.
|
* `%pagesources` contains the name of the source file for each page.
|
||||||
|
|
||||||
Also, the %IkiWiki::version variable contains the version number for the
|
Also, the %IkiWiki::version variable contains the version number for the
|
||||||
ikiwiki program.
|
ikiwiki program.
|
||||||
|
|
|
@ -20,7 +20,7 @@ Released 29 April 2006.
|
||||||
* Should have fully working [[todo/utf8]] support. (./)
|
* Should have fully working [[todo/utf8]] support. (./)
|
||||||
* [[Optimised_rendering|todo/optimisations]] if possible. Deal with other
|
* [[Optimised_rendering|todo/optimisations]] if possible. Deal with other
|
||||||
scalability issues. _(status: scales to thousands of pages, and approximatly
|
scalability issues. _(status: scales to thousands of pages, and approximatly
|
||||||
3x as fast as version 1.0)_ (./)
|
3.5 times as fast as version 1.0)_ (./)
|
||||||
* Improved [[todo/html]] stylesheets and templates.
|
* Improved [[todo/html]] stylesheets and templates.
|
||||||
* Improved scalable [[logo]]. (./)
|
* Improved scalable [[logo]]. (./)
|
||||||
* Support for at other revision control systems aside from svn.
|
* Support for at other revision control systems aside from svn.
|
||||||
|
|
|
@ -8,7 +8,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2007-04-09 20:10-0400\n"
|
"POT-Creation-Date: 2007-04-09 21:13-0400\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
@ -553,7 +553,7 @@ msgstr ""
|
||||||
#. translators: preprocessor directive name,
|
#. translators: preprocessor directive name,
|
||||||
#. translators: the second a page name, the
|
#. translators: the second a page name, the
|
||||||
#. translators: third a number.
|
#. translators: third a number.
|
||||||
#: ../IkiWiki.pm:620
|
#: ../IkiWiki.pm:625
|
||||||
#, perl-format
|
#, perl-format
|
||||||
msgid "%s preprocessing loop detected on %s at depth %i"
|
msgid "%s preprocessing loop detected on %s at depth %i"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
Loading…
Reference in New Issue