Commit Graph

2027 Commits (e3b5d7013717af732b36efd9e4abe1f14d0f3175)

Author SHA1 Message Date
intrigeri 5136c22eed po: favor the type of linking page's masterpage on page creation
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-08-28 07:33:53 -04:00
intrigeri 18ddf727d1 po: fix interdiction to create pages of type po
... which was broken by the new page_types code.

Signed-off-by: intrigeri <intrigeri@boum.org>
(cherry picked from commit 1914ae2fd2)
2009-08-28 07:32:41 -04:00
Joey Hess 0c1a71896d htmltidy: Return an error message if tidy fails. Closes: #543722
On second^Wthird^Wfourth thought, putting the message into the page seems
better than using stderr.
2009-08-27 16:27:57 -04:00
intrigeri cdc3576c8d po: do not inject custom bestlink function when po_link_to eq default
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-08-27 20:31:44 +02:00
intrigeri 6c0f9c691c po: override the title template variable for coherent homepage titling
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-08-27 20:19:17 +02:00
intrigeri 3c2bffe21b po(scan): removed scary comment about only wanting to change the first link
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-08-27 19:59:15 +02:00
intrigeri 0c032b0ccb Merge commit 'upstream/master' into prv/po 2009-08-27 19:56:37 +02:00
intrigeri 5eec60d4c6 po: do not beautify urls on the recentchanges page
... else, the recentchanges page shows a link such as "sandbox.es". But,
clicking on it goes to the English (or negotiated language) version of the page.

It is better in this one case if the link goes direct to the translated version
of the page.
(cherry picked from commit 496e8523c6)
2009-08-27 12:56:49 -04:00
Joey Hess 4e70f2f0d2 htmltidy: Print a warning message if tidy fails. Closes: #543722 2009-08-26 13:24:51 -04:00
intrigeri 496e8523c6 po: do not beautify urls on the recentchanges page
... else, the recentchanges page shows a link such as "sandbox.es". But,
clicking on it goes to the English (or negotiated language) version of the page.

It is better in this one case if the link goes direct to the translated version
of the page.
2009-08-26 07:56:33 +02:00
intrigeri 0113c69d4f po: (hopefully) fixed WikiLink to self with po_link_to=default 2009-08-26 07:02:29 +02:00
Joey Hess 7dd9b65db4 don't use pagespec_match_list
This should be more efficient than pagespec_match_list since it short-circuits
after the first match is found.

The other problem with using pagespec_match_list here is it may throw an
error if a bad or failing pagespec somehow got into the dependencies.
2009-08-25 17:54:36 -04:00
Joey Hess 5bcdc39999 Revert "Allow add_depends to take an arrayref"
This reverts commit e4cd168ebe.

There was no benefit to this change.
2009-08-25 17:11:29 -04:00
Simon McVittie df8ab3406d use pagespec_match_list 2009-08-25 00:31:24 +01:00
Simon McVittie e4cd168ebe Allow add_depends to take an arrayref 2009-08-25 00:31:24 +01:00
Simon McVittie 7227c2debf Use a hash to de-duplicate dependencies 2009-08-25 00:31:16 +01:00
Simon McVittie b6fcb1cb0e calendar, inline, map: don't pre-join dependencies
The new dependency handling works better (eliminates more duplicates) if
dependencies are split up. On the same wiki mentioned in the previous
commit, this saves about a second (i.e. 4%) on the same test.
2009-08-24 23:18:16 +01:00
Simon McVittie fe4f176f72 Optimize the dependencies list
On a large wiki you can spend a lot of time reading through large lists
of dependencies to see whether files need to be rebuilt (album, with its
one-page-per-photo arrangement, suffers particularly badly from this).

The dependency list is currently a single pagespec, but it's not used like
a normal pagespec - in practice, it's a list of pagespecs joined with the
"or" operator.

Accordingly, change it to be stored as a list of pagespecs. On a wiki
with many tagged photo albums, this reduces the time to refresh after
`touch tags/*.mdwn` from about 31 to 25 seconds.

Getting the benefit of this change on an existing wiki requires a rebuild.
2009-08-24 23:18:10 +01:00
Joey Hess 9b799ccc85 po: Fixed to run rcs_add ralative to srcdir. 2009-08-19 14:05:59 -04:00
Joey Hess 8b99e68743 use pagespec_match_list for feedpages
This is both faster, and propigates any error in processing the feedpages
pagespec out to display on the page. Which may have been why I didn't use
it before, but currently seems like a good thing to do, since it explains
why your feeds are empty..
2009-08-16 13:45:10 -04:00
Joey Hess 4ff3e2a540 po: Better fix for missing underlay translation problem.
If a page is taken from the underlay, and one of the specified languages
does not have po files in the underlay, it would create a broken link
to the translated version of the page for that language.

With this change, there's no broken link.
2009-08-15 22:18:05 -04:00
Joey Hess 1be07eae46 replace N/A with 0
I think the N/A was not intended to be visible, but it can show up as the
percent translated to a language. This happens if the page is located in an
underlay, and not translated to the language in any other underlay.
2009-08-15 21:08:17 -04:00
Joey Hess e031551727 update for consistency 2009-08-15 16:42:29 -04:00
Joey Hess 6a2f3ef4bd indentation 2009-08-15 13:58:04 -04:00
Simon McVittie 97e9d99358 meta: depend on absolute page name, not relative
Previously, [[!meta redir="foo"]] on bar, where bar/foo exists, would
depend on "foo" (which matches nothing, probably) rather than "bar/foo".
(cherry picked from commit f27ec09b72f886415e63fe394e18d9c3cb3913bf)
2009-08-15 13:50:55 -04:00
Simon McVittie e0bb9675ce img: depend on absolute page name, not relative
Previously, [[!img bar.jpg]] on foo, where foo/bar.jpg exists, would
get a dependency equivalent to "glob(bar.jpg)" (which might not match
anything), rather than the correct "glob(foo/bar.jpg)".
(cherry picked from commit 85b2ec49ecd12dd23e5c432933457a72744ce7cb)
2009-08-15 13:50:34 -04:00
Joey Hess 82bb3af579 optimise brokenlinks by gathering the data when calculating backlinks
During backlink calulation, all links are examined and broken links can
be detected for free, so store a list of broken links and have brokenlinks
use it.

Exposing the %brokenlinks structure is a bit ugly, but the speedup seems
worth it: Around 1 second for wikis the size of the doc wiki that use
brokenlinks.
2009-08-14 01:11:53 -04:00
Joey Hess f486271009 orphans: Reuse backlinks info
This plugin was building essentially the same data that is built to handle
backlinks, so reuse that as an optimisation.
2009-08-14 00:51:52 -04:00
Joey Hess 949eb252e9 po: use discussionpage config setting
This was tricky. $links{$page/discussion} must be checked; with it in
lowercase.
2009-08-13 21:44:40 -04:00
Joey Hess 830c9e59b2 Add discussionpage configuration setting
By adding this setting, we get both more configurability, and a minor
optimisation too, since gettext does not need to be called continually
to get the Discussion value.
2009-08-13 21:41:33 -04:00
Joey Hess 159c0c043c optimise gettext calls 2009-08-13 21:04:19 -04:00
Joey Hess 4971f873a0 more idiomatic use of foreach 2009-08-12 12:49:40 -04:00
Joey Hess 63ce4459f5 fix some more foreaches that clal functions to not use $_ 2009-08-12 12:49:16 -04:00
Joey Hess 906c8f6e58 use a more idiomatic foreach my 2009-08-12 12:43:57 -04:00
Joey Hess 04014e4775 inline: Avoid use of my $_ as it fails with older perls. Closes: #541215 2009-08-12 12:33:02 -04:00
Joey Hess b4d7dfcbe1 po: Detect if nowrapi18n can't be passed to po4a, and warn about the old version, but continue. Closes: #541205 2009-08-12 12:26:07 -04:00
Joey Hess 83480665c2 po: Fix copy of po file from underlay when editing
When first editing a page that was in the underlay, avoid losing
the translation by copying the po file over from the underlay.
2009-08-10 15:59:32 -04:00
Joey Hess 8f6e0212fd verify page name is sane
paranoia; I was thinking about XSS attacks specificaly
2009-08-08 12:27:48 -04:00
Joey Hess 22edaf77c2 fix misleading comment 2009-08-08 12:23:50 -04:00
Joey Hess 79312b2754 Merge commit 'smcv/ready/getsource'
Conflicts:
	debian/changelog
2009-08-08 12:22:10 -04:00
Joey Hess f1a70921e3 Merge commit 'remotes/smcv/ready/inline-pagenames' into staging 2009-07-31 10:25:43 +02:00
Joey Hess 0bbb3d201e Merge commit 'remotes/smcv/ready/harishcm-map-fix' into staging 2009-07-31 10:23:06 +02:00
Joey Hess 3d27dac809 Merge commit 'remotes/smcv/ready/among' 2009-07-31 10:12:23 +02:00
Joey Hess 9d96250fc5 img: Fix adding of dependency from page to the image.
This was impressively broken. add_depends was being called with params
backwards, and on parameter was set to the name of the generated
file, which isn't in the source.

Now updates to images will update the page that contains them, thus
updating them. This is unncessary for fullsize images, so skipped.
2009-07-27 22:22:26 +02:00
Simon McVittie 70b1c2aabd getsource: remove temporary variable 2009-07-27 11:58:36 +01:00
Simon McVittie 2ef53b128d getsource: remove unnecessary IkiWiki:: prefixes
Many variables and functions are exported.
2009-07-26 17:04:49 +01:00
Simon McVittie ea244ab7b5 getsource: don't allow getting the source of an attachment
Serving up images etc. as text/plain; charset=utf-8 is unlikely to work
very well, and there's no point in having this CGI action for attachments
(since they're copied into the output as-is anyway).
2009-07-26 17:04:34 +01:00
Simon McVittie 0afcec7346 getsource: turn missing pages into a 404
Also restructure so we return early on missing pages.
2009-07-26 17:04:30 +01:00
Simon McVittie 3f520da78a getsource: default to saying page source is in UTF-8, and make the example match the default
IkiWiki mostly assumes that pages are in UTF-8; anyone this doesn't work
for can override it in the setup file.
2009-07-26 16:36:17 +01:00
Simon McVittie eaf59e5ba9 getsource: run as plain CGI, rather than sessioncgi
As I suggested when reviewing Will's code, calling loadindex() should be
sufficient.
2009-07-26 16:33:12 +01:00