Commit Graph

1416 Commits (bf0534c6891a4a2c1cf8bf562ef275ed4cd3548d)

Author SHA1 Message Date
Joey Hess 5418385336 Optimise use of gettext, and avoid ugly warnings if Locale::gettext is not available.
The test suite was emitting a lot of ugly gettext warnings;
setting LC_ALL didn't solve the problem for all locale setups
(since ikiwiki remaps it to LANG, and ikiwiki didn't know about
the C locale).

People also seem generally annoyed by the messages when
Locale::Gettext is not installed, and I suspect will be
generally happier if it just silently doesn't localize.

The optimisation came about when I noticed that the gettext
sub was doing rather a lot of work each call just to see
if localisation is needed. We can avoid that work by caching,
and the best thing to cache is a version of the gettext sub
that does exactly the right thing.

This was slightly complicated by the locale setting,
which might need to override the original locale (or lack
thereof) after gettext has been called. So it needs to invalidate
the cache in that case. It used to do it via a global variable,
which I am happy to have also gotten rid of.
2009-06-08 18:33:54 -04:00
Joey Hess e40d2a6b2b goto: Support being passed a page title that is not a valid page name, to support several cases including mercurial's long user names on the RecentChanges page, and urls with spaces being handled by the 404 plugin. 2009-06-06 02:36:40 -04:00
Joey Hess e8d8386e52 pagecount: Fix broken optimisation for * pagespec. 2009-06-05 18:04:39 -04:00
Joey Hess 0293ae8e3d Setup automator: Check that each plugin added to the generated setup file can be loaded and that its config is ok. If a plugin fails for any reason, disable it in the generated file. Closes: 532001 2009-06-05 16:58:06 -04:00
Joey Hess bd78168f71 Tighten up matching of bare words inside directives
Do not allow an unterminated """ string to be treated as a series of bare
words. Fixes runaway regexp recursion/backtracking in strange situations.

(See 1d57a21c98 for test case.)
2009-06-05 16:14:51 -04:00
Joey Hess 6842328405 Avoid relying on translators preserving the case when translating "discussion", which caused Discussion pages to get unwanted Discussion links. 2009-06-04 13:15:05 -04:00
Joey Hess 5cdee82ef6 comment: Make comment directives no longer use the internal "_comment" form, and document the comment directive syntax.
Rationalle: Comments need to be user-editable so that they can be posted
via git commit etc.

The _comment directive is still supported, for back-compat.
2009-06-02 17:06:46 -04:00
Joey Hess 42cc56f796 releasing version 3.14 2009-06-01 13:11:18 -04:00
Joey Hess 52dc080ed1 Danish translation update. Closes: #530877 2009-05-28 11:06:03 -04:00
Joey Hess fd7db49f94 Fix test suite to not rely on an installed copy of ikiwiki after underlaydir change. Closes: #530502 2009-05-25 12:40:40 -04:00
Joey Hess 47298b01c1 allow format to use any language supported by highlight
format: Provide a htmlizefallback hook that other plugins can use to
handle formats that are not suitable for general-purpose htmlize hooks.

highlight: Use the hook to allow formatting of any language/extension,
without it needing to be enabled for standalone source files.

highlight: If the highlight perl binding is not available, fallback
safely to a passthrough mode.
2009-05-23 05:17:26 -04:00
Joey Hess 8ae260015f highlight: New plugin supporting syntax highlighting of pretty much anything.
* debian/control: Add suggests for libhighlight-perl, although
  that package is not yet created by Debian's highlight source package.
  (See #529869)
2009-05-22 22:57:03 -04:00
Joey Hess 8f6cdf3ae0 listdirectives: Avoid listing _comment directives and generally assume any directive starting with _ is likewise internal. 2009-05-22 14:17:26 -04:00
Joey Hess c2e2da6ee2 ikiwiki-transition: deduplinks was broken and threw away all metadata stored by plugins in the index. Fix this bug. 2009-05-22 13:09:11 -04:00
Joey Hess f7ded1174d ikiwiki-transition: Allow setup files to be passed to all subcommands that need a srcdir. 2009-05-20 13:26:20 -04:00
Joey Hess 23a4ee6d15 Allow curly braces to be used in pagespecs
And avoid a whole class of potential security problems (though
none that I know of actually existing..), by avoiding
performing any string interpolation on user-supplied data when translating
pagespecs.
2009-05-18 15:25:10 -04:00
Joey Hess c177ede303 More friendly display of markdown, textile in edit form selector (jmtd) 2009-05-16 10:39:52 -04:00
Joey Hess 4291f2e3d7 Allow underlaydir to be overridden without messing up inclusion of other underlays via add_underlay. 2009-05-07 14:02:52 -04:00
Joey Hess 9f5f5543bf ikiwiki-transition: If passed a nonexistant srcdir, or one not containing .ikiwiki, abort with an error rather than creating it. 2009-05-06 20:46:26 -04:00
Joey Hess d3188a04ff external: Fix pagespec_match and pagespec_match_list. Closes: #527281 2009-05-06 12:57:37 -04:00
Joey Hess 2a7721febd Avoid %links accumulating duplicates. (For TOVA)
This is sorta an optimisation, and sorta a bug fix. In one
test case I have available, it can speed a page build up from 3
minutes to 3 seconds.

The root of the problem is that $links{$page} contains arrays of
links, rather than hashes of links. And when a link is found,
it is just pushed onto the array, without checking for dups.

Now, the array is emptied before scanning a page, so there
should not be a lot of opportunity for lots of duplicate links
to pile up in it. But, in some cases, they can, and if there
are hundreds of duplicate links in the array, then scanning it
for matching links, as match_link and some other code does,
becomes much more expensive than it needs to be.

Perhaps the real right fix would be to change the data structure
to a hash. But, the list of links is never accessed like that,
you always want to iterate through it.

I also looked at deduping the list in saveindex, but that does
a lot of unnecessary work, and doesn't completly solve the problem.

So, finally, I decided to add an add_link function that handles deduping,
and make ikiwiki-transition remove the old dup links.
2009-05-06 00:27:24 -04:00
Joey Hess e77d0030d6 inline: Minor optimisation.
When finding the pageurl, it was calling bestlink unnecessarily.
Since at this point $page contains the full name of the page that
is being inlined, there is no need to do bestlink's scan
for it.

This is only a minor optimisation, since bestlink is only called
once per displayed, inlined page.
2009-05-05 20:06:50 -04:00
Joey Hess 5636b62829 ikiwiki-makerepo: Avoid using abs_path, as it apparently fails on nonexistant directories with some broken perl versions. 2009-05-05 14:15:28 -04:00
Joey Hess 5e5bb93adb turn python-support back on
Should wait to upload until ikiwiki is fixed in testing.
2009-05-04 19:17:59 -04:00
Joey Hess 8455036ed0 releasing version 3.11 2009-05-04 16:33:10 -04:00
Joey Hess 39c8d072e8 Avoid using python-support. Closes: #525086
Uses new debhelper feature to turn off python-support.

The tiny python module included herein certianly doesn't
need all the python-support nonsense.
2009-05-04 14:41:21 -04:00
Joey Hess a1bbeec148 translation.mdwn: Typo fixes. Closes: #525753 2009-04-27 13:57:35 -04:00
Joey Hess 45c8b951a1 Updated Danish translation from Jonas Smedegaard. Closes: #525751 2009-04-27 13:54:48 -04:00
Joey Hess aa306957ba pagespec_match_list added and used in most appropriate places
* pagespec_match_list: New API function, matches pages in a list
  and throws an error if the pagespec is bad.
* inline, brokenlinks, calendar, linkmap, map, orphans, pagecount,
  pagestate, postsparkline: Display a handy error message if the pagespec
  is erronious.
2009-04-23 15:45:30 -04:00
Joey Hess 527d178c12 comments: Add link to comment post form to allow user to sign in if they wish to, if the configuration makes signin optional for commenting. 2009-04-23 14:56:10 -04:00
Joey Hess 748aa7af77 pagespec error/failure distinction and error display by inline
* Add IkiWiki::ErrorReason objects, and modify pagespecs to return
  them in cases where they fail to match due to a configuration or syntax
  error.
* inline: Display a handy error message if the inline cannot display any
  pages due to such an error.

This is perhaps somewhat incomplete, as other users of pagespecs do not
display the error, and will eventually need similar modifications to inline.
I should probably factor out a pagespec_match_all function and make it throw
ErrorReasons.
2009-04-23 14:07:28 -04:00
Joey Hess 2c74f09bb8 relativedate: Deal with clock skew.
If the server has a clock running a bit ahead of the web browsing client,
relativedate could cause somewhat confusing displays like "3 seconds from now"
for just posted things.

As a hack, avoid displaying times in the future if they're less than a
small slip forward. I chose 30 minutes because both client and server could
be wrong in different directions, while it's still close enough that "just
now" is not horribly wrong.
2009-04-23 13:39:42 -04:00
Joey Hess 565e5291cd websetup: If setup fails, restore old setup file. 2009-04-22 14:05:37 -04:00
Joey Hess 55377e7336 blogspam: Load RPC::XML library in checkconfig, so that an error can be printed at that point if it's not available, allowing the admin to see it during wiki setup. Closes: #520015 2009-04-22 13:33:20 -04:00
Joey Hess 4fbe1c3d44 websetup: Display stderr in browser if ikiwiki setup fails. 2009-04-22 13:31:56 -04:00
Joey Hess 3177b3f76b Add python:Depends to control file. Closes: #525086 2009-04-21 21:46:01 -04:00
Joey Hess e88a110d62 releasing version 3.10 2009-04-18 22:51:25 -04:00
Joey Hess b6eccfd3d3 Add a microblog template that is useful for inlining microblogging posts. 2009-04-11 12:40:15 -04:00
Joey Hess a25d8f992b inline: Add author info to archive display.
This won't change it normally, and is useful if using archive
format to display some aggregated feed titles.
2009-04-10 21:49:43 -04:00
Joey Hess a6d3bad29d debian/control: Wrap fields. 2009-04-10 21:29:51 -04:00
Joey Hess 98ae0fb92c Add missing permalink support to archivepage and titlepage templates. 2009-04-10 18:02:03 -04:00
Joey Hess 760e100947 Merge branch 'darcs'
Conflicts:
	debian/changelog
2009-04-04 18:38:16 -04:00
Joey Hess 3fb4653d8a Add missing newline to Confirm Password prompt. 2009-04-04 18:25:52 -04:00
Joey Hess f7fa696619 move comments to copyright and changelog 2009-04-04 17:49:04 -04:00
Joey Hess 8a11983946 Fix git test suite to use a bare repo.
This works around an enormous (and, in this context, enormously confusing)
message that git has begun to print when one attempts to push changes into
a non-bare repo.

As a bonus, it now tests whether ikiwiki-makerepo works.
2009-04-04 14:58:34 -04:00
Joey Hess 6157c8697b clarify 2009-04-01 19:33:49 -04:00
Joey Hess 72b9482835 recentchanges: change to using do=goto links. 2009-04-01 19:18:43 -04:00
Joey Hess b1f9996078 Add missing suggests on libtext-textile-perl. Closes: #522039 2009-03-31 14:16:32 -04:00
Joey Hess 7bbe9cf94d Fix documentation of anonok_pagespec. Closes: #521793 2009-03-30 13:07:50 -04:00
Joey Hess 10822a22b3 comments: Fix anchor ids to be legal xhtml. Closes: #521339
Well, that was a PITA.

Luckily, this doesn't break guids to comments in rss feeds,
though it does change the links.

I haven't put in a warning about needing to rebuild to get
this fix. It's probably good enough for new comments to get the
fix, without a lot of mass rebuilding.
2009-03-26 16:45:53 -04:00