Commit Graph

2499 Commits (002a97ffcdf347b8ad97210ddb5badacd3fee712)

Author SHA1 Message Date
Will Uther 01e4cb1464 Add getsource plugin 2009-07-26 16:22:56 +01:00
harishcm 786b78be46 Fix failure to close <ul> in maps with no items
Signed-off-by: Simon McVittie <smcv@ http://smcv.pseudorandom.co.uk/>
2009-07-25 20:16:11 +01:00
Joey Hess 60ee03bd70 revert revert 2009-07-23 12:01:54 +02:00
Joey Hess a29507ec26 improve string to be less confusing 2009-07-23 11:52:33 +02:00
Joey Hess e01badd3e7 reverted a few of the string changes
Improved one string.
2009-07-23 11:48:02 +02:00
Jonas Smedegaard 3bdc366e73 Merge branch 'master' of git://git.ikiwiki.info 2009-07-23 01:17:40 +02:00
Jonas Smedegaard 27071f0ba9 Change rendering→building in translatable strings, to ease translations. 2009-07-23 00:53:23 +02:00
Jonas Smedegaard 28b572a61e Rephrase suggestion to not get confused as info on action already done. 2009-07-23 00:50:42 +02:00
Jonas Smedegaard 106b073ce1 Rephrase 'linked to by' confusing for translators. 2009-07-23 00:48:00 +02:00
Jonas Smedegaard 8b7389b426 Improve translatable texts to ease translation (e.g. to→into and from→inside) 2009-07-23 00:43:28 +02:00
Joey Hess 88d4fb15ba add --previous at bubulle's suggestion 2009-07-22 17:48:49 +02:00
Joey Hess c56ff6cd47 relocate po directory up a level 2009-07-21 13:16:26 +02:00
Joey Hess 637f32480c turn off pot file underlay again 2009-07-21 12:40:44 +02:00
Joey Hess cebffa917f improve invalid gettext message
(and gettext it as translators will see this!)
2009-07-21 12:39:21 +02:00
Joey Hess 1610b1e9e6 update 2009-07-21 12:38:40 +02:00
Joey Hess 7532eff2b7 update 2009-07-21 11:40:25 +02:00
Joey Hess eca2dbe67f po: Add support for mo files in underlays
In order to support translated basewiki and other underlays, we need
support for mo files in underlays.

The code did not allow this before, because if a mo file was in an
underlay, then it might try to update it, and its pot, and write to the
underlay, which is guaranteed to either fail due to permissions, or be
undesirable.

To fix, my approach is to just detect if a mo or pot file that is about to
be updated is in an underlay, and skip updating it. This seems to work
well:

- If the mo is out of date in the underlay, it won't get updated, but this
  would probably be due to a problem in the underlay, or more likely,
  the wiki is being rebuilt and so it *thinks* the mo is out of date,
  but it's really not (and it would be a waste of time to rebuild it
  anyway).
- If a page from the basewiki is edited, it is saved to the srcdir,
  which causes generation of an updated mo and pot also in the srcdir;
  the underlay stops being used for that page, and everything seems
  to work.

Note that I am not including an underlay search directory for pot files.
They *seem* to be unnecessary for the underlay, since the mo files
in there never need to be updated.
2009-07-21 11:31:51 +02:00
Joey Hess 4b1534d5bc fix example 2009-07-21 09:56:34 +02:00
Joey Hess e04692e059 po: Support running with a non-english master lang; add translated underlays
It seem to make sense to remove the check for there being slave languages
as part of this, since one might want a wiki that is only in non-English.
2009-07-20 07:19:05 +02:00
Joey Hess 9d9826a3d2 remove prototype from renamehook
Recursive calls make perl whine about protypes, and it wasn't
adding any value.
2009-07-20 07:11:22 +02:00
Joey Hess 741c33576e create translated underlays in mdwn format
These are for use by wikis where the primary language is not English.
On such a wiki, it makes sense to use an underlay has the source for pages
in the native language.
2009-07-20 06:23:33 +02:00
Joey Hess 4fb0e8720c s//bad//invalid// # jonas= 2009-07-19 20:13:57 +02:00
Joey Hess 126952bd33 avoid Po4a::Common exporting anything
It exports gettext and stuff by default, which conflicts with IkiWiki
exports.
2009-07-19 17:50:56 +02:00
Joey Hess 43e5c905cb shut up msgmerge 2009-07-19 16:54:03 +02:00
Joey Hess ea8c166a05 bugfix: Avoid generating po files for files that are not httmlizable 2009-07-19 13:46:10 +02:00
Joey Hess b23ddf6c4a improve error message 2009-07-19 13:36:46 +02:00
Joey Hess ec965fc92c Merge branch 'master' into po
Conflicts:
	debian/changelog
2009-07-19 12:36:01 +02:00
Simon McVittie acb79b5c00 pagestats: add `among` parameter, which only counts links from specified pages 2009-07-17 11:12:55 +01:00
Simon McVittie 2b0c8d167e pagestats: when making a tag cloud, don't emit links where the tag is unused 2009-07-17 11:12:45 +01:00
Joey Hess 42fcafa57d Merge commit 'e12b7f5e54730325c751a889ed2e08580b5ef6ba' 2009-07-11 15:52:51 -04:00
Joey Hess b1b7a2100f img: Pass the align parameter through to the generated img tag. 2009-07-11 00:33:19 -04:00
Simon McVittie e12b7f5e54 Move OpenID pretty-printing from openid plugin to core
On various sites I have two IkiWiki instances running from the same
repository: one accessible via http and only accepting openid logins,
and one accessible via authenticated https and only accepting httpauth.
The https version should still pretty-print OpenIDs seen in git history,
even though it does not itself accept OpenID logins.
2009-07-10 18:41:16 +01:00
Joey Hess 0c6a47e9e4 svn: Fix rcs_rename to properly scope call to dirname. 2009-07-08 13:13:23 -04:00
Joey Hess feae031a80 highlight: Fix utf-8 encoding bug. Closes: #535028 2009-07-07 16:31:18 -04:00
Simon McVittie ea4686a565 Update IkiWiki::openiduser to work with Net::OpenID 2.x
openiduser previously used a constructor that no longer works in 2.x.
However, all we actually want is the (undocumented) DisplayOfURL function
that is invoked by the display method, so try to use that.
(cherry picked from commit c3dd0ff5c7c10743107f203a5b456fdcd1b171df)
2009-07-07 13:38:04 -04:00
Joey Hess 2db6946037 typo 2009-07-01 13:45:28 -04:00
Simon McVittie a648c439f3 img plugin: do not emit a redundant double-quote before alt attribute 2009-06-16 17:15:06 +01:00
Simon McVittie e877013174 inline: add pagenames parameter
If given instead of pages, this is interpreted as a space-separated
list of links to pages (with the same LinkingRules as in a WikiLink),
and they are inlined in exactly the order given. The sort and pages
parameters cannot be used in conjunction with this one.
2009-06-16 17:13:19 +01:00
Joey Hess 9151346687 aggregate: Avoid resetting ctime when an item md5 changes.
Besides being wrong to do, this could lead to the wrong item
being expired, as follows: If B is added and at the same time
A is changed, then A's ctime may be set to the current time,
while B's is set to its creation time. Thus the new item, A,
is incorrectly removed as older.

(This interacted especially badly with the bug fixed by
90b4d079605b72bb50d1da41402d994960e10937.)
2009-06-12 19:31:23 -04:00
Joey Hess 90b4d07960 aggregate: Fix storing of changed md5.
The aggregate state merge code neglected to merge changes to the md5
field of an item. Therefore, if an item's md5 changed after initial
aggregation, it would be updated, and rewritten, each time thereafter.
This was wasteful and indirectly led to some expire problems.
2009-06-12 19:24:47 -04:00
Joey Hess 48a5f9f2d8 Disable the Preferences link if no plugin with an auth hook is enabled. 2009-06-09 15:39:00 -04:00
Joey Hess bf55a7fbb1 meta: Add openid delegate parameter to allow delegating only openid or openid2. 2009-06-08 21:40:06 -04:00
intrigeri 86edd73d16 Merge commit 'upstream/master' into pub/po
Conflicts:

	debian/changelog
	debian/control

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-06-06 14:03:40 +02: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 059d6f01fa fix further places where translated discussion case was assumed
Another benefit is that consistently using gettext("Discussion")
eliminates the need to translate one string.
2009-06-04 13:20:52 -04:00
intrigeri 091f11be76 po: better discussion link logic
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-06-03 18:30:00 +02: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 96087cbd88 call initLanguage after initTheme
See #530654
2009-05-26 17:04:49 -04:00
Joey Hess 39e5e25000 cache highlighters to optimise
Setting up a new highlighter object is slightly expensive since it
reads and parses the langfile each time. So cache them.

This also speeds up ext2langfile by avoiding it needing to check for the
existence of a language file in some cases.
2009-05-23 18:39:49 -04:00
Joey Hess 8ba98ad1dc update 2009-05-23 05:33:08 -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 cdd1b58b38 remove commas in tohighlight list 2009-05-23 00:09:14 -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 27193a2eeb support longname for page types in commands and rename
Also, sort the list of page types.
2009-05-21 15:50:25 -04:00
Joey Hess ef003f48f4 Merge branch 'master' into po
Conflicts:
	debian/changelog
2009-05-19 13:07:47 -04:00
Joey Hess 53b1c6f559 Merge commit 'intrigeri/po' into po 2009-05-19 13:06:35 -04:00
Jon Dowland eba9b862b2 tidy up new page_types code 2009-05-16 14:44:23 +01:00
Jon Dowland 83e3fc3af0 add a long name for textile/txtl ("Textile") 2009-05-16 13:59:36 +01:00
Jon Dowland 79510950f0 add a long name for mdwn ("Markdown") 2009-05-16 13:59:27 +01:00
Jon Dowland 30248df40a check for longname for each syntax plugin
We build an array of [ plugin name, long name ] pairs, where long name
is an optional argument to hook(). So, a syntax plugin could define
long "friendly" name, such as "Markdown" instead of mdwn, and we would
then pass this array to formbuilder to populate the drop-down on the
edit page.
2009-05-16 13:56:25 +01:00
Joey Hess 838955aba4 remove pagespec_match_list override for external
Not needed since it returns a list of pages, not a fail/success object.
2009-05-06 13:13:01 -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 528f8f83ea simplifiy 2009-04-23 16:40:45 -04:00
Joey Hess 85ae48b21e Revert "pagespec_match_list * optimisation"
This reverts commit 2f96c49bd1.

I forgot about internal pages. We don't want * matching them!

I left the optimisation in pagecount, where it used to live.
Internal pages probably don't matter when they're just being
counted.
2009-04-23 16:35:56 -04:00
Joey Hess 4030f75765 avoid using pagespec_match_list here
I forgot to check if it was called from preprocess, and it is
not; it's called by a format hook. If an error is thrown from
a format hook, wiki build fails, so we don't want that.
2009-04-23 16:26:54 -04:00
Joey Hess 14d8df55ad simplify 2009-04-23 16:23:52 -04:00
Joey Hess 2f96c49bd1 pagespec_match_list * optimisation
Add an optimisation for the semi-common case of a "*" pagespec. Can
avoid doing any real processing in this case.
2009-04-23 16:20:18 -04:00
Joey Hess 860a867078 formatting 2009-04-23 16:14:35 -04:00
Joey Hess e3ccf393c6 typo 2009-04-23 16:13:40 -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 338d4ccff1 fix id 2009-04-22 15:38:50 -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
intrigeri 4558457402 Merge commit 'upstream/master' into pub/po
Conflicts:

	debian/changelog
	debian/control
2009-04-20 12:21:18 +02:00
intrigeri 9db2438b3a po: remove unneeded check on link plugin
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-04-20 11:38:15 +02:00
Joey Hess 4cf70291bc remove unnecessary variable 2009-04-04 19:04:02 -04:00
Joey Hess f8fa69326a remove debugging 2009-04-04 18:48:33 -04:00
Joey Hess 6a7eb63ca5 fix display of web commits in recentchanges
The darcs backend appends @web to the names of web committers, so remove it
when extracting.
2009-04-04 18:36:39 -04:00
Joey Hess 01b063d2e2 fix bug I introduced 2009-04-04 18:30:29 -04:00
Joey Hess f7fa696619 move comments to copyright and changelog 2009-04-04 17:49:04 -04:00
Joey Hess bbd61b346b formatting, layout, indentation, coding style 2009-04-04 17:45:13 -04:00
Joey Hess 8e92468eae Merge branch 'master'
Conflicts:
	doc/ikiwiki-makerepo.mdwn
2009-04-04 17:27:48 -04:00
Joey Hess 72b9482835 recentchanges: change to using do=goto links. 2009-04-01 19:18:43 -04:00
Joey Hess e827247a86 wrapping 2009-03-29 15:48:26 -04:00
Joey Hess 4e9db780d5 whitespace 2009-03-29 14:52:29 -04:00
Joey Hess c84b4cefcc minor code changes 2009-03-29 14:31:32 -04:00
Joey Hess 0b2791ccc7 no need to use CORE::rename since I renamed the rename function 2009-03-27 15:28:35 -04:00
Joey Hess d622da057b rename function for clarity, formatting improvements 2009-03-27 15:27:38 -04:00
Joey Hess 529a06b7cc simplifiy 2009-03-27 15:23:36 -04:00
Joey Hess f9fd71df88 move dedup code into function, simplify 2009-03-27 15:21:21 -04:00
Joey Hess 825e2b1378 Merge branch 'master' into po
Conflicts:
	debian/control
2009-03-27 15:09:41 -04:00
Joey Hess 260ee2a283 use md5sum for page_to_id
The munged ids were looking pretty nasty, and were not completly guaranteed
to be unique. So a md5sum seems like a better approach. (Would have used
sha1, but md5 is in perl core.)
2009-03-27 13:44:31 -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
Joey Hess 503d83ffbc comments: Fix too loose test for comments pages that matched normal pages with "comment_" in their name. Closes: #521322 2009-03-26 14:04:28 -04:00
Joey Hess a2c0423e54 fix rcs_getctime to return first, not last, change time
This was being buggy and returning the file's last change time, not its
creation time.

(I checked all the others (except tla) and they're ok.)
2009-03-20 16:32:37 -04:00
Joey Hess 2c86616a6a fix rcs_getctime to return first, not last, change time
This was being buggy and returning the file's last change time, not its
creation time.
2009-03-20 16:24:19 -04:00
Joey Hess a1c8520ce8 inline: Fix urls to feed when feedfile is used on an index page.
It would be better to use urlto() here, but will_render
has not yet been called on the feed files at this point, so
it won't work. (And reorganizing so it can be is tricky.)
2009-03-19 16:01:30 -04:00
Joey Hess bb258b56b2 avoid crashing if Sort::Naturally is not installed 2009-03-19 15:35:57 -04:00
chrysn 55b83cb7bd implement sort=title_natural for inline
adds a new sorting order, title_natural, that uses Sort::Naturally's
ncmp function to provide better sorting for inlines
2009-03-19 15:31:46 -04:00
Joey Hess 4ac0b29531 git: Manually decode git output from utf-8, avoids warning messages on invalidly encoded output. 2009-03-09 14:18:55 -04:00
Joey Hess 7bd0d53644 git: Fix utf-8 encoding of author names.
I guess what's happening here is that since the name
is passed to git via an environment variable, perl's normal
utf-8 IO layer stuff doesn't work. So we have to explicitly
decode the string from perl's internal representation into
utf-8.
2009-03-09 14:01:40 -04:00
Joey Hess 793e9332c3 avoid uninitialized value warnings 2009-03-09 13:52:51 -04:00
intrigeri f4a1732b0e Merge commit 'upstream/master' into prv/po 2009-03-09 00:32:10 +01:00
Joey Hess dd2fa2efb9 When loading a template in scan mode, let preprocess know it only needs to scan.
This makes wikis such as zack's much faster in the scan pass.
In that pass, when a template contains an inline, there is no reason to
process the entire inline and all its pages. I'd forgotten to pass
along the flag to let preprocess() know it was in scan mode, leading to
much unncessary churning.
2009-03-08 18:57:47 -04:00
Joey Hess d3b4c2dbd1 avoid potential infinite loop in smiley expansion
- In 3.05, ikiwiki began expanding templates in scan mode,
  for annoying, expensive, but ultimatly necessary reasons
  of correctness.
- Smiley processing has a bug: It inserts a span for the smiley,
  and then continues searching forward in the content for more,
  starting at $end_of_smiley+1. Which means it searches for smilies
  in the span too! And if it somehow finds one, we get an infinite loop
  here.
- This bug can, probably, only be tickled if a htmllink to
  show the smiley fails, because the smiley file doesn't exist,
  or because ikiwiki doesn't know about it. In that case,
  a link will be inserted to _create_ the missing page,
  and that link will include the smiley inside the <a></a>.
- When a template is expanded in scan mode, and it contains
  an inline, the sanitize hook is run during scan mode,
  which never happened before. That causes the smiley processor
  to run, before ikiwiki is, necessarily, aware that all
  the smiley files exist (depending on scan order). So
  it inserts creation links for them, and triggers the bug.

I've put in the simple fix of jumping forward past the inserted
span, and it does fix the problem. I will need to look in a bit
more detail into why an inline nested inside a template is
fully expanded during the scan pass -- that really shouldn't
be necessary, and it makes things much slower than they need
to be.
2009-03-08 18:49:34 -04:00
Joey Hess 1bf100cfde configure wmd to leave text in markdown 2009-03-08 13:11:26 -04:00
intrigeri 1efb182d56 rename: remove duplicates that hook functions may have added to @torename
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-03-08 15:47:50 +01:00
intrigeri 1bf21d2a37 rename: moved subpages addition to a rename hook
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-03-08 12:52:49 +01:00
intrigeri 8cfe428a28 rename hook: run once per file to be renamed
... as Joey suggested on todo/need_global_renamepage_hook

This hook is applied recursively to returned additional rename
hashes, so that it handles the case where two plugins use the hook:
plugin A would see when plugin B adds a new file to be renamed.

The full set of rename hashes can no longer be changed by hook functions, that
are only allowed to return any additional rename hashes it wants to add.
Rationale: the correct behavior of the recursion would be hard, if not
impossible, to define, if already considered pages were changing on the run.

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-03-08 11:44:00 +01:00
intrigeri ae474d8e14 Merge commit 'upstream/master' into prv/po
Conflicts:

	IkiWiki/Plugin/editpage.pm
	debian/control
	debian/copyright
	doc/todo/need_global_renamepage_hook.mdwn

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-03-08 09:50:27 +01:00
Joey Hess 9a82ef32b9 look for wmd/wmd.js
This means that the underlay needs to have a wmd/wmd/wmd.js,
which is a trifle weird, but it isolates all the wmd stuff in a
single wmd subdirectory of the built wiki. The wmd/images creating
a toplevel images directory was particularly bad.
2009-03-07 19:23:38 -05:00
Joey Hess 72dd9a9a04 make wmd comment support comment editing (I think) 2009-03-07 18:54:26 -05:00
Joey Hess 029cf94493 rebuild not needed
This plugin only affects the page edit, not the compiled wiki.
2009-03-07 14:34:31 -05:00
Joey Hess e7d2da5641 wmd plugin from willu 2009-03-07 14:33:11 -05:00
Joey Hess affd4ca3da goto: Fix typo that broke recentchanges_link compatability. 2009-02-27 13:21:29 -05:00
Joey Hess 596b2906fd bzr: Add missing rcs_diff. (liw) 2009-02-26 14:09:26 -05:00
Joey Hess b30c1b0c38 comments: Avoid showing comment moderation button in prefs to non-admins. 2009-02-26 02:31:13 -05:00
Joey Hess 63439fa10b bzr: Add missing stub rcs_diff. 2009-02-25 16:56:02 -05:00
Joey Hess f813b10fef rename tag() to tagged(); add docs 2009-02-19 18:54:25 -05:00
Joey Hess e611d4cdc1 add tag() pagespec
patch from jon
2009-02-19 18:49:30 -05:00
Joey Hess 5f96944dd5 typo 2009-02-17 19:37:36 -05:00
Joey Hess 52f2235e60 goto: Fix redirect to comments. 2009-02-17 19:36:58 -05:00
Joey Hess 9acc4d578d template: Load templates in scan mode
This is potentially expensive, but is necessary so that meta and tag
directives, and other links on templates affect the page using the template
reliably.
2009-02-17 13:30:07 -05:00
Joey Hess a4497591f9 Revert "comments" (stupid commit)
This reverts commit bb8b8787ef.
2009-02-17 13:29:08 -05:00
Joey Hess bb8b8787ef comments 2009-02-17 13:25:06 -05:00
Joey Hess adcc349d89 check for empty srcdir
This happens when using -dumpsetup
2009-02-14 03:04:11 -05:00
Joey Hess 684cd73a79 downgrade missing shortcuts page error to warning
and response to bug report
2009-02-14 03:01:35 -05:00
Joey Hess 2c51b18aec move check_canedit, check_content to IkiWiki library from editpage
It no longer makes sense to keep these functions in editpage, because
serveral plugins now exist that use them, and users may want to disable
editpage, while leaving those plugins enabled.

Most notably, comments uses both functions, and it's entirely appropriate
to disable editpage but still want to have comments enabled.

Less likely, attachments, rename, and remove all use check_canedit -- but
it would be unusual indeed to want to use these w/o editpage.
2009-02-12 16:33:35 -05:00
Joey Hess 46819b530b shortcut: If default_pageext is set, first look for shortcuts.default_pageext
Falls back to looking for shortcuts.mdwn for backwards compatabiity; there
probably exist wikis that have changed the pageext but still use
shortcuts.mdwn.
2009-02-12 13:04:20 -05:00
Joey Hess 5e2e95a516 doubled semicolons 2009-02-11 12:30:28 -05:00
Simon McVittie dd862b4639 Work around XML::Atom strangeness that results in double-encoded posts
See [[bugs/Aggregated_Atom_feeds_are_double-encoded]]. By default,
XML::Atom outputs strings of UTF-8 bytes with the Perl UTF8 flag stripped
off, which IkiWiki assumes to be Latin-1 and re-encodes as UTF-8 on
output. XML::Feed  does not currently (0.41-1) set the magic variable to
change this behaviour (I've filed a bug on CPAN), but IkiWiki can
usefully set the same variable as a workaround.
2009-02-03 19:48:55 +00:00
Joey Hess 3b83e52018 rename apache404 -> 404
This may already work with other web servers that have copied apache's
interface, and it should be easy to add support to it for web servers that
use some other interface. So, make the name more general.
2009-01-31 19:26:36 -05:00
Joey Hess b0361b8efd factor out IE stupididy workaround 2009-01-31 19:02:50 -05:00
Simon McVittie c886bea320 Split cgi_goto into a goto plugin 2009-01-31 23:01:10 +00:00
Simon McVittie 46b880f839 Split apache404 into an independent plugin
Also make it ignore the 'do' parameter at Joey's suggestion, to have one
less thing to remember when configuring.
2009-01-31 22:32:10 +00:00
Simon McVittie a981d6857f recentchanges: delete CGI hook in favour of the global one 2009-01-31 14:49:25 +00:00
Simon McVittie 4e92548ebc comments: delete cgi hook in favour of the global one 2009-01-31 14:49:12 +00:00
intrigeri ea753782b2 po: remove all dependencies on nicepagetitle
... as my meta branch probably won't be merged before the po plugin is, contrary
to what I was originally supposing.

This implies removing the po_translation_status_in_links and
po_strictly_refresh_backlinks options.

Added a note to the TODO section to think of bringing these features back later,
as they really enhance user experience on a translatable wiki.

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-27 17:52:32 +01:00
intrigeri 51badc960d rename hook: instead of modifying the passed-by-name array, return a copy
This is intended to solve Joey's concerns expressed on
http://ikiwiki.info/todo/need_global_renamepage_hook/, i.e. the need to make it
possible to use this hook from external plugins.

A plugin using this hook still can add/modify/remove elements of the
@torename array.

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-27 17:08:55 +01:00
Joey Hess 5dd67723c1 typo 2009-01-26 20:33:55 -05:00
Joey Hess 5c14c7db61 Merge commit 'smcv/underlay' 2009-01-26 20:13:15 -05:00
Joey Hess 848ff1bf5e Merge commit 'smcv/updated' 2009-01-26 20:05:36 -05:00
Joey Hess d2a7768182 hook function names should be the same as the hook name 2009-01-26 19:13:15 -05:00
intrigeri ca9e45c3ba po: make the "backlinks involve dependencies" feature optional
It can now be configured with the po_strictly_refresh_backlinks setting.

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-27 00:25:46 +01:00
intrigeri 03ab262319 revert renamepage's hook original name
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-27 00:00:00 +01:00
intrigeri 8915d2553c po: bring back a useful use of scalar
... that was removed in 68869d664b

Without this scalar, a two-cells array is passed to $template->param, which
builds a hash with an odd number of elements.

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-26 23:21:14 +01:00
intrigeri 78a095aa42 only pass named parameters to the canremove hook
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-26 23:07:19 +01:00
intrigeri f02672c113 only pass named parameters to the canrename hook
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-26 23:02:31 +01:00
intrigeri e0e94d4716 po(formbuilder): stop hunting down non-existent cases
After some thinking about it, I can't find why the type of a page being created
in the CGI could be restricted to po. So the previous case seems enough.

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-26 22:54:40 +01:00
Joey Hess cf374e97cf add mising hooks and fix syntax error 2009-01-26 14:00:28 -05:00
Joey Hess 73f0011836 remove unnecessary returns
check_canremove/canrename is called only for its side effect (of failing if
removal is not allowed), its return value is never used and returning
something makes that unclear
2009-01-26 13:55:32 -05:00
Joey Hess 9750f929ad remove redundant use
use is file-scoped so warnings and strict are already enabled
inside the second package, and IkiWiki is already loaded
(though not imported into this context)
2009-01-26 13:35:50 -05:00
Joey Hess 9e3dc0af60 non-code changes 2009-01-26 13:33:02 -05:00
Joey Hess aff9bf5a7a more unnecessary parens 2009-01-26 13:28:57 -05:00
Joey Hess 093f8534f1 avoid keeping running if a DOS attack is possible 2009-01-26 13:25:05 -05:00
Joey Hess 98f0d672df remove unnecessary parens 2009-01-26 13:24:33 -05:00
Joey Hess c5642119f7 another useless use of scalar
scalar(undef) is undef, so using scalar here had no effect.
Instead make the function return "", probably avoiding an uninitialized
value warning.
2009-01-26 13:21:33 -05:00
Joey Hess 68869d664b remove useless uses of scalar
if (scalar @array) is written idiomatically in perl as
if (@array).
2009-01-26 13:20:56 -05:00
Joey Hess 526d9dbe10 improve some english
I'm still not happy with the clarity of this warning message.
I don't understand when it could happen or why a warning is needed.
2009-01-26 13:15:29 -05:00
Joey Hess 8e738066bc avoid standalone -e or foo syntax
I prefer to use either of the other two syntaxes perl offers, and not this
one.
2009-01-26 13:10:37 -05:00
Joey Hess 66bc27b485 avoid mixing english with translation
"google search" is english which would get mixed in with translated text.
Instead, usr just the plugin name.
2009-01-26 13:08:25 -05:00
Joey Hess 12eb056b33 Merge branch 'master' into po 2009-01-26 13:05:38 -05:00
Joey Hess ce39f8e000 git: Fix malformed utf8 recieved from git.
If git log outputs malformed utf8 in, eg, usernames, detect it and fix it
up. This avoids commits such as f71abc92aa
breaking things.
2009-01-25 23:13:14 -05:00
Joey Hess 42b3e13739 format moderation queue only at end, avoid O(N^3) bug
It was calling format hooks for each comment on the page.
When relativedate is enabled, that made it insert <script> tags
for each comment. And the browser loaded the same script over and over,
which was slow on its own. But that was nothing compared to running
the onload even over and over.. especially since the hook system
added a new call to the hook each time it loaded.

For a page with 10 comments, that caused the relativedate DOM parsing
code to run 1000 times, I think. Anyway, it was sloow. Now it runs once.
2009-01-25 22:30:28 -05:00
Joey Hess 9d4f396b13 add reject all marked defer checkbox 2009-01-25 22:25:45 -05:00
Joey Hess 4e21af7671 sort comment queue by time, newest first 2009-01-25 19:45:56 -05:00
Joey Hess 7a7e28c55f add a button to prefs page for comment moderation 2009-01-25 19:04:45 -05:00
Joey Hess 9a5085e512 clean up comment preview
Remove actions from it, and avoid a broken title link.
2009-01-25 18:56:47 -05:00
Joey Hess 731fc9e7a2 comments: Add a moderation web interface. 2009-01-25 18:49:57 -05:00
Joey Hess c154fa5d6c comments: If comment content checks fail, store the comment (in .ikiwiki/comments_pending) for moderator review. 2009-01-25 15:42:13 -05:00
Joey Hess ee74e61ffc blogspam: Fix use of blogspam_options and blogspam_server config settings. 2009-01-25 14:37:04 -05:00
Joey Hess ef856a5f7a typo 2009-01-22 21:10:05 -05:00
Joey Hess e1ff06b634 fix uninitialized value warnings
I suspect these are only triggered by spammers.
2009-01-22 20:58:49 -05:00
Joey Hess 6fb0ab580e fix typo 2009-01-22 20:53:47 -05:00
Gabriel McManus 950137eb6c img: only provide alt text if it was specified
if suitable alternate text is unknown, then it should not be given.
empty alt text is suitable mainly for purely decorative images.
(cherry picked from commit 3cd7f67f0cf894f4fd5ba16f68e82e4f7bdbfdc5)
2009-01-21 21:17:57 -05:00
Joey Hess 3547a2a347 fix removal form display
The form was misdisplayed when displayed via comment removal.
2009-01-20 11:12:49 -05:00
Joey Hess 8360e96a86 blogspam: Log spam info on failure. 2009-01-19 14:11:15 -05:00
intrigeri f8c306a21b remove cansave plugin, now replaced by Joey's checkcontent one
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-19 19:53:32 +01:00
intrigeri a3726968bc make checkcontent compatible with hooks that need the full content
Always pass the full (modified) content in `content` named parameter. When the
user edits an existing wiki page, also pass a `diff` named parameter, which
includes only the lines that they added to the page, or modified.

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-19 19:44:39 +01:00
Simon McVittie c89925048f Add meta field "updated", which can alter the <updated> Atom element
Some aggregators, like Planet, sort by mtime rather than ctime. This
means that posts with modified content come to the top (which seems odd
to me, but is presumably what the aggregator's author or operator
wants), but it also means that posts with insignificant edits (like
adding tags) come to the top too. Atom defines <updated> to be the date
of the last *significant* change, so it's fine that ikiwiki defaults to
using the mtime, but it would be good to have a way for the author to
say "that edit was insignificant, don't use that mtime".
2009-01-18 21:58:24 +00:00
Simon McVittie b7cd40c1bb Add underlay plugin 2009-01-18 16:42:12 +00:00
intrigeri 73a7bd2f68 fix previous buggy merge 2009-01-18 00:45:46 +01:00
intrigeri e9e75f5f29 Merge commit 'upstream/master' into prv/po
Conflicts:

	t/syntax.t
2009-01-18 00:38:31 +01:00
Joey Hess 6b681ed299 blogspam api now supports homepage link 2009-01-17 15:39:08 -05:00
Joey Hess cd2ddb57a5 load rpc xml lib on the fly
This way, enabling the plugin via websetup is safe, it can't leave
ikiwiki in a broken state.
2009-01-17 14:56:48 -05:00
Joey Hess 4bede22e4f use short names in comittype
Use mtn for monontone and hg for mercurial. The long names cause ugly
formatting in recentchanges, which has CSS that only allows a few
characters for the commit type column.
2009-01-17 13:39:53 -05:00
intrigeri 832d4d31d1 Merge commit 'upstream/master' into prv/po
Conflicts:

	IkiWiki/Plugin/editpage.pm
	IkiWiki/Plugin/skeleton.pm.example
	doc/plugins/write.mdwn
	t/syntax.t
2009-01-17 14:01:53 +01:00
Joey Hess 7ee92cab40 blogspam: New plugin, adding spam filtering for page editing / comment posting using the BlogSpam.net API. 2009-01-16 22:39:11 -05:00
Joey Hess 16c56af605 make postcomment() pagespecs work while in checkcontent 2009-01-16 21:58:05 -05:00
Joey Hess ae20879e84 add new hook to skeleton 2009-01-16 21:07:40 -05:00
Joey Hess f7b2cfcf50 checkcontent: New hook, can be used to implement arbitrary content filters, including spam filters. 2009-01-16 20:46:55 -05:00
Joey Hess 362a329556 remove xxx comment
IIRC I analised this and the code is right
2009-01-16 19:34:50 -05:00
intrigeri df82b5e62a po: when possible, disable use of Text::WrapI18N in po4a; else warn about too old po4a
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-16 15:07:05 +01:00
intrigeri 523718b181 po(change): re-render all rendered files in one corner case
All meta titles are first extracted at scan time, i.e. before we turn
PO files back into translated markdown; escaping of double-quotes in
PO files breaks the meta plugin's parsing enough to save ugly titles
to %pagestate at this time.

Then, at render time, every page's passes on row through the Great
Rendering Chain (filter->preprocess->linkify->htmlize), and the meta
plugin's preprocess hook is this time in a position to correctly
extract the titles from slave pages.

This is, unfortunately, too late: if the page A, linking to the page B,
is rendered before B, it will display the wrongly-extracted meta title
as the link text to B.

On the one hand, such a corner case only happens on rebuild: on
refresh, every rendered page is fixed to contain correct meta titles.
On the other hand, it can take some time to get every page fixed.
We therefore re-render every rendered page after a rebuild to fix them
at once. As this more or less doubles the time needed to rebuild the
wiki, we do so only when really needed.

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-16 01:33:07 +01:00
intrigeri 3ba976d1d3 po: pages in underlay dirs are not translatable
Fixes build break due to read-only underlay dirs, e.g. basewiki.

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-15 23:04:57 +01:00
intrigeri 9abda92324 po(_istranslation): fix unitialized value
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-15 22:45:45 +01:00
intrigeri 5c59ad63df po: fix broken links from slave pages
... by overriding cgiurl.

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-15 21:49:32 +01:00
intrigeri 196f03a987 po: do not add translation status to parentlinks
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-13 13:03:30 +01:00
intrigeri 82197bd0ea Merge commit 'upstream/master' into prv/po 2009-01-13 12:26:43 +01:00
Joey Hess 85dcc2958a pinger: Get whole url, don't just head.
Asking for only the head worked in my tests, but I've found a site where it
didn't -- apparently ikiwiki didn't get a chance to do or finish the
refresh when HEADed. Getting the whole url, waiting for ikiwiki to finish,
avoided the update problem.
2009-01-11 14:27:27 -05:00
Joey Hess 7a8ea68fc0 Consistently allow use of relative paths in all PageSpecs that take a page name parameter. Previously, match_created_before(), match_created_after(), match_sourcepage(), and match_destpage() did not support that, and the docs were not clear. 2009-01-10 14:36:03 -05:00
Simon McVittie 79676ca445 comments: if the remove plugin is enabled, append a "Remove comment" link 2009-01-10 11:31:24 +00:00
Simon McVittie d70b05971f comments: only try to insert commentuser etc. into templates if the page contained [[!_comment]] 2009-01-10 11:29:56 +00:00
Joey Hess 81b088866b repolist: New plugin to support the rel=vcs-* microformat.
* repolist: New plugin to support the rel=vcs-* microformat.
* goodstuff: Include repolist by default. (But it does nothing until
  configured with the repository locations.)
2009-01-07 16:07:46 -05:00
Joey Hess e1e1d37753 increment interface version 2009-01-07 15:01:43 -05:00
Joey Hess 551544663d comments: Fix cache avoidance hack.
The ?updated needs to come before the #anchor or browsers will not follow
the anchor.
2009-01-07 11:12:32 -05:00
Joey Hess 72ca231fd0 rename: Show full names of affected pages. 2009-01-06 17:29:12 -05:00
Joey Hess e4b7f6badf refactor 2009-01-06 17:28:26 -05:00
Joey Hess 4ce73f2d88 table: Find links in external files in scan pass. 2009-01-06 15:36:32 -05:00
Joey Hess e45f13c2a4 typo 2009-01-06 15:26:46 -05:00
Joey Hess da166e7422 table: Fix misparsed links in external files
linkify data from external files at the same time as data from an inlined
table would be linkified.
2009-01-06 15:05:09 -05:00
Joey Hess bc0de40c3c A recent change to gitweb removed support for the form of diffurl that many ikiwiki setups use. Document how to use the new url form. 2009-01-05 18:26:09 -05:00
intrigeri 4fd2807886 po(isvalidpo): more meaningful error message
... explaining how to go on with edit.

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-02 18:57:50 +01:00
intrigeri 4ad871810d po: back to the cansave hook, as the form validation is not sufficient
Form validation works, but after trying to save invalid PO content, the user is
brought back to the page he/she was editing, without any single clue to explain
why it was not saved. The dedicated cansave hook is thus necessary.

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-02 18:51:32 +01:00
intrigeri 7ef0c19cdf po: first attempt to replace cansave hook with form validate tweaks
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-02 17:51:17 +01:00
intrigeri 33f9eeb4fb po/i18n: move the function names out of the translatable strings
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-02 17:24:54 +01:00
intrigeri da26603e07 po: updated copyright years
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-02 16:54:03 +01:00
intrigeri fae3cef41a po(formbuilder_setup): remove the rename/remove buttons on slave pages
This has to be done after the rename/remove plugins have added
their buttons, so we set this hook to be run last.

The canrename/canremove hooks already ensure this is forbidden
at the backend level, so this is only UI sugar.

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-02 16:02:25 +01:00
intrigeri e5222db332 po: avoid warnings and possible bugs with nested named subroutines
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-02 15:14:58 +01:00
intrigeri 14a79751e3 po: gettext-ize error messages
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-02 15:00:34 +01:00
intrigeri 724dbabc4a po: do not allow to create pages of type po
The main reason to do so is to bypass the "favor the type of linking page on
page creation" logic, which is unsuitable when a broken link is clicked on
a slave (PO) page.

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-02 14:09:34 +01:00
intrigeri d1642e4cd9 po: cosmetic changes to percent translated display
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-02 12:36:07 +01:00
intrigeri f58cb48f1f po(formbuilder_setup): use a template to display the warning
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-02 12:27:10 +01:00
intrigeri 0f89ef0579 po: test formbuilder_setup hook to warn about new master page's language
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-02 12:15:21 +01:00
intrigeri 876808568e po: require ikiwiki plugin interface 3.0
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-02 11:22:54 +01:00
intrigeri 949c4c0c3a po: send msgfmt output to /dev/null, else it creates messages.mo files
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 23:33:16 +01:00
intrigeri d0c9c21687 po: fix error messages
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 23:32:52 +01:00
intrigeri c821cee108 po(cansave): check PO validity using new isvalidpo function
... because Po4a's parser does not care about malformed PO data.
Use gettext's msgfmt program instead.

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 23:12:08 +01:00
intrigeri a5de24ec97 skeleton plugin: added the canrename and canremove hooks
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 22:20:54 +01:00
intrigeri 1d3da099b4 po(cansave): use po_to_markup to check PO validity
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 22:16:43 +01:00
intrigeri 5ebb42494d po: move most of filter code to its own function
Allow this new po_to_markup function to run in non-fatal mode,
we need this in our cansave hook.

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 22:16:07 +01:00
intrigeri 41eca80e25 po: register a (dummy) cansave hook
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 19:48:48 +01:00
intrigeri d69fdf6445 editpage: added a cansave hook
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 19:48:27 +01:00
intrigeri e895157397 Pass src, srcfile, dest and destfile to the canrename hook.
This is not needed by the use I'm doing of it, but seems more consistent to me.
Future users of this hook may need this data to make their mind.

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 18:04:37 +01:00
intrigeri 131d2d4e7c po: bugfix
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 17:56:51 +01:00
intrigeri 80a630a3fb po: fix canrename hook
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 17:49:10 +01:00
intrigeri a8105f6859 rename: pass the CGI and session to the rename hook
The po plugin remame + canrename hook combination will need this.

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 17:47:20 +01:00
intrigeri b24f236dfa po: use the new canrename hook to prevent translation renames in the CGI
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 16:52:43 +01:00
intrigeri 3316f9cc73 rename: implemented new canrename hook
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 16:52:34 +01:00
intrigeri 741b26aa17 remove: implemented a new canremove hook; use it in the po plugin
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 16:44:39 +01:00
intrigeri 5c2f6cb893 Merge commit 'upstream/master' into prv/po 2009-01-01 13:34:00 +01:00
intrigeri 5412a95fd0 po(myurlto): more robust run_by_editpage logic
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 01:14:06 +01:00
intrigeri 37b8822762 po: some code/comments refactoring
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 01:08:40 +01:00
intrigeri 856de5734d po: follow new coding style (removed Vim folding markers
)
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 01:08:35 +01:00
intrigeri 85f865b5d9 po: added postscan hook, to make pages depend on the pages linking to them
... so that nicepagetitle hook's effects, such as translation status displayed
in links, are updated when the linked page changes.

The replacement of 'my %backlinks' with 'our %backlinks' in Render.pm made this
work: previously, every postscan hook was called with an almost empty
%backlinks, which defeated all my attempts to implement this feature.

This feature hits performance a bit. Its cost was quite small in my real-world
use-cases (a few percents bigger refresh time), but could be bigger in worst
cases. Time will tell.

NB: this hack could also be used by my meta branch. It may even be a ikiwiki
optional feature.

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 01:08:10 +01:00
intrigeri 885e4b607a po: new po_translation_status_in_links option
... to make configurable the last implemented feature.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-12-31 16:45:55 +01:00
intrigeri be092e5639 po(nicepagetitle): forgot to display %
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-12-31 16:34:08 +01:00
intrigeri 63c2bf57cb po(percenttranslated): fix issue with leading /
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-12-31 16:31:18 +01:00
intrigeri 0d874f0b69 po(nicepagetitle): append translation status to links to translated pages
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-12-31 15:45:05 +01:00
intrigeri 805e16ec65 po: inject our own (currently a no-op) nicepagetitle function
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-12-31 15:40:32 +01:00
intrigeri 149a3e65a7 po: fix redirect after edit, using a somehow tricky hack
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-12-31 13:02:48 +01:00
intrigeri bd10381103 po: delete translations of deleted master pages
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-12-31 11:47:18 +01:00
Joey Hess 3e8b7a6b19 websetup: Avoid a crash when a new array setup item has been added in a new ikiwiki release, and is thus not present in the setup file yet.
This happened with camelcase_ignore. The code tried to convert the undef
value for it into an array.
2008-12-31 00:44:54 -05:00
Joey Hess 0daa4eb521 make sure value is defined before using it as an array 2008-12-31 00:08:46 -05:00
intrigeri cd62acfb47 po: remove debug statements 2008-12-30 23:10:12 +01:00
intrigeri f586eafe90 po: remove renamed pages special handling, not needed anymore
Thanks to the new rename hook behaviour, the whole renaming work is now done
by the rename plugin, and we don't need to remember which pages were renamed.
2008-12-30 23:00:46 +01:00
intrigeri 5738f30a29 the rename hook can now change the list of pages to rename
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-12-30 22:55:04 +01:00
intrigeri c01485ae1a renamed the renamepage hook to renamelink, added rename hook
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-12-30 21:36:40 +01:00
intrigeri 21add7ffa8 Merge commit 'upstream/master' into prv/po
Conflicts:

	debian/control
	debian/copyright
	doc/ikiwiki/pagespec.mdwn

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-12-30 18:24:36 +01:00
Joey Hess f34dc3d8bd htmlbalance: Demand-load HTML::TreeBuilder to avoid failing test suite if it is not present. 2008-12-29 15:08:18 -05:00
Joey Hess 0711c0c548 comments: Add cache avoidance.
This got lost when we added the jump-to-comment anchor.
2008-12-28 22:20:22 -05:00
Joey Hess ec14786c90 releasing version 2.72 2008-12-28 15:05:05 -05:00
Joey Hess 25879952b1 typo 2008-12-26 21:45:12 -05:00
Joey Hess c4f3d0554a Merge branch 'master' into next 2008-12-26 16:11:13 -05:00
Joey Hess 7da319efc6 inline: Run format hook first
inline has a format hook that is an optimisation hack. Until this hook
runs, the inlined content is not present on the page. This can prevent
other format hooks, that process that content, from acting on inlined
content. In bug ##509710, we discovered this happened commonly for the
embed plugin, but it could in theory happen for many other plugins (color,
cutpaste, etc) that use format to fill in special html after sanitization.

The ordering was essentially random (hash key order). That's kinda a good
thing, because hooks should be independent of other hooks and able to run
in any order. But for things like inline, that just doesn't work.

To fix the immediate problem, let's make hooks able to be registered as
running "first". There was already the ability to make them run "last".

Now, this simple first/middle/last ordering is obviously not going to work
if a lot of things need to run first, or last, since then we'll be back to
being unable to specify ordering inside those sets. But before worrying about
that too much, and considering dependency ordering, etc, observe how few
plugins use last ordering: Exactly one needs it. And, so far, exactly one
needs first ordering. So for now, KISS.

Another implementation note: I could have sorted the plugins with
first/last/middle as the primary key, and plugin name secondary, to get a
guaranteed stable order. Instead, I chose to preserve hash order. Two
opposing things pulled me toward that decision:

1. Since has order is randomish, it will ensure that no accidental
   ordering assumptions are made.
2. Assume for a minute that ordering matters a lot more than expected.
   Drastically changing the order a particular configuration uses could
   result in a lot of subtle bugs cropping up. (I hope this assumption is
   false, partly due to #1, but can't rule it out.)
2008-12-26 16:09:23 -05:00
Joey Hess 6f1539320b Merge branch 'master' into next 2008-12-26 14:07:25 -05:00
Joey Hess 9db06329c9 comments: Deal with users entering unqualified or partial urls.
People seem to be able to expect to enter www.foo.com and get away with it.
The resulting my.wiki/www.foo.com link was not ideal.

To fix it, use URI::Heuristic to expand such things into a real url. It
even looks up hostnames in the DNS if necessary.
2008-12-26 14:07:19 -05:00
Joey Hess 914c839ceb Merge branch 'master' into next
Conflicts:

	IkiWiki/Plugin/googlecalendar.pm
2008-12-25 16:36:16 -05:00
Joey Hess 0d406010ff googlecalendar: Add runtime deprecation warning. 2008-12-25 16:31:58 -05:00
Joey Hess 3fbe2569ff remove deprecated googlecalendar plugin 2008-12-24 16:22:35 -05:00
Joey Hess 7ba65e7f4b remove deprecated admin prefs
A new ikiwiki-transition moveprefs subcommand can pull the old data out of
the userdb and inject it into the setup file.

Note that it leaves the old values behind in the userdb too. I did this
because I didn't want to lose data if it fails writing the setup file for
some reason, and the old data in the userdb will only use a small amount of
space. Running the command multiple times will mostly not change anything.
2008-12-24 16:16:03 -05:00
Joey Hess c9e65fded1 camelcase: Add camelcase_ignore setting. 2008-12-23 19:11:03 -05:00
Joey Hess 678d467a40 finalise version 3.00 of the plugin api 2008-12-23 16:34:19 -05:00
Joey Hess 14a9e704c1 enable aggregate_internal by default 2008-12-23 16:08:21 -05:00
Simon McVittie 05bb65fc68 recentchanges_link CGI: If the linked page is internal, use its permalink
This fixes a bug, that comments appear in recentchanges as broken links.
2008-12-22 23:02:08 +00:00
Joey Hess 79d2d44db2 Merge commit 'smcv/openid' 2008-12-21 13:13:28 -05:00
Simon McVittie d0d598e429 comments: substitute commentsurl and atomcommentsurl for use in feeds 2008-12-21 17:15:49 +00:00
Simon McVittie 801dc76bf0 openid: in &openiduser, allow subdirectory-style providers to end with '/'
This improves the display of OpenIDs like 'http://id.mayfirst.org/jamie/'
(taking an example from the IkiWiki commit log).
2008-12-21 16:36:22 +00:00
Simon McVittie e0cd19f30b openid: in &openiduser, let domain-style providers have arbitrarily many subdomains
This leads to better display for OpenIDs like smcv.pseudorandom.co.uk
and thm.id.fedoraproject.org (to take a couple of examples from the
IkiWiki commit history).
2008-12-21 16:36:10 +00:00
Simon McVittie 95b3bbbf7c comments: run pagetemplate hooks
This fixes the bug that comments are always said to be from an anonymous
user at an unknown IP address.
2008-12-21 15:08:14 +00:00
Simon McVittie bc66a00b90 comments: linkify and preprocess preview with correct 'page' param 2008-12-21 15:07:36 +00:00
Joey Hess c84fcdd32a meta: Process meta date during scan pass so that the date will always affect sorting in inlines. 2008-12-21 01:52:08 -05:00
Joey Hess c53a3a1d3e avoid storing transient state in pagestate
None of the comment state needs to be stored through the a later run of
ikiwiki, so move it all from pagestate to a more transient storage.

This is assuming that we'll never want to add pagespecs to search against
the comment state. Pagespecs like author() are why the meta plugin does
store its meta data in pagestate -- the data can be needed later to match
against.
2008-12-20 20:55:38 -05:00
Simon McVittie 9e889c39ed comments: Rename COMMENTURL to ADDCOMMENTURL to avoid confusion with COMMENTAUTHORURL
Also refactor page.tmpl to use if/else rather than unless/if.
2008-12-20 17:34:55 +00:00
Simon McVittie 8ed94c0a18 comments: pass COMMENTOPENID to templates 2008-12-20 17:34:55 +00:00
Simon McVittie 8a9f4e225f comments: remove linkuser(), it's been integrated into preprocess() now 2008-12-20 17:34:55 +00:00
Simon McVittie f4e69ed815 _comment directive: if the user looks like an OpenID, store that 2008-12-20 17:34:54 +00:00
Joey Hess 61f8ea7f1d avoid uninitialized value
This can happen when a new field,
such as the new lasttry, is added.
2008-12-19 17:57:09 -05:00
Joey Hess 301733ba13 fix comment permalink to always point to comment parent page 2008-12-19 17:33:40 -05:00
Joey Hess 4bdeec4961 remove cruft
wtf does it do? absolutely nothing
2008-12-19 14:09:39 -05:00
Joey Hess 79a787a466 rename comments_form to editcomment 2008-12-19 14:07:22 -05:00
Joey Hess ddabb010b2 rename comments_display to comment 2008-12-19 14:03:26 -05:00
Joey Hess f7fc062a12 replace discussion links on pages with comments link
The thinking here is that having both a Discussion page and comments for
the same page is redundant, and certianly not what you want if you enable
comments for a page. At first I considered making configurable via pagespec
what pages got discussion links. But that would mean testing a new pagespec
for every page, and a redundant config setting to keep in sync. So intead,
take a lead from my previous change to make inlined pages have a comments
link, and change the discussion link at the top of regular pages to link to
their comments.

(Implementation is a bit optimised to avoid redundant pagespec checking.)
2008-12-19 13:55:41 -05:00
Joey Hess 7521dd6c75 jump to comment after posting
Jumping to the just posted comment was the imputus, but I killed a number
of birds here.

Added a INLINEPAGE template variable, which can be used to add anchors to
any inline template.

To keep that sufficiently general, it is the full page name, so the
comment anchors and links changed form.

Got rid of the FIXMEd hardcoded html anchor div.

More importantly, the anchor is now to the very top of the comment, not the
text below. So you can see the title, and how it attributes you.

Avoid changing the permalink of pages that are not really comments, but
happen to contain the _comment directive. I think that behavior was a bug,
though not a likely one to occur since _comment should only really be used
on comment pages.
2008-12-18 20:58:16 -05:00
Joey Hess f3bec255e4 aggregate: If a feed fails to be downloaded, try again immediatly next time aggregation is run, even if the usual time has not passed. Closes: #508622 (Michael Gold) 2008-12-17 21:27:28 -05:00
Joey Hess 81165dd2e0 jump to comments anchor after post
Not ideal, it would be nicer to jump to the actual comment posted, but no
anchor is available.
2008-12-17 20:29:55 -05:00
Joey Hess 339bfbd44a typo 2008-12-17 20:22:42 -05:00
Joey Hess cd7ac8f72a add Comments link when displaying a page inline
This link will supplant the usual Discussion link for pages
that have comments enabled.
2008-12-17 19:38:02 -05:00
Joey Hess 5feffc8b0b fix test when comments_closed_pagespec is empty 2008-12-17 19:06:29 -05:00
Joey Hess 140c0bacba change around comments pagespecs
I think it is clearer to have one pagespec that controls all pages with
comments, and a separate pagespec that can be used to close new comments on
a subset of those pages.
2008-12-17 18:50:04 -05:00
Joey Hess 9b837fd5ed fix default values for config settings
defaults cannot be set in getsetup, do it in checkconfig to avoid
uninitialized value warnings.
2008-12-17 17:05:49 -05:00
Joey Hess bb93fccf06 Coding style change: Remove explcit vim folding markers. 2008-12-17 15:22:16 -05:00
Joey Hess 985b229be6 checksessionexpiry: rework
This function as factored out was a bit confusing, I think this makes more
sense.
2008-12-17 14:26:08 -05:00
Joey Hess 613a54a3cb Merge branch 'master' into comments 2008-12-17 14:06:57 -05:00
Joey Hess f9b87a9f8b monotone: When getting the log, tell monotone how many entries we want, rather than closing the pipe, which it dislikes. (thm) 2008-12-17 13:59:12 -05:00
Joey Hess b2366f764b rename: Fix double-escaping of page name in edit box.
titlepage normally escapes, but so does formbuilder.
2008-12-17 13:56:10 -05:00
Joey Hess 15ec55eff5 elide unnecessary variables 2008-12-12 15:38:23 -05:00
Joey Hess ef972a871b remove fixme
sessioncgi hooks are always called with the wiki locked
2008-12-12 15:25:12 -05:00
Joey Hess 928f6938d2 fix redefinition of $author 2008-12-12 15:22:43 -05:00
Joey Hess 9557c7c890 move related code together 2008-12-12 15:19:01 -05:00
Joey Hess f3735891ca whitespace 2008-12-12 15:13:07 -05:00
Joey Hess 18eeb068a6 don't explicitly use inline
loadplugin("inline") should take care of that
2008-12-12 15:10:17 -05:00
Joey Hess 2a7849b838 avoid unnecessary variable 2008-12-12 15:08:06 -05:00
Joey Hess 0ced5995d5 get rid of the [postcomment] hack
I think that using a flag variable is sorta cleaner.

(This is untested.)
2008-12-12 15:05:26 -05:00
Joey Hess 38c92e63bb move getsetup to usual place 2008-12-12 14:59:23 -05:00
Simon McVittie 473160c947 htmlbalance: don't compact whitespace, and set misc other options
Not compacting whitespace is the most important one: now that we run
sanitize hooks on individual posted comments in the comments plugin,
whitespace that is significant to Markdown (but not HTML) is lost.
(cherry picked from commit cb5aaa3cee)
2008-12-12 14:23:12 -05:00
Joey Hess 41efa5ac92 Merge branch 'master' into comments 2008-12-12 14:21:08 -05:00
Joey Hess 88e8d4bf8d meta: Pass info to htmlscrubber so htmlscrubber_skip can take effect. 2008-12-12 14:06:45 -05:00
Simon McVittie 1942fc3bd6 comments: Store dates in GMT and in ISO-8601
The [[!_comment]] directive is a serialization format, not something for
presentation to users, so we should use the least ambiguous possible
representation.
2008-12-12 11:02:41 +00:00
Joey Hess 8d3a3c6a1e simplifiy logic 2008-12-11 17:31:57 -05:00
Simon McVittie f2d5ead6af comments: Change internal-use-only directive from [[!comment]] to [[!_comment]] 2008-12-11 21:23:55 +00:00
Simon McVittie dd1fa13bce comments: Use new feedfile, emptyfeeds options to inline 2008-12-11 21:19:50 +00:00
Simon McVittie 3560460eb6 comments: don't interpolate IP into anonymous user's "name"
If an admin wants the IP in the comment display template they can still
get it (the default template shows it).
2008-12-11 21:14:05 +00:00
Simon McVittie 1698364da0 comments: fix invocation of possibly_foolish_untaint 2008-12-11 21:14:05 +00:00
Simon McVittie fbf145ca3f comments: avoid warning if there's no subject 2008-12-11 21:14:05 +00:00
Simon McVittie a5889912b3 comments: Optionally allow anonymous commenters to set their name/URL.
Also provide a way for the comment template to pick up the verified
username/IP.
2008-12-11 21:14:05 +00:00
Simon McVittie 0a69c7ed56 comments: Remove some dead code 2008-12-11 21:14:05 +00:00
Simon McVittie 44a7d77a30 comments: rename main field to "editcontent" consistent with editpage
This has the side-effect that Ikiwiki's default style.css gives the text
box 100% width.
2008-12-11 21:14:05 +00:00
Simon McVittie edb69335f2 comments: instead of hard-coding mdwn, allow any supported page format 2008-12-11 21:14:05 +00:00
Simon McVittie 9af0f04df3 comments: Save comments as a file with one big [[!comment]] directive.
This delays all comment formatting until the last possible time, allows
us to set metadata without worrying that commenters may be able to evade
it, and means that changes to how a comment is saved can be handled
gracefully. It also gives us somewhere to put the commenter's username
or IP address for later reference.
2008-12-11 21:14:05 +00:00
Simon McVittie 6a986a8a0b Remove dead code for preprocessing [[!comments]] 2008-12-11 21:14:05 +00:00
Simon McVittie 1d696aef2c comments: Duplicate logic and CGI hook from recentchanges to link user pages correctly 2008-12-11 21:14:05 +00:00
Simon McVittie f88870f102 Qualify name of formattime() correctly 2008-12-11 21:14:04 +00:00
Simon McVittie 80e84e32bf Delay checking for session expiry til we actually post a comment 2008-12-11 21:14:04 +00:00
Simon McVittie 24bfc3fdc5 comments: record the time at which each comment was posted 2008-12-11 21:14:04 +00:00
Simon McVittie e66e2c2a7e comments: Use a checkconfig hook to get the default value of comments_pagename 2008-12-11 21:14:04 +00:00
Simon McVittie 4ff161ba0b comments: render comments/commenturl in page.tmpl 2008-12-11 21:14:04 +00:00
Simon McVittie 49eabc676a comments: use global config to decide whether commenting is allowed, and for name of page
Also:
* decide comment page name sooner
* set permalink on it
2008-12-11 21:14:04 +00:00
Simon McVittie a9b0b3da5f comments: use global configuration for allow_directives, commit, and pagename 2008-12-11 21:14:04 +00:00
Simon McVittie d35a2bd2de comments: Add some global configuration 2008-12-11 21:14:04 +00:00
Simon McVittie 4972baac4d comments: make preprocess a no-op 2008-12-11 21:14:04 +00:00
Simon McVittie c9bb8b03a4 comments: document what linkuser does 2008-12-11 21:14:03 +00:00
Simon McVittie 404792c618 comments: add a stub pagetemplate hook to show the comments 2008-12-11 21:14:03 +00:00
Simon McVittie 3abfc1d71c comments: Use HTML entities to escape directives 2008-12-11 21:14:03 +00:00
Simon McVittie 430ac61f21 Embed comments into comments_embed.tmpl rather than concatenating in perl 2008-12-11 21:14:03 +00:00
Simon McVittie 286dbb0541 comments: use CGI module's checksessionexpiry 2008-12-11 21:14:03 +00:00
Simon McVittie 9a6005a212 editpage: factor out checksessionexpiry into IkiWiki::CGI 2008-12-11 21:14:03 +00:00
Simon McVittie cb5aaa3cee htmlbalance: don't compact whitespace, and set misc other options
Not compacting whitespace is the most important one: now that we run
sanitize hooks on individual posted comments in the comments plugin,
whitespace that is significant to Markdown (but not HTML) is lost.
2008-12-11 21:14:03 +00:00
Simon McVittie 249ea2ed75 comments: remove allowhtml option, just switch it on all the time
Now that posts are individually sanitized, that should be safe.
2008-12-11 21:14:03 +00:00
Simon McVittie 4663f364bb comments: load inline and mdwn lazily 2008-12-11 21:14:03 +00:00
Simon McVittie 9d92fd5eb0 comments: don't rely on mdwn getting loaded first 2008-12-11 21:14:03 +00:00
Simon McVittie ebe140201e comments: sanitize the body of each comment before posting it
This should ensure that users can't "break out" from the enclosing
<div>, making it impossible to forge comments (assuming htmlscrubber
is enabled, and so is either htmlbalance or htmltidy).
2008-12-11 21:14:03 +00:00
Simon McVittie 57e40b9ce5 Fix typo that led to comments being blanked 2008-12-11 21:14:02 +00:00
Simon McVittie 3d4aa065d6 postcomment: Rename plugin to comments, use *._comment files
The PageSpec is still called "postcomment" since that's what it means.
2008-12-11 21:14:02 +00:00
Simon McVittie 3c9ccb406b Rename smcvpostcomment plugin to postcomment to propose for inclusion 2008-12-11 21:14:02 +00:00
Simon McVittie b7db3444a5 smcvpostcomment: allow commenting to be closed 2008-12-11 21:14:02 +00:00
Simon McVittie f49603bf86 smcvpostcomment: import other plugins lazily and remove unnecessary use of CGI 2008-12-11 21:14:02 +00:00
Simon McVittie 442e4e7e12 smcvpostcomment: allow inlining to be disabled, and pass through atom etc. better 2008-12-11 21:14:02 +00:00
Simon McVittie bb4eb07bdd smcvpostcomment: make allowhtml etc. configurable, and don't allow commenting on pages where comments have never been allowed 2008-12-11 21:14:02 +00:00
Simon McVittie d18adfb1ad smcvpostcomment: indicate in form whether HTML and directives are allowed 2008-12-11 21:14:02 +00:00
Simon McVittie 1bd1b03766 smcvpostcomment: remove HTML if not allowed 2008-12-11 21:14:02 +00:00
Simon McVittie 660a4ef151 smcvpostcomment: always allow wikilinks, and do access control
wikilinks are harmless, so we might as well allow them.

Access control for this plugin is a bit odd, since we specifically
don't want to allow comments to be edited - so the check is whether the
user is allowed to edit a deliberately invalid page name,
page/commented/on[smcvpostcomment]. You can put smcvpostcomment(*)
or smcvpostcomment(some/subdir/*) in $config{anonok_pagespec}
or the opposite in $config{locked_pages} to allow "editing" (really
just posting) comments.
2008-12-11 21:14:02 +00:00
Simon McVittie 798dea2033 smcvpostcomment: reduce length of subject field 2008-12-11 21:14:02 +00:00
Simon McVittie 29862a8cc8 smcvpostcomment: explain what $fake is for 2008-12-11 21:14:01 +00:00
Simon McVittie 42b15f7633 smcvpostcomment: avoid warnings if form field 'body' is undef 2008-12-11 21:14:01 +00:00
Simon McVittie e65c7b73af smcvpostcomment: load inline plugin more forcibly 2008-12-11 21:14:01 +00:00
Simon McVittie 49835784d8 smcvpostcomment: use better names for special comment files 2008-12-11 21:14:01 +00:00
Simon McVittie bd8c4674a8 smcvpostcomment: use gettext where appropriate 2008-12-11 21:14:01 +00:00
Simon McVittie f77f7a02a6 Add initial version of a postcomment plugin (temporarily namespaced as smcvpostcomment) 2008-12-11 21:14:01 +00:00
Joey Hess b67632cdcd inline: Support feedfile option to change the filename of the feed generated. 2008-12-11 15:01:26 -05:00
Joey Hess 63eb9d834e inline: Support emptyfeeds=no option to skip generating empty feeds. 2008-12-11 14:04:38 -05:00
Joey Hess 38f5e3ba69 move feedpages application up
I wanted this nearer to the top, but decided to put it after the
add_depends. Reasoning: It's possible with a combinaton of feedpages and
show options to make @list and @feedlist contain completly differing sets
of pages. We want to add_depends all pages in both sets. We could combine
the two lists and add_depends that, but it's slightly more efficient to
defer reducing @feedlist, and add_depends whichever list is longer.
2008-12-11 13:58:40 -05:00
intrigeri 5eed0fd97d po(change): reset renamed pages status at a better time
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-13 04:37:26 +01:00
intrigeri d795a295c9 po: initial infrastructure to deal with renamed master page
This is a skeleton that does nothing yet.
See the comments in the code for an overview of the issue that arises, due to
the renamepage hook never being called globally.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-13 03:55:55 +01:00
intrigeri c390056eb2 po(delete): added hook, and function skeleton
Not implemented yet, 'cos the renamepage hook has to come first.
Else translations would be deleted on rename, what a shame.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-13 01:38:22 +01:00
intrigeri cb1fe44f5d po(change): avoid losing information before guessing the same...
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-13 01:07:52 +01:00
intrigeri 8745d67f06 po(istranslatablefile): extracted this from istranslatable
... will need this soon to deal with master file deletion.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-13 00:56:23 +01:00
intrigeri 190c641c8a po(otherlanguages): return pages that should exist
... instead of already existing ones.
This fixes the "missing otherlanguages links on master pages just created via
the CGI" bug.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-12 23:27:30 +01:00
intrigeri 36312b13b4 po: memoized istranslatable, eventually
And enjoy a 10% rebuild time enhancement on a complex wiki full of maps and
other pseudo-dynamic content, with some other costly plugins enabled. So it
could well mean 20% on a more usual wiki.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-12 22:32:47 +01:00
intrigeri 10c4e858b8 po(change): flush Memoize cache, to fix bug after rename/remove
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-12 21:18:48 +01:00
intrigeri c440a39ba4 po(htmlize): ignore PO files not managed by this plugin
This way, the po plugin will not appropriate PO files it is not responsible for,
and PO files existing before this plugin was enabled can coexist peacefully with
our own ones.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-12 18:06:04 +01:00
intrigeri 2f27eb9693 po: ooops, fixed just introduced bug
(I just removed in istranslation and _istranslation the dependency on
istranslatable... which broke things in a subtle way, hard to see at the first
glance.)

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-12 17:52:00 +01:00
intrigeri e18a9d9a88 parentlinks: fixed links when po plugin is enabled
(and usedirs is disabled)

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-12 17:36:00 +01:00
intrigeri aed42eb34a po: fix istranslation/istranslatable for pages starting with /
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-12 17:29:12 +01:00
intrigeri f4815e3b12 po(mybestlink): fixed when fed with path beginning with /
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-12 16:54:51 +01:00
intrigeri eba2dee941 po: compute internal links from a slave page relative to its master page
e.g. a link appearing on a slave page links to its masterpage's subpages.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-12 15:04:50 +01:00
intrigeri b19d0d3d24 Merge commit 'upstream/po' into prv/po 2008-11-12 01:08:57 +01:00
Joey Hess 0d1593a201 Merge commit 'intrigeri/po' into po 2008-11-11 17:52:51 -05:00
Joey Hess 2a56ec6644 Merge branch 'master' into po 2008-11-11 17:52:32 -05:00
intrigeri 40ffc92953 po: fixed bug when a new translatable page is created
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-11 23:04:58 +01:00
intrigeri 2b4e76a961 po: change a bit the way links are generated
This will soon enable usage of translated page titles in link.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-11 22:29:47 +01:00
Joey Hess 6611f3a2d9 bzr: Fix dates for recentchanges. 2008-11-11 13:44:47 -05:00
intrigeri f0abaa9fc9 po: fixed link to home page when po_link_to=negotiated, added testcase
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-11 18:42:14 +01:00
intrigeri f0e796d9a1 po(change): fix uninitialized variables when running IkiWiki::refresh()
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-11 16:04:40 +01:00
intrigeri 43a1d36378 po: added HOMEPAGEURL template variable, documented when to use it
Hopefully all links should now be consistent with the chosen linking behavior,
but who knows...

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-11 15:27:39 +01:00
intrigeri cfe101fff9 po: fixed link to homepage from non-translation page
Added testcases for this bug.
It remains broken when generated from <TMPL_VAR BASEURL>, though.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-11 15:06:26 +01:00
intrigeri 6b82ef44b0 po: some code simplification/clarification
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-11 14:11:34 +01:00
intrigeri 3d8d47d785 Merge commit 'upstream/master' into prv/po 2008-11-11 04:40:24 +01:00
intrigeri 0d8cbfc5e0 po(scan): make more clear what's being done
Mostly comments, and also a small code change: simplification and implementation
details hiding.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-11 04:32:20 +01:00
intrigeri d57ef86380 po: reorder nearly all of the module code
It has grown up incrementally and new helper functions were added right in the
middle of the hooks, most often near the place they were used, which is
practical when doing initial development, but quite ugly afterwards, when helper
functions are useful to separate logic and implementation details.

Today's refactoring commits have brought the code to a much more maintainable
state, IMHO.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-11 04:05:39 +01:00
Joey Hess 53752bcb5d remove redundant link munge
This is not needed now that tagpage returns a page name starting with a
slash.

(Also fixes a minor bug that the edit links started with double slashes due
to the hack.)
2008-11-10 21:47:29 -05:00
Joey Hess f8a09ba105 tag: Normalize tagbase so leading/trailing slashes in it don't break things. 2008-11-10 19:48:58 -05:00
Joey Hess f0e58faefa Add rel=nofollow to recentchanges_links for the same (weak) reasons it was earlier added to edit links. 2008-11-10 18:05:30 -05:00
intrigeri a7d329c173 po(match_lang, match_currentlang): use the lang() function
... now that it exists, instead of duplicating it.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10 21:30:06 +01:00
intrigeri b4ab0d0b9e po: rewrote otherlanguagesloop()
It is now more elegant IMHO, and the output is now sorted according to the
language name (instead of code).

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10 21:19:21 +01:00
intrigeri c5513548c9 po: factorize extraction of a slave page's masterpage and lang
The very same code was repeated at dozens of places.

NB: the real work is now done is _istranslation(), which is memoized,
so the additional function calls overhead should be compensated.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10 20:40:44 +01:00
intrigeri 864bc2d9d0 po(otherlanguagesloop): start factorizing
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10 18:38:25 +01:00
intrigeri 1255acc02c po: finish abstracting %filtered by putting it into a blackbox
i.e. it is invisible for everyone but its accessors/mutators

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10 15:30:49 +01:00
intrigeri 38cdda66d7 po: actually use pofiles() function, to enhance code clarity
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10 15:09:56 +01:00
intrigeri 5575786803 po: abstract "doing something for the same page in every other language"
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10 14:55:21 +01:00
intrigeri 532ec56a5f po: abstract implementation details for %translations building and resetting
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10 13:56:46 +01:00
intrigeri 3174b4c6f3 po: abstract %filtered implementation details
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10 13:51:00 +01:00
intrigeri 00732f19b9 po: clarify error messages
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10 13:22:50 +01:00
intrigeri 6fc898df75 po: clarify code with some comments
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10 13:14:42 +01:00
intrigeri aef1b0f503 po: prevent a slave page to depend on itself
It has never caused harm yet, but it might in the future.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-10 12:48:27 +01:00
intrigeri 646d7bf6a3 po(refreshpot): define the input charset before read()'ing
... to prevent the use of Encode::Guess::guess_encoding() in
Locale::Po4a::Transtractor (just a minor security measure, dependent on po4a
internals, but we have no reason to think Encode::Guess is not safe).

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-08 21:32:04 +01:00
intrigeri f652af11fd Merge commit 'upstream/master' into pub/po 2008-11-07 22:19:34 +01:00
intrigeri a0ac346079 po: finished backlinks implementation
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-07 22:17:54 +01:00
intrigeri 34ab884242 po: implemented linking/backlinks specification for po_link_to=negotiated
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-07 21:27:00 +01:00
intrigeri 3e341e64c2 po: added pofiles() function, will use this soon
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-07 21:23:23 +01:00
intrigeri 4879a7f033 po: add comments
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-07 16:33:10 +01:00
Joey Hess 11d377af81 txt: Do not encode quotes when filtering the txt, as that broke later parsing of any directives on the page. 2008-11-06 20:49:18 -05:00
Joey Hess db5ea4d4f0 meta: Plugin is now enabled by default since the basewiki uses it. 2008-11-06 16:08:11 -05:00
Joey Hess ecf2399f4f aggregate: Try to query XML::Feed for the base url when derelevatising links. Since this needs the just released XML::Feed 0.3, as well as a not yet released XML::RSS, it will fall back to the old method if no xml:base info is available. 2008-11-06 16:05:10 -05:00
intrigeri daa04ae436 po: fix link to homepage in special case
... by wrapping IkiWiki::urlto in order to workaround hard-coded
/index.$config{htmlext}, which is wrong when usedirs=0 and po_link_to=current
and translatable homepage

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-06 17:28:04 +01:00
intrigeri 8b001dbb00 po: redesign (once more) automatic POT/PO files update
Now use the change hook to update these files, check them into VCS, and trigger
IkiWiki::refresh as needed. The needsbuild hook's help was required to prevent
infinite looping.

This more rigorous way of doing this fixes recentchanges (that was previously
not updated in some cases), and probably is a better long-term solution than the
two previously tested ones.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-06 15:54:55 +01:00
intrigeri 802be94104 po: use prep_writefile before creating any files in refreshpot and refreshpo
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-06 14:17:33 +01:00
intrigeri 10af328ff1 po: syntax warning fix
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-06 14:08:33 +01:00
intrigeri 7ad5c5cbdc po: fixed whitespace
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-06 13:55:03 +01:00
intrigeri 769be3d48e po: po_link_to is safe, and fallbacks to a working value if needed
warnings are displayed if it is set to an invalid or incompatible value
(e.g. po_link_to=negotiated and disabled usedirs)

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-06 13:47:09 +01:00
intrigeri 419de149a6 po: mark po_translatable_pages as a safe configuration setting
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-06 13:29:48 +01:00
intrigeri 34afa2c07d po: po_master_language and po_slave_languages are safe config settings
... and check their validity in checkconfig

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-06 13:26:45 +01:00
intrigeri c96dd00480 po: added license and copyright
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-06 13:01:33 +01:00
intrigeri 1f54c13ec2 Merge commit 'upstream/po' into prv/po
Conflicts:

	IkiWiki/Plugin/po.pm
	doc/plugins/po.mdwn

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-06 12:28:31 +01:00
Joey Hess 17bd930bc9 first pass over code
Only change of note is quoting some strings in a regexp, just in case
(also avoids the . matching any character!)

Mostly whitespace changes of no consequence.
2008-11-05 15:18:07 -05:00
Joey Hess ae37bca0e2 backup refs to injected subs later
In case two plugins both inject replacements for these subs,
backup the ref just before injecting to make sure the most
recent version is seen.
2008-11-05 15:09:54 -05:00
Joey Hess 9b16e7f148 minor layout changes 2008-11-05 15:09:04 -05:00
Joey Hess 7e95723dad avoid hitting the shell with system() 2008-11-05 14:45:45 -05:00
Joey Hess 9bedf53c0f another reason to require rebuilds (and not be marked safe)
the plugin changes html filenames, so requiring a manual transition to
enable
2008-11-05 13:57:48 -05:00
Joey Hess 127a8a3701 Merge commit 'intrigeri/po' 2008-11-05 13:50:26 -05:00
Joey Hess 42b4abee1d use error for two messages 2008-11-05 01:38:36 -05:00
intrigeri 3e0c52c524 po plugin(filter): redesign temp file management
... in a way compatible with various File::Temp versions.
The result is far from being perfect (see comments in the code for details),
but it does work.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-05 01:36:44 +01:00
intrigeri 4c6c00ccdf Merge commit 'upstream/master' into prv/po 2008-11-04 23:39:15 +01:00
intrigeri 225e21f6c5 po plugin: redesign refresh mechanism after master page update
manually triggering IkiWiki::refresh() was at least dubious, and more or less
buggy (it randomly broke the whole backlinks feature); thinking a bit more to
add the necessary bits to @needsbuild seems like a better way. don't play with
ikiwiki's internals if not absolutely needed.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-04 23:32:32 +01:00
intrigeri bc5b875de8 po plugin: remove broken parentlinks for home page's translations
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-04 20:05:21 +01:00
intrigeri cfcb7454db po plugin: aesthetics
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-04 19:23:58 +01:00
intrigeri c731a81b43 po plugin: fix preview for PO files
As a trick, use editcontent hook to mark the page as unfiltered, to force our
filter() sub's to proceed again.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-04 18:24:43 +01:00
intrigeri c7fbcf6c5e po plugin: slave pages link to the master's discussion page
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-03 00:52:27 +01:00
intrigeri 9bd3262f50 po plugin: replace %hash=undef with undef %hash
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-02 23:12:43 +01:00
intrigeri 773de05a7a po plugin: force utf-8 encoding in POT files
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-02 21:35:52 +01:00
intrigeri 2ebc0bb82d po plugin: fix linking from a translation to its master page
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-02 20:08:38 +01:00
intrigeri 37a9e64291 po plugin: fix targetpage for home page's translations
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-02 18:54:53 +01:00
intrigeri 439ba4490a po plugin: removed last (?) bit of deprecated custom hook
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-02 18:51:00 +01:00
intrigeri 950c29679d po plugin: replace targetpage hook with wrapper function
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-02 18:48:56 +01:00
intrigeri 439a2d3c44 Revert "added the targetpage hook"
This reverts commit fc299df955.
Such functionality can now be achieved using the inject() function.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-02 18:34:10 +01:00
intrigeri 307d11541a po plugin: replace tweakurlpath hook with a wrapper function
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-02 18:29:23 +01:00
Joey Hess d71caffb7b preprocess text before htmlizing it 2008-11-02 12:21:15 -05:00
intrigeri 7c173aca3e Revert "added hook urlpath" and "rename urlpath hook into tweakurlpath..."
This reverts commits d9b9022c13 and
39d44d443d. This functionality should now be
achieved using the new inject() function.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-02 18:08:50 +01:00
intrigeri 502a3433c4 po plugin: replace tweakbestlink hook with a wrapper function
... thanks to the new inject() feature.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-02 17:56:15 +01:00
intrigeri fafa98ea96 disable istranslatable memoization
It makes some test cases cry once every two tries; this may be related to the
artificial way the testsuite is run, or not. In the meantime, stop memoizing
this function.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-11-02 16:44:42 +01:00
intrigeri 7713653878 Merge commit 'origin/master' into prv/po 2008-11-02 13:11:00 +01:00
Joey Hess bb841f94f4 format: New plugin, allows embedding differntly formatted text inside a page (ie, otl inside a mdwn page, or syntax highlighted code inside a page). 2008-10-31 16:42:20 -04:00
Joey Hess 354d22e27b don't rely on plugin load order when determining generated directives
Instead, shortcuts will explicitly be marked as such when registered, and
listdirectives can filter them out.
2008-10-30 13:41:19 -04:00
Joey Hess 33a0e84ddb fix preview of shortcuts
Move shortcut processing back to checkconfig, and avoid it failing if the
srcdir is not defined.
2008-10-29 14:20:31 -04:00
Joey Hess 8530e827b0 git: Allow [[sha1_commit]] to be used in the diffurl, to support cgit. 2008-10-27 14:45:54 -04:00
Joey Hess 146192d5b0 the pre-receive wrapper needs to be suid after all
It needs to write to the user db.
2008-10-24 15:47:42 -04:00
Joey Hess 1a883b3c50 include temp file for attachment change too 2008-10-24 13:44:03 -04:00
Joey Hess 0196e1f9fc updates 2008-10-24 13:29:41 -04:00
Joey Hess 85f4b99710 untrusted committers code seems to be fully working
Still need to investigate possible races, and test some more.
2008-10-23 18:05:57 -04:00
Joey Hess ad9e443f22 check_canattach hooked up 2008-10-23 16:56:40 -04:00
Joey Hess 4669eab596 more work on untrusted committers
Wired up check_canedit and check_canremove, still need to deal with
check_canattach, and test.
2008-10-23 16:29:50 -04:00
Joey Hess 094af3d113 initial support for git repos with untrusted committers
Still need to wire up the calls to check_* , but it's cold out here and my
hands are going numb, so enough for now.
2008-10-22 20:52:34 -04:00
Joey Hess e75818572f function injection overhaul
Add an inject function, that can be used by plugins that want to replace
one of ikiwiki's functions with their own version. (This is a scary thing
that grubs through the symbol table, and replaces all exported occurances
of a function with the injected version.)

external: RPC functions can be injected to replace exported functions.

Removed the stupid displaytime hook, and use injection instead.
2008-10-21 17:57:19 -04:00
Joey Hess 327adadf04 disable warnings when redefining functions 2008-10-21 17:03:08 -04:00
Joey Hess ee1ccfa863 use relativedate as the css class for dates that should display relative 2008-10-20 19:22:22 -04:00
Joey Hess a2839de936 tag: When tagpage is set, force the links created by tagging to point at the toplevel tagpage, and not closer subpages.
The html links already went there, but internally the links were not
recorded as absolute, which could cause confusing backlinks etc.

For example, with tagbase=tags, if blog/tags/bar existed and blog/foo was
tagged bar, it would link to /tags/bar. But, the link would be recorded
simply as a link to tags/bar, and so later blog/tags/bar would appear to
have the backlink.
2008-10-20 18:17:03 -04:00
Joey Hess 5e52bfb2e7 inline: Only the last feed link was put on the page, fix this to include all feed links. So rss will be included along with atom, and pages with multiple feeds will get links added for all feeds. 2008-10-20 15:25:45 -04:00
intrigeri fadb26bc15 Merge commit 'origin/master' into prv/po 2008-10-20 14:33:19 +02:00
Joey Hess fd9393ef85 add displaytime hook
Need to use a hook because an exported function cannot be reliably
overridden. The replacement verstion was actually only affecting plugins
loaded after it.

formattime doesn't need a hook, since there's no reason to export it.
2008-10-19 20:12:37 -04:00
Joey Hess db146d9f1e need to use localtime, fix width 2008-10-19 19:39:32 -04:00
Joey Hess 2b569f99d9 fix relativedate timezone inclusion
The machine parseable date needs to include a timezone.

Also, simplified the interface for date display.
2008-10-19 19:21:44 -04:00
Joey Hess 2321906cd7 mark up date so relativedate will work 2008-10-19 15:17:00 -04:00
intrigeri 8211910566 po plugin: set every configuration item to unsafe
We will check later which ones are actually safe enough for websetup.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-19 17:19:42 +02:00
intrigeri f096a9d798 po plugin: added ISTRANSLATION and ISTRANSLATABLE template variables
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-19 00:05:13 +02:00
intrigeri 629968fc89 po plugin(refreshpot): prevent PO references to be written
... else we can fall into some kind of nasty infinite loop, when two ikiwiki
instances don't store their working copy of the repository at the same place:
every POT file update in one repository would trigger an update of the same POT
file in the others repository, and so on.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 21:47:49 +02:00
intrigeri a0deb3038c po plugin: do not allow msgmerge to create backup files
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 19:18:22 +02:00
intrigeri 892809bb53 po plugin: only refresh private module variables when needed
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:13 +02:00
intrigeri 7b7865150f po plugin: add correct dependencies on pages using OTHERLANGUAGES
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:13 +02:00
intrigeri 1aad01f841 po plugin: bugfix (OTHERLANGUAGES)
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:12 +02:00
intrigeri 1d76762517 po plugin: initial implementation of automatic POT/PO update
The updated or created PO files are put under version control.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:12 +02:00
intrigeri 1e69eb482f po plugin: rebuild %translations after having created missing POT/PO files
This is not needed yet, but when newly created POT/PO files are added to
%pagesources and other data structures, we'll need this.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:12 +02:00
intrigeri 58c77a01f7 po plugin: create missing POT/PO files in needsbuild hook
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:12 +02:00
intrigeri 6add615928 po plugin: added and documented PERCENTTRANSLATED template variable
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:12 +02:00
intrigeri 1a670d3aca po plugin: make translation percentage available in OTHERLANGUAGES loop
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:12 +02:00
intrigeri 8867316125 po plugin: added currentlang() custom PageSpec function
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:12 +02:00
intrigeri ce9db89896 po plugin: added lang() custom PageSpec function
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:11 +02:00
intrigeri d4f787ef52 po plugin: make any slave page dependent on the corresponding master page
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:11 +02:00
intrigeri a8e8613fa1 po plugin: bugfix - only refresh POT/PO for translatable pages
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:11 +02:00
intrigeri dc74c8e577 po plugin: do not trust po4a functions return value
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:11 +02:00
intrigeri 6424d748a4 po plugin: refresh PO files when a master page is updated
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:11 +02:00
intrigeri d5b5cfb8e4 po plugin: refresh POT files when a master page is updated
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:11 +02:00
intrigeri bd237d48cf po plugin: build %translations in needsbuild hook rather than scan
... because we'll need this data to refresh POT/PO files in needsbuild hook

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:11 +02:00
intrigeri a28559798a po plugin: created OTHERLANGUAGES template loop
It currently only provides basic translations/master pages links.
Updated documentation accordingly.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:10 +02:00
intrigeri 32cc0b336a po plugin: po_slave_languages is a hash, rather than a hash of hashes
The latter seems to be unsupported by ikiwiki config system.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:10 +02:00
intrigeri ae827a43f8 po plugin: build %translations at scan time
... so that we can consider it as complete at preprocess time

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:10 +02:00
intrigeri 08df9dcef7 po plugin: memoize istranslatable and _istranslation
Both functions are called very often, and:
- istranslatable has no side effect
- _istranslation is the helper function, without any side effect, for the
  istranslation function

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:10 +02:00
intrigeri 1e874b3f0a po plugin[filter]: avoid converting more than once per destfile
Only the first filter function call on a given {page,destpage} must convert it
from the PO file, subsequent calls must leave the passed $content unmodified.

Else, preprocessing loops are the rule.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:10 +02:00
intrigeri 52728bb6ea po plugin: bugfix (calling function in wrong module)
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:10 +02:00
intrigeri 458ccebdd3 po plugin: added *.pot to wiki_file_prune_regexps
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:10 +02:00
intrigeri e163b037bf po plugin: move translatable pages to setup file, refactor
Replaced [[!translatable]] directive with po_translatable_pages setting.

Moved istranslatable/istranslation code to helper functions leaving place for
future caching and/or memoization. The PageSpec functions still work.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:10 +02:00
intrigeri ffd1fff775 po plugin: allow pagestate update (bugfix)
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:09 +02:00
intrigeri b0b87d1584 po plugin: respect documented convention to store pagestate
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:09 +02:00
intrigeri 79d6f52d30 po plugin: implemented po_link_to=current
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:09 +02:00
intrigeri 0791e5afe3 po plugin: added istranslatable() pagespec function, and use it
(do not name non-translatable pages index.LL.html)

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:09 +02:00
intrigeri fdc7974b2a po plugin: implemented po_link_to=negotiated
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:09 +02:00
intrigeri e82c6b1908 po plugin: implement linking specification in one of the main cases
i.e. in case usedirs is enabled and po_link_to_current_language is disabled

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:09 +02:00
intrigeri c8330da6c0 po plugin: add po_link_to_current_language option, check config
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:08 +02:00
intrigeri 1975d4d35f po plugin: use pagespec_match() instead of direct match_istranslation calls
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:08 +02:00
intrigeri 258c49ae55 po plugin: added [[!translatable]] directive
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:08 +02:00
intrigeri d9b9022c13 added hook urlpath
This hook can be used to modify the internal urls generated by ikiwiki.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:08 +02:00
intrigeri bd50ba3e83 po plugin: switch to page.LL.html naming convention
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:08 +02:00
intrigeri 45d08022bb po plugin: name rendered master pages like slave ones (page.html.LL)
Apache's content negotiation transparently redirects any old URL (page.html) to
the new one, depending on the client preferred language (i.e. a German browser
will be fed with page.html.de). Transition to this naming convention is then
really smooth.

This naming convention allows one to deliberately display the master page, even
if her browser is configured for another language.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:07 +02:00
intrigeri b90f8397f6 po plugin: reworked available options
- renamed po_supported_languages to po_slave_languages
- added po_master_language option, which will soon be useful

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:07 +02:00
intrigeri 575d4021e3 po plugin: htmlize translated content as if it was the same type as the master page
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:07 +02:00
intrigeri 1b5f610a97 po plugin: convert PO to master page's type in filter hook
Master page's type htmlize hook should also be run in po's htmlize hook,
but let's proceed step by step.

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:07 +02:00
intrigeri 75fc44ce2f po plugin: factorize most checks into a new match_istranslation PageSpec
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:07 +02:00
intrigeri 50f1fd43da po plugin: initial work
- .po is a new supported wiki page type
- PO files are rendered verbatim into HTML
- override targetpage to ease Content Negotiation

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:07 +02:00
intrigeri fc299df955 added the targetpage hook
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-10-18 15:49:07 +02:00
Joey Hess cb9a695443 fix url 2008-10-17 22:04:43 -04:00
Joey Hess 35c56622ea tweak recentchanges permalink code
Need to handle the case where url is not set.
2008-10-17 21:54:42 -04:00
Joey Hess fdb5da46b0 Patch for anchor-based change permalinks in recent changes feed
from JasonBlevins
2008-10-17 21:49:55 -04:00
Joey Hess 745dc1c62f add missing getsetup hook 2008-10-17 21:29:05 -04:00
Joey Hess 02ec92c6cb make relativedate work for the dates on the recentchanges page
Having a always current relative date on recentchanges is very, very nice.
2008-10-17 21:21:07 -04:00
Joey Hess 7390a7a072 relativedate: New javascript-alicious plugin that makes all dates display relative, in a very nice way, if I say so myself. 2008-10-17 20:47:32 -04:00
Joey Hess 79b376f991 Add an underlay for javascript, and add ikiwiki.js containing some utility code.
* Add an underlay for javascript, and add ikiwiki.js containing some utility
  code.
* toggle: Stop embedding the full toggle code on each page using it, and
  move it to toggle.js in the javascript underlay.
2008-10-17 20:28:18 -04:00
Joey Hess f36080ae02 aggregate: Avoid bug that caused immediate expiration of items with a date in the future. 2008-10-16 18:20:16 -04:00
Joey Hess 78a69e5bd6 only darcs add files not yet in version control 2008-10-16 17:20:17 -04:00
Joey Hess 7eb512205f updated from pesco's darcs repo, current to Oct 11 version 2008-10-15 19:38:21 -04:00
Joey Hess 1f7f5d5e0e Merge branch 'master' into darcs 2008-10-15 19:36:48 -04:00
Joey Hess b8f4b9c799 inline: Use the feed's description in the rss and atom links. Closes: #502113 2008-10-15 14:45:28 -04:00
Joey Hess 02e39bf704 fix prototype 2008-10-14 15:47:19 -04:00
Joey Hess c39112e6ef inline: Allow MTIME to be used in inlinepage.tmpl. 2008-10-14 15:00:46 -04:00
Joey Hess 643c0f1afc optimise url parsing and add guard against failure to parse 2008-10-10 17:09:33 -04:00
Peter Simons f9957d11ed google plugin: Use google.com to search the local site.
Google allows has a nice feature, sitesearch, that allows anyone to
limit search results to a specific site. Obviously, this feature can be
used to provide a search engine for the local ikiwiki site without the
need to install any additional software. Just enable the 'google' plugin
and make sure that --url uses the proper hostname. Thanks to Joey for
helping to get the Perl implementation right.
2008-10-10 17:05:02 -04:00
Joey Hess a473cb2f74 orphans: Fix unquoted page name in regexp. 2008-10-09 19:09:16 -04:00
Joey Hess d3ca495e61 lockedit: Support specifying which users (and IP addresses) a page is locked for. This supports most of the ACL type things users have been wanting to be done. Closes: #443346 (It does not control who can read a page, but that's out of scope for ikiwiki.) 2008-10-08 17:47:38 -04:00
Joey Hess 1e17ea0b65 avoid $_ in a few other for loops
These were probably not currently buggy, but let's avoid bugs being
introduced by the functions called clobbering $_.
2008-10-06 16:19:54 -04:00
Joey Hess fea76a11bc remove: Avoid $_ breakage. (Stupid, stupid perl.)
This avoids another one of those $_ scoping issues where a deep call to a
function that changes $_ clobbers the array that is being looped over.
2008-10-06 16:10:47 -04:00
Joey Hess 3b47dae9ca remove, rename: Allow acting on attachments as a page is being created. 2008-10-02 12:53:53 -04:00
Joey Hess c945952381 attachment: Support adding attachments to pages even as they are being created. 2008-10-02 12:48:06 -04:00
Joey Hess e0fd02acf1 don't special case preview
Whenever the edit form is submitted, but not saved, the page location
select should reduce to the currently selected value. This was only done
when previewing before, but is also needed in order to support the case of
adding an attachment to a page that is just being created.

Before this change, the attachment plugin would get a weird value in
$form->field("page"), that did not reflect the actual page location.
2008-10-02 12:42:46 -04:00
Joey Hess bf386e22f5 inline: Fix handling of rootpage that doesn't exist.
It makes sense to use bestlink to determine which page rootpage refers to,
but if no page matches, just use the raw value.
2008-10-01 17:29:03 -04:00
Joey Hess 917f54a777 add pesco's darcs plugin 2008-10-01 17:24:06 -04:00
Joey Hess 826af4600a fix subpage rename bug with indexpages
If indexpages is enabled, then foo/index.mdwn will look like a subpage
of foo, so an additional check is needed to avoid trying to rename it
twice.
2008-10-01 14:43:28 -04:00
Joey Hess 733171bf3f support indexpages 2008-09-29 19:08:12 -04:00
Joey Hess 121efb246f Removed the pagefile function, which was confusingly close in name to
newpagefile.

Note that newpagefile is not used here (or in recentchanges) because
the internal use pages they generate are transient and unlikely to
benefit from being put each in their own subdir.
2008-09-29 18:59:20 -04:00
Joey Hess 2ba168ac83 use newpagefile 2008-09-29 18:52:42 -04:00
Joey Hess a7fd6debc5 support indexpages when renaming pages
Note that the page filename code used here and in editpage are identical..
2008-09-29 18:29:53 -04:00
Joey Hess 40007b8111 support indexpages when creating new pages
Initial draft, may need to factor new page filename code out into helper
function if other plugins need to do the same..
2008-09-29 18:19:44 -04:00
Joey Hess bb4211e326 avoid unnecessarily rebuilding pages with complex conditionals
I noticed that ikiwiki/formatting was beilg rebuilt when any page changed.
This turned out to be because it contained a complex conditional
"enabled(foo) or enabled(bar)", and the conditional plugin did not notice
that this consisted only of enabled() tests, and copied it unchanged into
add_depends. Thus, the page's dependencies were satisfied by any page
change.

The fix is to beef up the parser so that it can handle that and more
complex conditionals, and detect if they consist only of such tests.
2008-09-29 18:05:39 -04:00
Joey Hess c4be16703f fix handing of case of file first created by preview but then saved
To handle this, avoid populating %renderedfiles in preview,
and in expiry, check if the file is in %renderedfiles, if it is
do not delete it since it was saved.
2008-09-29 13:25:31 -04:00
Joey Hess 2ff3c8aee7 editpage: Be more aggressive (and less buggy) about cleaning up temporary files rendered during page preview. 2008-09-27 18:02:33 -04:00
Joey Hess 61426a7186 Reorganize index file, add a format version field.
Upgrades to the new index format should be transparent.

The version field is 3, because 1 was the old textual index, 2 was the
pre-versioned format.

This also includes some efficiency improvements to index loading, by
not copying a hash and using a reference.
2008-09-27 16:35:56 -04:00
Joey Hess 55a0361a47 template: Make edit link for new templates ensure the page is located under toplevel templates directory. 2008-09-27 15:18:36 -04:00
Joey Hess 67f38832aa htmltidy robustness fixes
* htmltidy: Avoid returning undef if tidy fails. Also avoid returning the
  untidied content if tidy crashes. In either case, it seems best to tidy
  the content to nothing.
* htmltidy: Avoid spewing tidy errors to stderr.
2008-09-27 14:27:42 -04:00
Joey Hess 9ec9d6901d Export pagetitle, titlepage, linkpage. 2008-09-27 14:27:42 -04:00
Joey Hess bfab23ce33 typo 2008-09-27 14:27:42 -04:00
Joey Hess 316ef6571b pagetype is exported 2008-09-27 13:34:46 -04:00
Joey Hess 7351d545d9 Merge commit 'smcv/beautify'
Conflicts:

	IkiWiki/Plugin/recentchanges.pm

Note that smcv's approach of using urlto also gets the url right when
redirecting to a non-html file, which is a better approach than my recent
fix to recentchanges
2008-09-27 13:00:48 -04:00
Joey Hess f181962dfc typo 2008-09-27 12:50:39 -04:00
Joey Hess 89256ab870 htmlscrubber: Add a config setting that can be used to disable the scrubber acting on a set of pages. 2008-09-26 18:07:37 -04:00
Joey Hess 83429adf04 decode utf-8 in recentchanges_link parameter 2008-09-26 15:40:01 -04:00
Joey Hess bce2a34c19 tag: Make edit link for new tags ensure that the tags are created inside tagbase, when it's set. 2008-09-25 20:25:07 -04:00
Joey Hess 965f7310fe git: Fix handling of utf-8 filenames in recentchanges.
Seems that the problem is that once the \nnn coming from git is converted
to a single character, decode_utf8 decides that this is a standalone
character, and not part of a multibyte utf-8 sequence, and so does nothing.
I tried playing with the utf-8 flag, but that didn't work. Instead, use
decode("utf8"), which doesn't have the same qualms, and successfully
decodes the octets into a utf-8 character.

Rant:

Think for a minute about fact that any and every program that parses git-log,
or git-show, etc output to figure out what files were in a commit needs to
contain this snippet of code, to convert from git-log's wacky output to a
regular character set:

if ($file =~ m/^"(.*)"$/) {
	($file=$1) =~ s/\\([0-7]{1,3})/chr(oct($1))/eg;
}

(And it's only that "simple" if you don't care about filenames with
embedded \n or \t or other control characters.)

Does that strike anyone else as putting the parsing and conversion in the
wrong place (ie, in gitweb, ikiwiki, etc, etc)? Doesn't anyone who actually
uses git with utf-8 filenames get a bit pissed off at seeing \xxx\xxx
instead of the utf-8 in git-commit and other output?
2008-09-25 18:26:42 -04:00
Joey Hess e1ba137317 attachment: Add admin() pagespec to test if the uploading user is a wiki admin. 2008-09-25 16:49:30 -04:00
Joey Hess 093e815440 aggregate: Avoid uninitialized value warnings for pages with no recorded ctime.
I saw this in the wild, apparently a page was not present on disk, but was
in the aggregate db, and not marked as expired either. Not sure how that
happened, but such pages should get marked as expired since they have an
effectively zero ctime.
2008-09-25 15:38:51 -04:00
Joey Hess 3f5ba52ee0 recentchanges: Fix redirects to non-page files. 2008-09-25 13:46:12 -04:00
Joey Hess e00df8575f rename: Hide type field from rename form when renaming attachments. 2008-09-23 19:31:34 -04:00
Joey Hess 40dc92a67b multiple rename support is working
most edge cases seem handled too
2008-09-23 19:21:05 -04:00
Joey Hess 544da9b0da Merge branch 'master' into tova 2008-09-23 17:42:38 -04:00
Joey Hess 8e0180d8ca rename, remove: Don't rely on a form parameter to tell whether the page should be treated as an attachment. 2008-09-23 17:41:05 -04:00
Joey Hess cf4db49567 factor out fixlinks 2008-09-23 17:26:46 -04:00
Joey Hess 9b57602394 factor out do_rename 2008-09-23 17:04:01 -04:00
Joey Hess 9cbc46f49a add checkbox to rename subpages too 2008-09-23 16:56:57 -04:00
Joey Hess 8494104b39 layout 2008-09-23 14:57:13 -04:00
Joey Hess a32c0ecd51 include perl error in warning about openid
it may be some other module missing, this way you can tell by reading the
log
2008-09-23 12:59:43 -04:00
Simon McVittie c7804cafa5 Fix typo in skeleton.pm.example: sessionncgi (with extra n)
(cherry picked from commit 72ffc85d6acb8b99839ac98a2c23dbef410b5666)
2008-09-23 12:47:02 -04:00
Simon McVittie 7f82594410 remove: redirect via urlto(), avoiding mentions of index.html 2008-09-21 18:26:48 +01:00
Simon McVittie 02923917c8 recentchanges: construct redirections via urlto(), avoiding mentions of index.html 2008-09-21 18:26:48 +01:00
Simon McVittie 97e3263ad1 poll: Use urlto to produce redirection URLs, avoiding mentions of index.html 2008-09-21 18:26:48 +01:00
Simon McVittie e73987b01d editpage: beautify redirection URLs, avoiding exposing the implementation detail that index.html exists 2008-09-21 18:26:42 +01:00
Joey Hess 4c68e149e5 handle templates with special characters in name
The template field is really a link, so needs to be converted to a page
name in stored state.
2008-09-20 23:00:19 -04:00
Joey Hess 5e713047b4 avoid uninitialised value warning 2008-09-20 22:51:42 -04:00
Joey Hess 12eb585353 add missing page name sanity check 2008-09-20 22:48:22 -04:00
Joey Hess 748d375954 avoid warning if percent value is not numeric 2008-09-20 16:31:27 -04:00
Joey Hess 84347a1247 avoid duplicate template lookup 2008-09-20 16:23:15 -04:00
Joey Hess 6088ad861c revert colon part of change 2008-09-20 16:21:04 -04:00
Joey Hess a6fc3b411f edittemplate patch from Willu
* edittemplate: Default new page file type to the same type as the template.
  (willu)
* edittemplate: Add "silent" parameter. (Willu)
* edittemplate: Link to template, to allow creating it. (Willu)
2008-09-20 16:19:09 -04:00
Joey Hess 9a9b25346d i18n 2008-09-19 13:52:01 -04:00
Joey Hess 779c5214f3 progress: Display an error if the progress cannot be parsed, and allow the percent parameter to only optionally end with "%". 2008-09-19 13:09:50 -04:00
Joey Hess 914c92c4e1 fix check for nonexistant content 2008-09-17 18:19:52 -04:00
Joey Hess 89953e3e19 store ctime for use by expiry code
The expiry code does need to make sure to sort in ctime order, even if
expiring by count, so it expires the right ones.
2008-09-17 18:11:22 -04:00
Joey Hess 1cb4154bc8 aggregate: Support atom feeds with only a summary element, and no content elements. 2008-09-17 15:56:58 -04:00
Joey Hess da7c6eb1b4 editdiff: Broken since 2.62 due to wrong syntax, now fixed. 2008-09-17 14:34:02 -04:00
Joey Hess b540b263de aggregate: Allow expirecount to work on the first pass. (expireage still needs to wait for the pages to be rendered though) 2008-09-17 14:27:31 -04:00
Joey Hess ee94407891 rootpage is not a pagespec
So ./posts won't be interpreted right. Just "posts" should do, I think.
2008-09-14 13:50:34 -04:00
Joey Hess bc7381c4f9 listdirectives: Enable use of the directives underlay. 2008-09-11 18:46:32 -04:00
Joey Hess d76c8aa013 change git hook description
It doesn't have to be a post-update hook.
2008-09-11 15:53:25 -04:00
Joey Hess d9d783c4bc goodstuff update
* goodstuff: Remove otl plugin from the bundle since it needs a significant
  external dependency and is not commonly used. If you use otl, make sure
  you explicitly enable it now.
* goodstuff: Add more, progress, and table plugins to the bundle.
2008-09-09 16:11:16 -04:00
Joey Hess 5d53fab853 img: Support sizes like 200x. Closes: #475149 2008-09-09 15:20:06 -04:00
Joey Hess 6f46cc3b31 progress: New plugin to generate progress bars (willu) 2008-09-09 14:44:58 -04:00
Joey Hess 2b53de66a0 ddate: Stop clobbering timeformat when not enabled. 2008-09-08 19:40:23 -04:00
Joey Hess f888ceafee minor optimisation 2008-09-08 12:28:56 -04:00
Joey Hess 0f67e7d969 editpage: New core plugin factoring out page editing to allow disabling it if desired. 2008-09-05 13:57:25 -04:00
Joey Hess 7d3047b6d8 UNIVERSAL not used in this plugin 2008-09-05 13:44:52 -04:00
Joey Hess 3c022e2cd7 use yesno 2008-09-02 18:20:17 -04:00
Joey Hess 657bf7846d table: Support header=column to make the table header be the first column of the data. (AlexandreDupas) 2008-09-02 14:57:20 -04:00
Joey Hess b7458c48d8 filecheck: Fall back to testing for binary or plain text files if no mime type is detected. 2008-09-01 15:00:15 -04:00
Joey Hess 2b602e2e9f filecheck: Fixed two bits broken in move from attachment. 2008-08-28 13:04:45 -04:00
Joey Hess b9efeba972 humansize moved to filecheck
It's not used there, but it makes sense to keep it there as it's the
inverse of parsesize.
2008-08-27 15:31:48 -04:00
Joey Hess b1d8437f8a if extrafooter is already set, append to it
to interoperate with future plugins using it
2008-08-26 18:04:45 -04:00
Joey Hess a326ffed1f autoindex: Avoid re-adding previously deleted (or renamed) pages. 2008-08-26 14:39:47 -04:00
Joey Hess 042a057778 color: New plugin from ptecza. 2008-08-26 13:22:34 -04:00
Joey Hess 6364949dfc remove dead code 2008-08-26 12:28:59 -04:00
Joey Hess d06096ad0d edittemplate: Don't wipe out edits on preview. 2008-08-25 20:51:10 -04:00
Joey Hess 78e34fbdc2 filecheck: New plugin factoring out the PageSpec additions that were originally part of the attachment plugin. 2008-08-25 19:52:34 -04:00
Joey Hess 8eb65c1ef1 update 2008-08-25 14:21:04 -04:00
Joey Hess 4956623ee6 rename plugin
I don't want to be stuck renameing it later if preprocessor directives are
turned into postprocessor directives. Also, "directives" is shorter and
clearer than "preprocessors".
2008-08-25 13:38:44 -04:00
Joey Hess c62cbc31c2 indentation, style, and fixed name of preprocessor_description_dir 2008-08-25 13:36:06 -04:00
Joey Hess 029edd9b45 plugin by willu 2008-08-25 13:28:25 -04:00
Joey Hess 69e35d3c51 willu's teximg changes
* teximg: The prefix is configurable, and has changed to not include the
  nonstandard mhchem by default. (willu)
* teximg: dvipng is used if available to render images. Its output is
  antialiased and better than dvips. If not available, the old dvips+convert
  chain will be used. (willu)
* Drop suggests on texlive-science, add suggests on dvipng.
2008-08-24 15:21:51 -04:00
Joey Hess 9b10f5eab2 map: The fix for #449285 was buggy and broke display of parents in certian circumstances.
The use of $dummy was not sufficient, because it only stuck around for the
first element after a dummy parent, and was then lost. Instead, use a
$addparent that contains the actual dummy parent, so it can be compared
with the new item to see if we're still under that parent or have moved to
another one.
2008-08-23 13:10:49 -04:00
Joey Hess d84e43faac fix my broken fix 2008-08-23 12:48:01 -04:00
Joey Hess d23943ebea fix off-by-one, and fix link
The link was broken if the inserted dir was not under the destpage
2008-08-23 12:37:19 -04:00
Joey Hess 15a0a151bf fix links to inserted parent pages
The parent page names had "/" prepended, which caused broken links.
2008-08-23 12:28:18 -04:00
Joey Hess 5d83e7359d graphviz: Fix breakage of the name of the preprocessor directive. 2008-08-14 14:44:30 -04:00
Joey Hess 6432d15cb4 fix a common case typo 2008-08-12 15:48:44 -04:00
Joey Hess d50376a05d default to looking at page source file if no file is specified
This will allow these pagespecs to be used a bit more generally.
2008-08-12 15:34:47 -04:00
Joey Hess 88e389ef1e error if ping fails, rather than printing debug 2008-08-11 13:03:30 -04:00
Joey Hess 3de7d39ec6 use srcfile/destfile
avoids a commit message of "renamed foo to foo"
2008-08-07 16:20:35 -04:00
Joey Hess 11550f9593 avoid link fixup if page name stayed the same 2008-08-07 16:17:50 -04:00
Joey Hess 46b9a83b61 page file type rename patch from willu 2008-08-07 16:09:41 -04:00
Joey Hess 581381e335 inline: Ignore parent dirs when sorting pages by title. 2008-08-07 15:47:59 -04:00
Joey Hess 6fb6d51524 fix inverted test 2008-08-06 01:15:48 -04:00
Joey Hess 86660e9c82 external: Fix support for hooks called in an array context. 2008-08-06 01:05:44 -04:00
Joey Hess 9cb415f4a4 autoindex: Ignore internal pages, and take underlay directories into account. Also, avoid making index pages for directories that contain no files. 2008-08-06 00:04:05 -04:00
Joey Hess bf8558f346 save to real setup file, and rebuild/refresh 2008-08-05 20:11:56 -04:00
Joey Hess 4b4bce5006 Revert "typo"
This reverts commit c8d3626c51.
2008-08-05 19:39:30 -04:00
Joey Hess c8d3626c51 typo 2008-08-05 19:30:09 -04:00
Joey Hess 6e2f9e97f3 Add simple patch to silence a warning when using monotone 2008-08-04 15:00:47 -04:00
Joey Hess e48f8ff8a9 hm 2008-08-04 14:53:11 -04:00
Joey Hess 0c3291d4f3 plugin enable/disable working and bugfixes 2008-08-03 22:16:38 -04:00
Joey Hess 6d15912e8f work around strange problem with banned_users
Its value was being ignored. Some kind of formbuilder bug?
Anyway, prefixing all keys with a section seems like a good idea
generally, in case there's ever overlap.
2008-08-03 21:06:13 -04:00
Joey Hess 4b79a43db6 checkboxes back 2008-08-03 20:51:46 -04:00
Joey Hess 2a712c8817 use radio, not checkbox, for booleans
Had to do this due to one of CGI::FormBuilder's more annoying quirks -- it
loses the value of a checkbox field with only one option, always treating
it as checked.
2008-08-03 20:20:25 -04:00
Joey Hess 3905645342 add plugin safe/rebuild info (part 3 of 3) 2008-08-03 19:36:11 -04:00
Joey Hess 219afc3f9c support rebuild tristate
also some fixes to change minimisation logic
2008-08-03 18:23:17 -04:00
Joey Hess 39195de96e add plugin safe/rebuild info (part 2 of 3)
(brain.. melting..)
2008-08-03 17:20:21 -04:00
Joey Hess 1230e914b1 anonok is safe 2008-08-03 17:03:20 -04:00
Joey Hess 1a37848346 move plugin toggles to before config setting again 2008-08-03 16:58:16 -04:00
Joey Hess b7d6a49be4 ui improvements 2008-08-03 16:46:38 -04:00
Joey Hess aacec52a07 show force disabled plugins in advanced mode 2008-08-03 16:43:42 -04:00
Joey Hess 903213e63f add plugin safe/rebuild info (part 1 of 2)
too many plugins.. brain exploding..
2008-08-03 16:40:12 -04:00
Joey Hess 9e0cbb73fe plugin safe/rebuild controls 2008-08-03 16:23:41 -04:00
Joey Hess 4405cebd0a add advanced and basic modes 2008-08-03 14:57:24 -04:00
Joey Hess 5c0f539950 avoid adding extra disabled fields for arrays 2008-08-03 14:41:53 -04:00
Joey Hess d00f3edf13 properly support all types of data in arrays 2008-08-03 14:39:34 -04:00
Joey Hess 0f06504422 remove description_html, add link 2008-08-03 14:36:17 -04:00
Joey Hess 5ef45ca7e1 support arrays 2008-08-03 00:27:27 -04:00
Joey Hess d8b49840dd update 2008-08-02 23:59:40 -04:00
Joey Hess 7baa6320e0 rebuild detection 2008-08-02 23:32:40 -04:00
Joey Hess 8c02d670d0 pull values from form to config 2008-08-02 23:14:59 -04:00
Joey Hess 94c59d3254 collect a hash of shown fields
Need to do this to know what fields to take from CGI.
(Can't trust that only safe ones are sent..)
2008-08-02 23:06:25 -04:00
Joey Hess c762b65ce4 show unsafe options (RO) by default
Small data leak, but only to admins, and I think it's worth it to see the
stuff that cannot be configured.
2008-08-02 22:50:09 -04:00
Joey Hess 5dbd053da3 avoid syslog whining from broken plugins 2008-08-02 22:22:53 -04:00
Joey Hess 6f65cb1cbe avoid setting default value in websetup_force_plugins
This would make changes not be seen later.
2008-08-02 22:20:26 -04:00
Joey Hess 15341aed01 don't install demo external plugins by default 2008-08-02 16:53:20 -04:00
Joey Hess 4708aeceb3 websetup form display done 2008-08-02 16:41:37 -04:00
Joey Hess b0f4767448 basic form display done 2008-08-02 16:41:36 -04:00
Joey Hess 102f29e500 add description_html 2008-08-02 16:41:36 -04:00
Joey Hess 680cd2fbc3 skeleton of web setup plugin 2008-08-02 16:41:35 -04:00
Joey Hess 190a845fe1 hide deprecated values if empty after save 2008-08-01 17:39:17 -04:00
Joey Hess f41448d9ca rcs plugin loading reorg
Move rcs plugin load to loadplugins; move duplicate rcs detection logic out
of individual plugins and into loadplugins. Avoids checkconfig failing when
run twice.
2008-08-01 16:45:05 -04:00
Joey Hess bb394fdae8 admin prefs move to setup file, stage 1
The locked pages configuration is moving to a locked_pages option in the
setup file, and the allowed attachments configuration to
allowed_attachments. The admin prefs page can still be used for these, but
that's depreacted and will only be shown if there's currently a value.
2008-08-01 16:45:04 -04:00
Joey Hess 041923a89e Merge branch 'master' into autoconfig
Conflicts:

	IkiWiki/Plugin/git.pm
	debian/changelog
	po/ikiwiki.pot
2008-07-31 19:35:37 -04:00
Joey Hess 6c8a8dd13b add guard against enabling multiple rcs plugins 2008-07-30 14:32:48 -04:00
Joey Hess 12c5786df4 Merge branch 'tova' into autoconfig
Conflicts:

	debian/changelog
2008-07-29 15:54:45 -04:00
Joey Hess f0090d8c57 check generated pages in
I considered not checking them in, or making the checkin configurable.
However, then they would remain not checked in if edited by a user, which is
probably not desired.

Note that passing undef as the username/ip to rcs_commit_staged may not
result in ideal behavior; the commit may seem to come from "anonymous" with
some revision control systems. Most of them handle it a bit better and just
have it come from whatever user is running the build.
2008-07-29 15:51:25 -04:00
Joey Hess a02c3f46ea initial draft 2008-07-29 15:39:01 -04:00
Joey Hess 37245a9988 add refresh hook 2008-07-29 15:04:34 -04:00
Joey Hess 73af360e99 fix cgiurl check 2008-07-27 19:21:56 -04:00
Joey Hess e1f7146041 avoid clobbering example diffurl 2008-07-27 00:54:15 -04:00
Joey Hess 4ef96e2d99 Merge branch 'master' into autoconfig 2008-07-26 23:22:42 -04:00
Joey Hess 618e3c1075 use new style error handling 2008-07-26 23:15:35 -04:00
Enrico Zini e3713772f7 Added cutpaste plugin.
I'm wondering if cutandpaste wouldn't be a better name.
2008-07-26 23:08:17 -04:00
Enrico Zini 02078c406c Handle the case when HTML got tidied.
This fixes debian bug #492529.
2008-07-26 23:05:57 -04:00
Joey Hess 6a64d13352 allow --dumpsetup to be used w/o specifying srcdir and destdir
shortcut tried to use srcdir in checkconfig; change it to not so this will
work.
2008-07-26 23:00:44 -04:00
Joey Hess 6154dd03cb finish with rcs plugin conversion 2008-07-26 22:28:18 -04:00
Joey Hess 14cd75746a Version control backends promoted to first-class plugins 2008-07-26 22:27:24 -04:00
Joey Hess 82f0facb62 fixups 2008-07-26 21:14:07 -04:00
Joey Hess 42ac4ec009 remove default values in getsetup
They were a bit confusing, since they did not actually set the default, and
example values are sufficient.
2008-07-26 21:07:15 -04:00
Joey Hess 8051316904 add missing setup options, tweak others' display 2008-07-26 19:28:15 -04:00
Joey Hess 52bbdbb1a5 load all plugins when generating setup 2008-07-26 19:10:11 -04:00
Joey Hess f892cc8c50 two typos 2008-07-26 19:05:52 -04:00
Joey Hess cd029da493 typo 2008-07-26 14:56:10 -04:00
Joey Hess 26db34e1d6 adminemail may be undefined 2008-07-26 14:54:50 -04:00
Joey Hess 79f637a436 typo 2008-07-26 14:44:49 -04:00
Joey Hess 49e86d2562 turn booleans into questions 2008-07-26 14:43:47 -04:00
Joey Hess 1ba84c3a6b predefine pingurl 2008-07-26 14:38:58 -04:00
Joey Hess c2507d33cb allow account_creation_password to not be defined 2008-07-26 14:02:36 -04:00
Joey Hess 9169c3247f standardising and documenting getsetup 2008-07-26 13:07:48 -04:00
Joey Hess 0d7bc7402c fix plugin name 2008-07-26 00:45:32 -04:00
Joey Hess 426200b34a avoid fatal error in sanitize 2008-07-26 00:45:21 -04:00
Joey Hess 84c905ec20 finish adding getsetup hooks to plugins 2008-07-26 00:38:13 -04:00
Joey Hess d0bd30824e Merge branch 'master' into autoconfig 2008-07-25 19:27:15 -04:00
Joey Hess b7bf566f55 attachment: Use relative paths when inserting links. 2008-07-25 19:22:29 -04:00
Joey Hess 1f8b0460c3 added getsetup hooks for all plugins up to recentchanges 2008-07-25 18:05:55 -04:00
Joey Hess cf6c2f142f add getsetup
Also, avoid dying with a fatal error if multimarkdown is enabled and the
module doesh't load.
2008-07-25 17:52:00 -04:00
Joey Hess bf6198baf3 add getconfig for inline
Also, moved the pingurl getopt parsing to inline.
2008-07-25 17:24:52 -04:00
Joey Hess a71b9a1cf1 fix feed urls
The fix for colons involved adding "./" to some urls. Due to the weird way
inline called urlto, these snuck into feed urls and permalinks. Fix it by
adding an optional third parameter to urlto.
2008-07-25 16:16:44 -04:00
Joey Hess 89e0de5bc4 improved, possibly faster getelementsbyclass by willu 2008-07-25 01:43:37 -04:00
Joey Hess 99b59f2d62 toggle: Fix incompatability between javascript and webkit. 2008-07-25 01:24:20 -04:00
Joey Hess c2f621cb1c fix encoding issues with link conversion
Have to convert link text to page name going in.
And on the way out, need to replace spaces with underscores in the link
text, which is not normally done with titles.
2008-07-24 12:36:10 -04:00
Joey Hess 8b3d2ab0bc test suite and partial fix for encoding issues in link renaming 2008-07-23 21:04:11 -04:00
Joey Hess 762bf0b887 foldage 2008-07-23 19:25:46 -04:00
Joey Hess 985a34b09e fixup editpage links on rename 2008-07-23 19:20:11 -04:00
Joey Hess 7befc6deb3 link fixup on rename working 2008-07-23 19:12:05 -04:00
Joey Hess 4918c164e8 preserve case of subpage 2008-07-23 19:03:37 -04:00
Joey Hess 8b063a24d9 case preservation 2008-07-23 18:57:27 -04:00
Joey Hess 4691a2ad39 add renamepage hooks
Implemented for regular wikilinks, with a test suite.
2008-07-23 18:14:20 -04:00
Joey Hess 335a6a59e6 Merge branch 'master' into tova 2008-07-23 15:00:07 -04:00
Joey Hess 1d1767192c attachment: Do not escape _ when determining attachment filenames. 2008-07-23 14:58:39 -04:00
Joey Hess 29f32d0ba3 add a list of broken links after the rename 2008-07-22 20:30:54 -04:00
Joey Hess 1c9a3cb82b add a rename summary 2008-07-22 20:17:03 -04:00
Joey Hess 2b9615194e fix gettext 2008-07-22 19:44:31 -04:00
Joey Hess 421559b230 edit page fixup in postrename 2008-07-22 18:17:11 -04:00
Joey Hess 89b3bb7e38 check for absolute paths 2008-07-22 17:38:31 -04:00
Joey Hess 9776bbf853 Don't allow uploading an attachment with the same name as an existing page, to avoid confusion. 2008-07-22 17:12:20 -04:00
Joey Hess 114e20e948 typo 2008-07-22 17:03:28 -04:00
Joey Hess cbddb5a4b8 add rcs_commit_staged and rcs_rename
Implemented for git and svn so far.

Note that rcs_commit_staged does assume that the rcs has the ability to
"stage" multiple changes for a later commit. Support for this varies, but
all we really care about is staging removals and renames, which, AFAIK, all
modern rcs's support.
2008-07-22 16:14:33 -04:00
Joey Hess cf9620074a qualifiy 2008-07-22 15:07:07 -04:00
Joey Hess bac47cdecd make message a bit more generic 2008-07-22 15:06:59 -04:00
Joey Hess cbf1c8b810 rename checks improvements 2008-07-22 14:01:23 -04:00
Joey Hess 569d31d875 permission checking improvements
Break out into function so it can be done up-front before confirmation too.
2008-07-22 13:29:54 -04:00
Joey Hess ac1226031e avoid uninitialised value 2008-07-22 13:23:11 -04:00
Joey Hess a3e16cd29f really add 2008-07-21 22:44:37 -04:00
Joey Hess 0c9fe2f99c use check_canattach
As noted, this may be overkill..
2008-07-21 22:44:19 -04:00
Joey Hess f9cbe871ad factor out check_canattach
Other plugins will need to use this.
2008-07-21 22:41:31 -04:00
Joey Hess 96c529826d skeleton rename plugin 2008-07-21 22:30:43 -04:00
Joey Hess ed05e40566 error if nothing selected 2008-07-21 22:11:24 -04:00
Joey Hess 6e243a45e5 probably redundant symlink check 2008-07-21 21:57:58 -04:00
Joey Hess 18d2403647 Merge branch 'master' into tova
Conflicts:

	debian/changelog
2008-07-21 17:27:50 -04:00
Simon McVittie 09a5cdbb34 Don't prepend tagbase to tags if they start with "./" or "/".
That syntax made little sense previously, and this allows sites to put
"most" of their tags under $tagbase.
2008-07-21 22:02:55 +01:00
Joey Hess 97e21ae21c don't show an error if the image is missing, instead, a broken link 2008-07-21 16:53:52 -04:00
Joey Hess 7910f1c352 remove debugging 2008-07-21 16:53:46 -04:00
Joey Hess d724a26754 avoid internal error message when img uses just-deleted page
I think this used to be a fatal error, not just inline error, so I don't
know why it was never noticed, but if a page that an img directive mentions
gets deleted, bestlink() returns a file that no longer exists, and
srcfile() throws an error.

Note that bestlink's behavior of returning a deleted file could be
considered buggy. But, if it's changed to not do that, the page with the img
on it is not updated at all when the file is removed.
2008-07-21 16:38:40 -04:00
Joey Hess d9af10a1be typos 2008-07-21 16:21:59 -04:00
Joey Hess 90de84b442 typos 2008-07-21 16:21:46 -04:00
Joey Hess b182f5e573 need to untaint.. 2008-07-21 16:20:02 -04:00
Joey Hess 2461ce0de6 a few bugfixes
Including a check the the file is in the srcdir, as opposed to some other
directory.
2008-07-21 16:18:28 -04:00
Joey Hess af9c5e4bba support for removing attachments 2008-07-21 15:02:29 -04:00
Joey Hess a1df39ed4a simplified confirmation form
also, there's no titlepage conversion issues
2008-07-21 14:22:57 -04:00
Joey Hess b1b5860b29 touchups 2008-07-21 14:03:39 -04:00
Joey Hess 494e7ab8ba redirect after removal 2008-07-21 13:53:34 -04:00
Joey Hess c924c76bd8 basically, removal works
Still need to consider all the edge cases..
2008-07-21 13:50:12 -04:00
Joey Hess a204f86786 form tweaks; use title 2008-07-21 13:31:58 -04:00
Joey Hess b286ce04cb implemented form state saving and retrieval
This is overkill for delete, since it's only used on Cancel. But it will be
crucial for rename, so as to restore any pending edits after renaming a
page.
2008-07-21 13:23:07 -04:00
Joey Hess 8e7b31a19c basic removal form skeleton 2008-07-21 12:54:23 -04:00
Joey Hess 46617c23f4 rename skeleton.pm
Add '.example' so it's not installed with the other plugins.
2008-07-21 07:49:28 -04:00
Gabriel McManus e3b0584a49 Use correct term prefixes when searching.
The Z term prefix is for stemming and shouldn't be used here.
X is for custom fields.
2008-07-19 13:23:02 -04:00
Joey Hess 584f3e3061 Add a postscan hook.
* Add a postscan hook.
* search: Use postscan hook, avoid updating index when previewing.
2008-07-17 16:17:15 -04:00
Joey Hess c4f124d78a fix pos setting
What was really going on is that expanding a smiley modified the string and
reset the match process. Force set pos so it continues on from the expanded
smiley.
2008-07-17 13:11:47 -04:00
Joey Hess df3a8b183c smiley escaping fixes
Smileys need to be double-escaped to work, since the smiley plugin runs as
a sanitize hook, and markdown helpfully removes one level of escapes first.

There were some bugs in the smiley handling code that made escaped smileys
still be expanded. After unescaping a smiley, it needed to move pos forward
past it or the next pass would expand it.

Also, once the m//g got to the end, it seemed to loop back through and make
one more pass (a difference in perl 5.10's regexp exngine? I observed that
pos was undefined when this happened, so added a `last unless defined pos`.
2008-07-17 12:34:38 -04:00
Joey Hess 3096c8ea69 formatting etc 2008-07-16 17:43:42 -04:00
Joey Hess 2c05a34be1 Merge commit 'intrigeri/pedigree' 2008-07-16 17:31:15 -04:00
intrigeri 35668b87d3 pedigree rename to parentlinks: rename/adapt everything
* Renamed to parentlinks every single variable or function called
  pedigree
* Removed the parentlinks function from Render.pm
* Enabled the new parentlinks plugin by default
* Adapted testsuite and documentation to reflate the above facts

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-07-15 16:25:39 +02:00
intrigeri 486f460132 pedigree rename to parentlinks: renamed files, to start with
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-07-15 16:09:40 +02:00
intrigeri 55000fd779 pedigree: rewrote with different design
(and updated testsuite + docs accordingly)

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-07-15 13:06:52 +02:00
Joey Hess 2696e0c6db fixes 2008-07-14 23:00:29 -04:00
Joey Hess 76bda69a92 use prune to delete rendered files
This handles deleting empty directories too.
2008-07-14 22:45:12 -04:00
Simon McVittie b29d11b3c6 Fix aggregateinternal migration so it skips expired entries, and deletes output 2008-07-15 03:24:05 +01:00
Joey Hess af48316b1d Merge commit 'smcv/aggregateinternal' into aggregateinternal
Conflicts:

	IkiWiki/Plugin/aggregate.pm
2008-07-14 20:15:08 -04:00
Simon McVittie 302bb836f2 Use _aggregated as extension for internalized aggregation 2008-07-15 01:04:29 +01:00
Joey Hess 51bf0ea529 changes to debug message printing 2008-07-14 19:43:45 -04:00
Simon McVittie 50a5ab3c4e Add aggregateinternal mode to ikiwiki-transition.
Usage:
1. Update all pagespecs that use aggregated pages to use internal()
2. ikiwiki-transition aggregateinternal $srcdir $htmlext
   (where $srcdir and $htmlext are the srcdir and htmlext options in
   your .setup file)
3. Add aggregateinternal to your .setup file
4. Rebuild the wiki
2008-07-14 23:39:22 +01:00
Simon McVittie 18b3e970ff Merge commit 'origin/master' into aggregateinternal 2008-07-14 23:34:07 +01:00
intrigeri b391b5a80b pedigree: added DISTANCE loop variable
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-07-14 14:52:34 +02:00
intrigeri b857b229d8 pedigree: fix RELDEPTH in PEDIGREE_BUT_ROOT...
... at least when it's not used in the same template as
PEDIGREE_BUT_TWO_OLDEST (see Known bugs section in pedigree.mdwn for
details)

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-07-14 14:25:42 +02:00
intrigeri df42a5ef21 pedigree: added _but_root & _but_two_oldest loops
... after having learned a bit of Perl, knocked my head against
Perl references and arrays of hashes, tried to use some nice
functionnal programming constructs - no success - to make things
more generic... I'm back to the roots, with this simple code :)

Signed-off-by: intrigeri <intrigeri@boum.org>
2008-07-13 22:03:22 +02:00
intrigeri 16cf69477d pedigree: fixed misc bugs
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-07-13 22:03:06 +02:00
intrigeri f32369f669 added new plugin: pedigree
Signed-off-by: intrigeri <intrigeri@boum.org>
2008-07-13 22:02:23 +02:00
Joey Hess ffc99f5904 switch preprocess hooks to use error function 2008-07-13 15:05:34 -04:00
Joey Hess e4e3d7e2d4 convert fatal error to warning
Since perlmagick is not a hard dep, and goodstuff is enabled by default,
imgs should not crash builds
2008-07-12 20:21:42 -04:00
Simon McVittie 5c0896e674 Make aggregated items be internal pages if --aggregateinternal is used.
This addresses <http://ikiwiki.info/todo/aggregate_to_internal_pages/>
in a simple way. With this approach, a flag day is required, on which all
users of aggregated pages start to inline them using the internal() pagespec;
after that, the aggregateinternal option can safely be switched on in the
setup file (and the old aggregated pages can be deleted by hand).
2008-07-12 18:15:11 +01:00
Simon McVittie 9a184badf5 Stop prepending urn:uuid: to guids that look like UUIDs 2008-07-12 17:34:40 +01:00
Simon McVittie 415c8e0cb5 Rename [[!inline atomid="..."]] to [[!inline guid="..."]] to be consistent with [[!meta guid="..."]], which also outputs an Atom <id> 2008-07-12 17:12:37 +01:00
Simon McVittie 2bd8ada5a6 Accept [[!inline ... atomid="..."]] and use it to populate the feed's Atom <id>.
This is often the same as the feed's <link> (in which case it can be omitted) but sometimes it's a urn:uuid: URN instead.
2008-07-12 17:09:41 +01:00
Joey Hess f707d62481 Merge commit 'smcv/master' 2008-07-12 12:02:57 -04:00
Joey Hess d101269bde Move yesno function out of inline and into IkiWiki core, not exported. 2008-07-12 12:01:22 -04:00
Simon McVittie 1f26a1bf16 Bug fix: use &IkiWiki::pagetitle rather than nonexistent &pagetitle in meta plugin, so that PageSpecs with title(...) work again 2008-07-12 16:44:55 +01:00
Joey Hess ca30d95a78 rename uuid to guid 2008-07-12 10:59:45 -04:00
Joey Hess 37471e92d9 elide temp var 2008-07-12 10:49:12 -04:00
Simon McVittie 9c6444bf68 meta plugin: if uuid looks like it is in fact a UUID, prepend "urn:uuid" (otherwise leave it alone, so we can assign non-UUID <id>s to Atom items to avoid planet-flooding) 2008-07-11 23:57:47 +01:00
Simon McVittie e767f18867 inline plugin: if meta plugin is also enabled, and has collected a uuid for a page, then pass it into the rssitem/atomitem templates 2008-07-11 23:44:12 +01:00
Simon McVittie 9b34b879e2 meta plugin: also collect [[!meta uuid="..."]] 2008-07-11 23:42:38 +01:00
Joey Hess d73d4fed03 rename beautify_url to stress it only works on the path component 2008-07-11 10:33:41 -04:00
Joey Hess d5de560f50 beautify url recentchanges_link redirs to
This ensures that the same link is reached as is used on pages,
so browsers will know that the link on pages has been visited, and color it
appropriately.
2008-07-11 09:44:47 -04:00
Joey Hess dcab5e2e48 template: Add support for a BASENAME variable. 2008-07-10 15:25:42 -04:00
Joey Hess 06709cdf31 improve error message if virus checker fails w/o output 2008-07-09 16:53:03 -04:00
Joey Hess 2449c596af otl: Support utf-8 files. (Recai Oktaş) 2008-07-08 20:52:30 -04:00
Joey Hess ad02f69836 attachment: Support perl 5.8's buggy version of CGI.pm.
This is truely horribly disgusting. CGI::tmpFileName, in current perls, is
an undocumented function (which should be a clue..) that takes the original
filename of an uploaded attachment, and returns the name of the tempfile
that CGI has stored it in.

In old perls, though, CGI::tmpFileName does not take a filename. It takes
a key from the object's {'.tmpfiles'} hash. This key is something
crazy like '*Fh::fh00001group' -- apparently the stringification of a
filehandle object.

Just to add to the fun, tmpFileName doesn't take the key, it expects a
refernce to the key. Argh?!

But the fun doesn't stop there, because in perl 5.8, CGI.pm is also broken
in two other ways. The upload() method is supposed to return a filehandle
to the temp file. It doesn't. The param() method is supposed to return
a filehandle to the temp file, that stringifies to the original filename.
It returns just the original filename, no filehandle.

Combine all these bugs, and you end up with this disgusting commit. Since
I have no way to get the filehandle, I *need* to get the tempfile name.
If I had the filehandle, I could probably pass it into tmpFileName, and
it might strigify to the right key name. But I don't, so the only way to
determine the key is to grub through the .tmpfiles hash ourselves.

And finally, one the temp file name is discovered, a filehandle can finally
be obtained by (re)opening it.

I recommend that this commit be reverted when perl 5.8 is a mercifully
faded memory.

I'm really, really, really glad I'm actually being paid for working on
this right now!
2008-07-08 18:10:53 -04:00
Joey Hess 2e5785907d explicitly set form type to multipart
This is the default in unstable's formbuilder, but not in stable's,
and CGI multipart is needed for fule uploads.
2008-07-08 17:18:02 -04:00
Joey Hess 22839215fb check for tempfile being empty 2008-07-08 16:21:01 -04:00
Joey Hess 6f3c980e2b undef $fh before opening 2008-07-08 12:16:36 -04:00
Joey Hess 66f35e30dc another try at dealing with CGI.pm problem
open the temp file if all attempts to get a fd fail
2008-07-08 11:25:30 -04:00
Joey Hess 71f10579c0 attachment: Support old versions of CGI.pm that lack an upload method. 2008-07-08 10:42:58 -04:00
Joey Hess f156308aef attachment: Fix an uninitialised value warning when editing a page that currently has no attachments. 2008-07-08 09:40:46 -04:00
Joey Hess dbbc1e4040 minor improvements 2008-07-07 01:54:28 -04:00
Gabriel McManus 7b8f4d2d06 search: generate configuration files once only when rebuilding 2008-07-07 01:53:06 -04:00
Joey Hess 2f3a279f68 add virus checking to attachments plugin 2008-07-06 17:36:26 -04:00
Joey Hess 788c1e9eca avoid uninitialised value warnings 2008-07-06 17:35:50 -04:00
Joey Hess 6e2dc2b1fd avoid uninitialised value 2008-07-06 17:00:35 -04:00
Joey Hess 05124f9a86 editpage escaping fixes
* The editpage form now uses the raw page name, not the page title, in its
  'page' cgi parameter. Using the title was ambiguous and made it
  impossible to tell between some pages, like "foo/bar" and "foo__47__bar",
  sometimes causing the wrong page to be edited.
* This change means that some edit links need to be updated.
  Force a rebuild on upgrade to this version.
* Above change also allowed really fixing escaped slashes from the blogpost
  form.
2008-07-06 15:52:04 -04:00
Joey Hess ca6d9da279 link to pagespec/attachment 2008-07-02 18:22:49 -04:00
Joey Hess c150590e27 factor out glob2re 2008-07-02 18:22:49 -04:00
Joey Hess 84e6c4fa66 add mimetype checking 2008-07-02 18:22:49 -04:00
Joey Hess ba707cdcd9 add user and ip support to attachment pagespecs 2008-07-02 16:33:35 -04:00
Joey Hess edfbd7e1aa toggle: Add javascript to top of page, not to end. This avoids flicker since closed toggles will not be displayed as the page is loading. 2008-07-02 16:14:18 -04:00
Joey Hess 1289beb53b xhtml fixes 2008-07-02 16:08:48 -04:00
Joey Hess 895faed642 toggle: Add support for toggles that are open by default.
Also fix to work in preview mode.
2008-07-02 16:02:01 -04:00
Joey Hess d593533af5 attachments interface visibility toggling 2008-07-02 15:42:32 -04:00
Joey Hess e998235240 export javascript, and support default-open toggles 2008-07-02 15:33:52 -04:00
Joey Hess ed25c2abf2 fixes 2008-07-01 20:35:54 -04:00
Joey Hess 883da338a4 some fit and finish fixes 2008-07-01 19:05:15 -04:00
Joey Hess 0abaf5aaae only show one sig fig 2008-07-01 18:41:30 -04:00
Joey Hess e8a13c32ba display human sizes 2008-07-01 18:40:42 -04:00
Joey Hess 8441d31535 add both kinds of links 2008-07-01 18:08:31 -04:00
Joey Hess c1e9e121b7 basic attachment list 2008-07-01 17:19:38 -04:00
Joey Hess 14cb2b0869 save attachments when page is saved too
A user might specify an attachment, but not click the upload button,
and just save the whole page instead.
2008-07-01 16:13:47 -04:00
Joey Hess 1405006fbf check attachments in and refresh 2008-07-01 15:35:01 -04:00
Joey Hess e87c3ae6df add allowed attachments field to admin prefs 2008-07-01 14:02:30 -04:00
Joey Hess 00962f589a minor optimisation 2008-07-01 13:51:22 -04:00
Joey Hess d7ca2f8f9b fix expensive move code path 2008-07-01 13:48:07 -04:00
Joey Hess 7cd40ea4eb better approach for cgi upload disabling
Make it a config setting, this way subtle load order issues don't come into
play. (As much?)
2008-07-01 13:43:32 -04:00
Joey Hess 5aee8d937d bugfixes 2008-07-01 13:39:02 -04:00
Joey Hess a78a981792 attachment location
Put the attachment in a subdir of the page it's attached to,
unless that page is an "index" page.
2008-07-01 13:31:09 -04:00
Joey Hess de6ed410bc reorder
canedit should fail first as it's a less expensive and harder to pass test
2008-07-01 13:22:11 -04:00
Joey Hess dbf23748dd call check_canedit
Needed to prevent uploads of locked pages as attachments.
2008-07-01 13:20:42 -04:00
Joey Hess cec45b69da bugfix; support pagetype of "0" 2008-07-01 00:43:19 -04:00
Joey Hess 4fa115fdb5 copy the attachment into srcdir 2008-07-01 00:42:42 -04:00
Joey Hess 49514f39f6 fix some messages 2008-06-30 23:32:08 -04:00
Joey Hess b01ee9b3b3 add an ispage limit 2008-06-30 23:17:01 -04:00
Joey Hess 622033f5d6 minor improvements 2008-06-30 23:04:37 -04:00
Joey Hess 0a37c45f32 basic attachment plugin, unfinished
Currently includes UI, and a few tests of the attachment, as well as the
framework to extend pagespecs to test attachments. Does not actually save
the file yet.
2008-06-30 22:58:33 -04:00
Joey Hess e1d9747be1 remove unused editpage title
The title was set to editpage, but then always changed.
And some code tested for this. Remove this dead code.
2008-06-30 20:33:39 -04:00
Joey Hess b66f9a1981 call format hooks when generating page previews
* toc: Revert change in 2.45 that made it run at sanitize time. This breaks
  use of toc in a sidebar.
* Call format hooks when generating page previews, thus fixing toc display
  there, as well as fixing inlins to again display in page previews, since
  it's started using format hooks. This also allows several other things,
  like embed, that use format hooks, to work during page preview time.
* Format hooks should not rely on getting an entire html document, as they
  will only get the body during page preview.
* toggle: Deal with preview mode when adding javascript.
2008-06-28 23:08:24 -04:00
Joey Hess 00503f25cd smiley: Generate links relative to the destpage. (Fixes a reversion from 2.41.) 2008-06-28 16:58:43 -04:00
Joey Hess 17a09ef88e pagesources might not be populated 2008-06-24 20:47:15 -04:00
Joey Hess 7fbbcc1615 only convert urls if the module is installed 2008-06-24 20:38:41 -04:00
Joey Hess a4d693f659 formatting 2008-06-24 20:35:21 -04:00
Joey Hess 532d4b0d5f rename to txt 2008-06-24 20:33:41 -04:00
Joey Hess 3f6d3f3be8 initial version 2008-06-24 20:33:03 -04:00
Bernd Zeimetz 4a9567595a Disable handling of "bare" links by the creole plugin.
This change needs libtext-wikicreole-perl (>= 0.05-2).
Also removing custom link function, there's no need for it -
if it is not defined, the unmodified markup will be returned.
2008-06-24 16:52:23 -04:00
Bernd Zeimetz b16c43a440 `template` option for aggregate.pm.
Allows to specify the template file which is used to
create the html pages.
2008-06-21 16:23:39 -04:00
Joey Hess 1b6b4da3a3 avoid creole parsing wikilinks
ikiwiki already does, and escaped links should not be processed by creole
after ikiwiki de-escapes them
2008-06-19 19:54:46 -04:00
Joey Hess 98095ccac4 creole: New plugin from Bernd Zeimetz. Closes: #486930 2008-06-19 19:11:18 -04:00
Joey Hess bd7edfd9ca textile: The Text::Textile perl module has some regexps that fail if input is flagged as utf-8, but contains invalid characters such as 0x92. To prevent it from crashing, re-encode the content before calling it, which will ensure that it's really utf-8. 2008-06-16 15:43:37 -04:00
Joey Hess 4da54999de meta: Store "description" in pagestate for use by other plugins.
map: Support show=description.
2008-06-15 19:08:50 -04:00
Joey Hess ebb2b9cbda bugfixes for show=title
Can't sort by titles; the tree building logic requires that the list be
sorted by page name.

Setting linktext => $page is not the same as omitting it entirely. So some
contortions to only set linktext when the page name is not being shown.
2008-06-15 19:08:24 -04:00
Joey Hess ce029bfe04 check that parent hash exists, to avoid creating it 2008-06-15 18:10:47 -04:00
Joey Hess 069b10cc6a note about titles and dependencies 2008-06-15 18:09:46 -04:00
Joey Hess 78a7f6938f style changes
Reindented, moved a TODO from page to code, trimmed some unnecessary
comments, and simplified the use of mkstemp.
2008-06-15 16:26:15 -04:00
Joey Hess a7a1d00e1c initial add 2008-06-15 16:25:18 -04:00
Joey Hess 71d984b310 map: Add a "show" parameter. "show=title" can be used to display page titles, rather than the default page name. Based on a patch from Jaldhar H. Vyas, Closes: #484510 2008-06-15 16:11:11 -04:00
Joey Hess 5807f1de04 fix two build bugs
* ikiwiki-mass-rebuild: Make group list comparison more robust.
* search: Work around xapian bug #486138 by only stemming locales
  in a whitelist.
2008-06-13 13:05:44 -04:00
Joey Hess ecfb14f7d1 Don't generate empty title attributes, etc, and allow setting defaults for class and id too. 2008-06-08 00:02:33 -04:00
Joey Hess f6b47b0d1c img: Support captions. 2008-06-07 23:45:40 -04:00
Joey Hess 3215b5a982 finishing touches on the new search plugin
- Add a Help link.
- If the pageterm is too long, hash it.
2008-06-04 15:24:28 -04:00
Joey Hess ea5da19189 fix uninitialized value problem
This occurred when a plugin, loaded earlier, filled out a template in its
checkconfig, before recentchanges's checkconfig had run. Since such a
template won't be a recentchanges template, just test for the value being
uninitialized and skip processing.
2008-06-04 15:00:24 -04:00
Joey Hess e4119f048c The search interface now allows searching for a page by title ("title:foo"), as well as for pages that contain a given link ("link:bar"). 2008-06-04 14:13:21 -04:00
Joey Hess 319e2c94de it's not $title, try the other variable 2008-06-04 13:41:15 -04:00
Joey Hess 295e958da5 don't use meta title
Using the title obscured path info, and made search results look
inconsistent. Since nothing else uses the title like that, it didn't make
sense for search to.
2008-06-04 13:12:10 -04:00
Joey Hess bf9829352b have the xapian stemmer use a language based on LANG 2008-06-04 02:41:02 -04:00
Joey Hess 27376abb3c also decode html entities in the title 2008-06-04 01:50:51 -04:00
Joey Hess 4a51e384eb decode html entities 2008-06-04 01:34:26 -04:00
Joey Hess 9976c31aca fix clearing index on page deletion 2008-06-04 01:28:35 -04:00
Joey Hess 1dddec0ba9 Pass a destpage parameter to the sanitize hook.
Because the search plugin needed it, also because it's one of the few
plugins that didn't already have it.

I also considered adding it to htmlize, but I really cannot imagine caring
what the destpage is when htmlizing. (I'll probably be poven wrong later.)
2008-06-04 01:24:23 -04:00
Joey Hess 1546b48b97 move indexing to sanitize hook
I think this will give better results overall.

I made %IkiWiki::preprocessing accessible and used it to avoid indexing
at unnecessary points.
2008-06-04 00:58:46 -04:00
Joey Hess ce826411b2 more search improvements 2008-06-04 00:38:40 -04:00
Joey Hess aefe5dd9cb more substr fixes 2008-06-04 00:25:56 -04:00
Joey Hess 53b188ed35 add a colon to disambiguate
The omega docs suggest doing this if the term may contain upper case, which
it could here.
2008-06-03 23:59:25 -04:00
Joey Hess 9c717d0873 avoid warning
"substr outside of string"
2008-06-03 23:58:19 -04:00
Joey Hess 7fc29119db use "U" term
this seems to be the thing to use for a unique id
2008-06-03 23:56:45 -04:00
Joey Hess 3ba723d79a don't loop forever 2008-06-03 23:55:00 -04:00
Joey Hess 6b7d90d88a fixed most of the xapian todos 2008-06-03 23:52:56 -04:00
Joey Hess 18b0aa1f13 prettify page names, and drop the redunadant url display 2008-06-03 22:11:33 -04:00
Joey Hess 02357b0b32 fix toindex 2008-06-03 21:59:21 -04:00
Joey Hess 44fde6cbff first pass at doing xapian indexing
Still some TODOs to fill in.
2008-06-03 21:14:56 -04:00
Joey Hess 8a6a5320ed search: Converted to use xapian-omega.
Everything is done except for the actual indexing. I plan to do incremental
indexing as pages change.
2008-06-03 15:29:54 -04:00
Joey Hess 99e5e6dd08 inline: The optimisation in 2.41 broke nested inlines. Detect those and avoid overoptimising. 2008-05-31 15:10:23 -04:00
Joey Hess 0a35e8a352 haiku: Generate valid xhtml. 2008-05-30 19:10:58 -04:00
Joey Hess e943812dc9 hashed password support, and empty password security fix
This implements the previously documented hashed password support.

While implementing that, I noticed a security hole, which this commit
also fixes..
2008-05-30 17:35:34 -04:00
Joey Hess 9d93029f01 teximg: If the log isn't written, avoid ugly error messages. 2008-05-29 19:29:40 -04:00
Joey Hess b0a7b2f3d7 teximg: Fix logurl. 2008-05-29 19:28:46 -04:00
Joey Hess d5d56a24bd When calling decode_utf8 on known-problimatic content in aggregate, explicitly pass 0 (FB_DEFAULT) as the second parameter. Apparently perl 5.8 needs this to avoid crashing on malformed utf-8, despite its docs saying it is the default. 2008-05-28 15:38:04 -04:00
Thomas Schwinge 1e16ab178d Avoid ``uninitialized value'' warning when there actually is no difference between the two versions. 2008-05-25 14:25:34 -04:00
Joey Hess 8a888a8fed inline: Display a message if the 'pages' parameter is missing, before it just expanded to nothing. 2008-05-15 17:22:54 -04:00
Joey Hess 833610a5b4 orphans: As a special case, the toplevel index page is never considered an orphaned page. 2008-05-15 16:47:44 -04:00
Joey Hess fba4a198b5 mdwn: Add a multimarkdown setup file option. 2008-05-13 12:43:25 -04:00
Joey Hess fb3d5b4800 Fixes for behavior changes in perl 5.10's CGI
Something has changed in CGI.pm in perl 5.10. It used to not care
if STDIN was opened using :utf8, but now it'll mis-encode utf-8 values
when used that way by ikiwiki. Now I have to binmode(STDIN) before
instantiating the CGI object.

In 57bba4dac1, I changed from decoding
CGI::Formbuilder fields to utf-8, to decoding cgi parameters before setting
up the form object. As of perl 5.10, that approach no longer has any effect
(reason unknown). To get correctly encoded values in FormBuilder forms,
they must once again be decoded after the form is set up.

As noted in 57bba4da, this can cause one set of problems for
formbuilder_setup hooks if decode_form_utf8 is called before the hooks, and
a different set if it's called after. To avoid both sets of problems, call
it both before and after. (Only remaining problem is the sheer ugliness and
inefficiency of that..)

I think that these changes will also work with older perl versions, but I
haven't checked.

Also, in the case of the poll plugin, the cgi parameter needs to be
explcitly decoded before it is used to handle utf-8 values. (This may have
always been broken, not sure if it's related to perl 5.10 or not.)
2008-05-12 20:44:22 -04:00
Joey Hess 489a6fc8bf paste-o 2008-05-08 16:12:09 -04:00
Joey Hess a50fb83394 add --delete-bucket option 2008-05-08 16:11:39 -04:00
Joey Hess b8d81b7b7f amazon s3 index file improvements
Turns out duplicate index files do not need to be stored when usedirs is in
use, just when it's not. Ikiwiki is quite consistent about using page/ when
usedirs is in use. (The only exception is the search plugin, which needs
fixing.)

This also includes significant code cleanup, removal of a incorrect special
case for empty files, and addition of a workaround for a bug in the amazon
perl module.
2008-05-08 15:51:09 -04:00
Joey Hess 8861af53db simplify key determination code 2008-05-08 13:00:05 -04:00
Joey Hess 71c6cddcb0 remove debugging 2008-05-07 23:58:01 -04:00
Joey Hess 0850cde5a6 implemented pruning, s3 support now complete-ish 2008-05-07 23:51:25 -04:00
Joey Hess db30d61f59 forgot to add.. 2008-05-07 23:39:52 -04:00
Joey Hess ec866f8370 Optimised file statting code when scanning for modified pages; cut the number of system calls in half. (Still room for improvement.) 2008-05-07 14:11:56 -04:00
Joey Hess b144831e46 pinger/pingee now tested and working 2008-05-06 19:06:53 -04:00
Joey Hess 457de90f5f POSIX::setsid is not exported per default 2008-05-06 18:41:56 -04:00
Joey Hess 1f88cad3a2 aggregate: Add support for web-based triggering of aggregation for people stuck on shared hosting without cron. (Sheesh.) Enabled via the `aggregate_webtrigger` configuration optiom. 2008-05-05 20:20:45 -04:00
Joey Hess b2dea99417 Fix ugly display when editing a page that has vanished.
srcfile now has an optional second parameter to avoid it throwing an error
if the source file does not exist.
2008-05-02 13:02:07 -04:00
Joey Hess 9fca7f2f8b avoid uninitialised value 2008-05-02 13:01:51 -04:00
Joey Hess 6f852e88e3 anonk: Add anonok_pagespec configuration setting that can be used to allow anonymous users to edit only matching pages. Closes: #478892 2008-05-01 14:58:23 -04:00
Joey Hess bb51e81762 img: Support a title attribute, will be passed through to html. Closes: #478718 2008-04-30 12:58:36 -04:00
Joey Hess 9652cdfe2e toc: Add the table of contents at sanitize time, rather than at format time. This allows the toc to be displayed when previewing an edit. It also avoids headers in the page template from showing up in the toc. 2008-04-26 15:13:01 -04:00
Joey Hess 04e7467807 need to handle urls to images the same
Also, simplified finding the url to the top of the site.
2008-04-03 16:37:05 -04:00
Manoj Srivastava c207086282 Bug#473987: [PATCH] Links relative to baseurl mangled in atom/rss feeds
tag 473987 +patch
thanks
Hi,

The issue is that we need to convert relative links to absolute
ones for atom and rss feeds -- but there are two types of
relative links. The first kind, relative to the current
document ( href="some/path") is handled correctly. The second
kind of relative url is is relative to the http server
base (href="/semi-abs/path"), and that broke.

It broke because we just prepended the url of the current
document to the href (http://host/path/to/this-doc/ + link),
which gave us, in the first place:
 http://host/path/to/this-doc/some/path        [correct], and
 http://host/path/to/this-doc//semi-abs/path   [wrong]

The fix is to calculate the base for the http server (the base of
the wiki does not help, since the base of the wiki can be
different from the base of the http server -- I have, for example,
"url => http://host.name.mine/blog/manoj/"), and prepend that to
the relative references that start with a /.

This has been tested.

Signed-off-by: Manoj Srivastava <srivasta@debian.org>
2008-04-03 16:27:29 -04:00
Joey Hess de8c34df59 aggregate: Correct a mistake in the code that dummy up a guid for feeds lacking one. 2008-04-03 02:36:01 -04:00
Joey Hess cb8d1c8642 revert destpage part of f7bdc2385
destpage does not normally need to be worried about when creating other files
as part of the process of rendering a page. Using destpage results in
inlined pages creating two copies of such files. It works to not use destpage
in this case because the inlining page depends on the source page, so if the
source page is modified or deleted the inlining page will be updated.
2008-03-23 20:01:26 -04:00
Joey Hess d2911a20a6 inline: Allow the "feedshow" parameter to take values greater than the value for "show". 2008-03-23 17:39:03 -04:00
Joey Hess 1c2f59239f typos 2008-03-21 19:09:29 -04:00
martin f. krafft e3624de63c Allow external plugins to return no value
Instead of using the XML-RPC v2 extension <nil/>, which Perl's
XML::RPC::Parser does not (yet) support (Joey's patch is pending), we
agreed on a sentinel: {'null':''}, that is, a hash with a single key
"null" pointing to the empty string.

The Python proxy automatically converts None appropriately and raises an
exception if a hook function should, by weird coincidence, attempt to
return {'null':''}.

Signed-off-by: martin f. krafft <madduck@madduck.net>
2008-03-21 15:07:10 -04:00
Joey Hess 14b3e645a8 work around perl warning 2008-03-21 05:08:04 -04:00
Joey Hess 42b6a6178c delete inline data after it's used 2008-03-21 04:51:14 -04:00
Joey Hess f937c1fb80 crazy optimisation to work around slow markdown
Markdown is slow. Especially if it has to process an enormous page. The
most common enormous page is currently the recentchanges page, which gets
processed a lot, and contains very little actual markdown. Most of it is a
big <div>, which markdown skips ... slowly.

This is a rather sick optimisation to work around markdown's speed issues.
Now inline inserts a small, dummy div, allows markdown to quickly render
the actual page content, then replaces the dummy with the actual inlined
pages later.

Results: Rendering just a recentchanges page, with diffs included, dropped
from 4.5 seconds to 2.7 seconds on my laptop. Building the entire wiki
dropped from 46.6 seconds to 39.5 seconds.

(It would be better if inline were a *post*-processor directive.)
2008-03-21 04:48:26 -04:00
Joey Hess 0b9e849aba process smilies in a sanitize hook
I had to move it to sanitize so all the markup is htmlized, so it can scan
for <pre> and <code>.
2008-03-21 03:16:28 -04:00
Joey Hess cd6055a893 another fix
I'm suprised that the second m//g didn't seem to clobber @-, but I don't
want to rely on that, so preserve it beforehand.
2008-03-21 02:57:34 -04:00
Joey Hess 88b5a0ece5 various fixes and simplifications 2008-03-21 02:55:14 -04:00
Joey Hess 44824dba1b smiley: Detect smileys inside pre and tags, and do not expand. 2008-03-21 02:43:20 -04:00
Joey Hess 628467125c Close meta tag for redir properly. 2008-03-21 00:24:06 -04:00
Joey Hess 9f3788e2a2 optimisation, only load openid module when signing in
This makes the CGI about .2 seconds faster when editing pages etc.
2008-03-19 21:12:18 -04:00
Joey Hess d85c9660c5 fix setstate
Same fix as in d7f1292c31
2008-03-19 15:49:37 -04:00
Joey Hess 6eb3cf7e76 make setargv take an array
for consistentcy with getargv, which returns one
2008-03-19 15:49:00 -04:00
Joey Hess d7f1292c31 fix setvar
It was incorrectly setting the value to the number of items in @_, ie,
always 1.
2008-03-19 15:18:38 -04:00
Joey Hess f003e97d10 getargv needs to return a list reference
xml rpc only allows functions to return a single value, no lists. So getargv
needs to return a list reference, which means that the caller will see an xml
rpc array.
2008-03-19 15:12:59 -04:00
Joey Hess ba480baa9e * external: Add getargv and setargv methods to allow access to ikiwiki's
@ARGV.
2008-03-15 14:19:49 -04:00
Joey Hess 5a7a89ffc5 * htmltidy: Pass --markup yes, in case tidy's config file disabled it. 2008-03-15 13:58:08 -04:00
Joey Hess e7ce86db11 * external: Fix support of XML::RPC::fault. 2008-03-15 13:49:22 -04:00
Joey Hess 7b6686ce70 * Fix expiry of old recentchanges changeset pages. 2008-03-14 18:55:17 -04:00
Joey Hess 16299dbae8 load HTML::Entities at top
Used in several subs, not all of which load it on demand, this seems simpler.
2008-03-14 18:43:54 -04:00
Joey Hess bc2671082b no need to use HTML::Entities, as it's loaded on demand by code below 2008-03-12 18:52:33 -04:00
Joey Hess 99c65a4c0e * Use absolute url for feedurl when filling out the feed templates.
Closes: #470530
2008-03-12 18:49:41 -04:00
Joey Hess 862ca19eb1 truncate recentchangesdiffs after 200 lines
This works around a perl crasher bug, and also avoids bloating pages
with enormous diffs.

rcs_recentchanges modified to return a list in an array context.
2008-03-12 15:45:10 -04:00
Joey Hess f7bdc2385d * Use forcebaseurl to make page previews be displayed with the html base
set to the destination page. This avoids need for hacks to munge the urls
  in preview mode, which fixes several bugs.
* Several destpage fixes in plugins.
2008-03-12 14:21:48 -04:00
Joey Hess 51ee2a2eab fix syntax error 2008-03-12 10:35:25 -04:00
martin f. krafft d02e350a69 Correct meta.robots attribute value->content
This was a silly typo, sorry. <meta ...> takes an attribute content, not
value.

Signed-off-by: martin f. krafft <madduck@madduck.net>
2008-03-11 18:37:04 -04:00
martin f. krafft c471d5425f Generate openid2 headers as well
This causes meta.openid to also generate the openid2 headers.

Signed-off-by: martin f. krafft <madduck@madduck.net>
2008-03-11 15:53:21 -04:00
martin f. krafft 2325525713 Let meta.openid set X-XRDS-Location header
Adds an optional xrds-location parameter to the openid meta handler,
which allows for XRDS delegation.

A good document on XRDS is
http://www.windley.com/archives/2007/05/using_xrds.shtml

Signed-off-by: martin f. krafft <madduck@madduck.net>
2008-03-11 15:51:11 -04:00
Joey Hess eec482aa65 test for Text::Markdown::[Mm]arkdown and use the available one
Markdown is such a splintered mess.. The current debian package provides
only Text::Markdown::Markdown, while all versions of Text::Markdown support
Text::Markdown::markdown, and old versions also support the capitalised version,
while new ones don't.

It's getting to the point where `grep /markdown/i %symbol_table` is the only
sane way to figure out what function to call..
2008-03-04 20:29:52 -05:00
Joey Hess 0217eebf49 * Use Text::Markdown::markdown, since version 1.0.16 of Text::Markdown
no longer supports Text::Markdown::Markdown. All old versions of
  Text::Markdown also support the lower-case version.
2008-03-04 20:17:55 -05:00
Joey Hess d93aaed791 * Add recentchangesdiff plugin that adds diffs to the recentchanges feeds.
* rcs_diff is a new function that rcs modules should implement.
* Implemented rcs_diff for git, svn, and tla (tla version untested).
  Mercurial and monotone still todo.
2008-03-03 15:53:34 -05:00
martin f. krafft c10cfb27d1 Add robots tag to meta plugin
Add special handling for <meta name="robots" ...> which needs not be
scrubbed as it's harmless.

Signed-off-by: martin f. krafft <madduck@madduck.net>
(cherry picked from commit b15d0299a7f7b147e89d8a202d6cca1c21491af2)
2008-03-02 18:04:09 -05:00
Adeodato Simó a8f08ab8e1 Make directives generated by shortcuts accept a `desc` parameter.
(cherry picked from commit 252da396bfa728b99af7c9bb304a7b5f3f6d94e6)
2008-03-02 18:04:09 -05:00
Adeodato Simó be0b4f603f Allow colons in URLs after the first slash
A new regexp fixes this bug:
http://ikiwiki.info/bugs/No_link_for_blog_items_when_filename_contains_a_colon/

I traced this down to htmlscrubber. If disabled,
it works. If enabled, then $safe_url_regexp
determines the URL unsafe because of the colon and
hence removes the src attribute.

Digging into this, I find that RFC 3986 pretty
much discourages colons in filenames:

"""
A path segment that contains a colon character
(e.g., "this:that") cannot be used as the first
segment of a relative-path reference, as it would
be mistaken for a scheme name. Such a segment must
be preceded by a dot-segment (e.g., "./this:that")
to make a relative- path reference.
"""

on the other hand, with usedirs, any link to
another page will be prepended by ../ anyway, so
that makes them okay again.

The solution still seems not to use colons.

In any case, htmlscrubber should get a new regexp,
courtesy of dato.

I have tested and verified this.

Signed-off-by: martin f. krafft <madduck@madduck.net>
2008-02-29 19:29:44 +01:00
Joey Hess 4eabb3cb7a * inline: When forcing urls absolute for rss feeds, skip mailto and other
such urls.
2008-02-24 17:07:56 -05:00
Joey Hess f7303db5a1 * Fix another preview will_render bug. This one involved inline,
which forced a scan of the page to make available metadata that
  appeared after the inline directive. Problem is that scan made it forget
  about any other files rendered due to the page. The scan also turns out
  to be unnecessary now, since meta persistently stores state and it's
  always available. So it was just removed.
2008-02-24 15:36:25 -05:00
Joey Hess 8be2b60aac * The search plugin needs to override <base> to point to the directory
containing ikiwiki.cgi, but this should not change the urls to the style
  sheets etc. Add a new forcebareurl parameter to misctemplate to allow
  it to do that.
2008-02-14 15:20:49 -05:00
Joey Hess 1de1fb15a0 * camelcase: Convert to use new linkify and scan hooks rather than the old
hack.
2008-02-11 23:04:19 -05:00
Joey Hess 4763514861 * Add the linkify and scan hooks. These hooks can be used to implement
custom, first-class types of wikilinks.
* Move standard wikilink implementation to a new wikilink plugin, which
  will of course be enabled by default.
2008-02-11 22:48:27 -05:00
Joey Hess 4aab5f0a73 * Generate XML RPC messages with the encoding set to utf-8 instead
of XML::RPC's default of us-ascii. Allows interoperation with
  python's xmlrpc library, which threw invalid encoding exceptions and
  caused the rst plugin to hang.
2008-02-11 00:11:49 -05:00
Joey Hess c6fc554c54 use quotemeta when building the regexp 2008-02-10 19:02:12 -05:00
Josh Triplett 728dfd9595 Allow the smb: URI scheme. 2008-02-10 15:08:56 -08:00
Josh Triplett 502cd00ec7 Allow the snews: URI scheme. 2008-02-10 15:05:11 -08:00
Josh Triplett ec9d3ab549 Do not allow the steam: URI scheme. 2008-02-10 14:59:08 -08:00
Josh Triplett 3cda22a27f Match literal '.' in URI schemas containing '.', rather than matching any character 2008-02-10 14:50:30 -08:00
Joey Hess bbcf878f75 * meta: Check that the urls provided for authorurl, permalink, and openid
are safe and can't contain javascript.
2008-02-10 17:17:44 -05:00
Joey Hess 4bfdbd4858 export $safe_url_regexp 2008-02-10 17:07:21 -05:00
Josh Triplett d20e24b636 Also filter the attributes cite, longdesc, and usemap, which can contain URIs 2008-02-10 13:59:37 -08:00
Joey Hess 2078f706d6 add parens around scheme regexp 2008-02-10 16:29:46 -05:00
Josh Triplett a7be7bdf56 Do not allow the about: URI scheme
Some browsers interpret about: URIs like a limited version of data:
URIs.  In particular, some versions of Internet Explorer interpret
arbitrary HTML content in about: URIs.
2008-02-10 13:23:28 -08:00
Joey Hess dfd6bb3854 fix data:image handling 2008-02-10 15:24:03 -05:00
Joey Hess d7e0c035e5 * htmlscrubber security fix: Block javascript in uris.
* Add htmlscrubber test suite.
2008-02-10 13:16:40 -05:00
Joey Hess a4b2e77077 add support for prefix_directives 2008-02-05 16:14:38 -05:00
Joey Hess f64ef7deb6 proper fix for the preview/will_render issue 2008-02-04 18:46:34 -05:00
Joey Hess b37dc9c926 preview shouldn't show the feed buttons or post form 2008-02-04 18:44:54 -05:00
Joey Hess bf522a347f * inline: Add new `allowrss` and `allowatom` config options. These can be
used if you want a wiki that doesn't default to generating rss or atom
  feeds, but that does allow them to be turned on for specific blogs.
2008-02-04 18:36:50 -05:00
Joey Hess 85de2f7bc4 the old code worked, suprisingly, but I prefer this form 2008-02-04 18:05:40 -05:00
Joey Hess d1c4899a22 * inline: When previewing, still call will_render on rss/atom files,
just avoid actually writing the files. This is necessary because ikiwiki
  saves state after a preview (in case it actually *did* write files),
  and if will_render isn't called its security checks will get upset
  when the page is saved. Thanks to Edward Betts for his help tracking this
  tricky bug down.
2008-02-04 17:58:23 -05:00
Joey Hess 9d54cc4659 implement aggregate_locking design
Now aggregation will not lock the wiki. Any changes made during aggregaton are
merged in with the changed state accumulated while aggregating. A separate
lock file prevents multiple concurrent aggregators. Garbage collection
of orphaned guids is much improved. loadstate() is only called once
per process, so tricky support for reloading wiki state is not needed.

(Tested fairly thuroughly.)
2008-02-03 16:48:26 -05:00
Joey Hess 38affb0c1c add aggregate locking functions 2008-02-03 15:17:15 -05:00
Joey Hess e57749b702 * recentchanges: Exipre all *._change pages, even if the directory
they're in has changed.
2008-02-03 14:51:03 -05:00
Joey Hess 340fe9707c * recentchanges: Improve handling of links on the very static changes pages
by thunking to the CGI, which can redirect to the page, or allow it to be
  created if it doesn't exist.
2008-02-03 14:48:20 -05:00
Joey Hess 42e5b8dfdc prototype fix 2008-02-03 14:22:25 -05:00
Joey Hess 1f6591f0a6 * aggregate: Revert use of forking to not save state, that was not the right
approach.
2008-02-03 03:04:19 -05:00
Joey Hess 9f60272831 * poll: This plugin turns out to have edited pages w/o doing any locking.
Oops. Convert it from a cgi to a sessioncgi hook, which will work
  much better.
2008-02-03 00:26:00 -05:00
Joey Hess 0779013683 * aggregate: Forking a child broke the one state that mattered: Forcing
the aggregating page to be rebuilt. Fix this.
2008-02-02 23:56:13 -05:00
Joey Hess 870adf3bbf move openiduser function to the openid plugin 2008-01-30 02:39:17 -05:00
Joey Hess 55e16be44a move recentchanges link enabling into a pagetemplate hook 2008-01-30 02:29:12 -05:00
Joey Hess f584abec0c really fix the baseurl problem
the issue is that HTML::Template doesn't expand top-level variables when inside
a loop
2008-01-29 18:19:47 -05:00
Joey Hess 3803266b8f merged the recentchanges branch
misc fixes
2008-01-29 17:50:11 -05:00
Joey Hess 7a40bcab9a add missing test to avoid uninitialised value when a page with metadata is removed 2008-01-29 17:36:25 -05:00
Joey Hess 64a8c828b8 * meta: Add pagespec functions to match against title, author, authorurl,
license, and copyright. This can be used to create custom RecentChanges.
* meta: To support the pagespec functions, metadata about pages has to be
  retained as pagestate.
* Fix encoding bug when pagestate values contained spaces.
2008-01-29 17:16:51 -05:00
Joey Hess bc49e284ac make the author metadata for changes pages be the un-munged openid 2008-01-29 16:05:31 -05:00
Joey Hess 8b31c53366 added configuration for recentchanges
I kept it to a simple global configuration, rather than using the
preprocessor directive for recentchanges, because that had chicken and egg
problems and seemed overcomplicated. This should work reasonably well,
though it would be good to add some more metadata so that more customised
recentchanges pages can be made.
2008-01-29 15:51:32 -05:00
Joey Hess cabd5140c4 add code to delete old change pages 2008-01-29 15:22:23 -05:00
Joey Hess 35bc35660c use new refresh hook 2008-01-29 13:08:48 -05:00
Joey Hess a5ad70a8dc updates 2008-01-29 12:59:49 -05:00
Joey Hess 598d338b11 escape wikilinks and preprocessor directives 2008-01-29 12:37:39 -05:00
Joey Hess 85eb1abc61 typo 2008-01-29 04:45:54 -05:00
Joey Hess 38e79f206e more style improvements 2008-01-29 04:44:05 -05:00
Joey Hess 21f44880cd non-tabular recentchanges display
Doesn't look as good as the old table, but works as a rss feed.
2008-01-29 01:48:55 -05:00
Joey Hess d2a3695376 some parameteraisation and generalisation 2008-01-29 01:03:15 -05:00
Joey Hess 5921b86fcc proof of concept implementation of static recentchanges
Currently hardcoded to write to recentchanges/*, and the page format needs
to be rethought to be usable for aggregation, but it basically works.
2008-01-28 23:56:26 -05:00
Joey Hess 2d3dc86d07 * prettydate,ddate: Don't ignore time formats passed to displaytime
function.
2008-01-28 23:48:27 -05:00
Joey Hess 3436fed081 * inline: The template can check for FIRST and LAST, which will be
set for the first and last inlined page. Useful for templates that build
    tables and the like.
2008-01-28 21:22:04 -05:00
Josh Triplett fafb2edaa7 aggregate.pm: Replace Unicode apostrophe with ASCII to unbreak build
gettext choked on a Unicode apostrophe in the aggregate plugin, which
appeared in a new error message in commit
4f872b5633.  Replace it with an ASCII
apostrophe.
2008-01-26 23:12:29 -08:00
Joey Hess 4f872b5633 * aggregate: Fork a child process to handle the aggregation. This simplifies
the code, since that process can change internal state as needed, and
  it will automatically be cleaned up for the parent process, which proceeds
  to render the changes.
2008-01-24 17:22:39 -05:00
Joey Hess ba6b8e5e3e * aggregate: Don't let feeds set creation times for pages in the future. 2008-01-16 02:01:00 -05:00
Patrick Winnertz 81c726982b I've wrote a little patch for the bug in teximg (can only include fomula on
one page).
2008-01-09 20:04:51 -05:00
Joey Hess e01960e90a not only markdown adds gunk, so remove it in the main htmlize function 2008-01-09 14:41:28 -05:00
Joey Hess 2b9ce0129b * mdwn: When htmlizing text, if it's a single line with no newline,
remove the enclosing paragraph and newline markdown wraps it in.
  This allows removing several hacks around this markdown behavior from
  other plugins that htmlize fragements of pages.
2008-01-09 14:35:23 -05:00
Joey Hess 57ff2ecaed * template: Remove bogus htmlize pass added in 2.16.
* template: Htmlize template variables, but also provide a raw version
  via `<TMPL_VAR raw_variable>`.
2008-01-09 14:17:25 -05:00
Joey Hess adb1bc8761 don't process data metadata in scan, as it's expensive and the metadata should not be needed so early 2008-01-09 02:41:38 -05:00
Joey Hess deb39a1f14 * meta: Run in scan mode again (more intelligently) and re-add support for
meta link.
* Fix support for the case where metadata appears after an inline directive.
  This was broken in version 2.16.
2008-01-09 02:38:43 -05:00
Joey Hess a654a72fda optimisation: detect scan mode and avoid generating image 2008-01-09 02:31:11 -05:00
Joey Hess b31e8c0826 * inline: Add copyright/license info on a per-post basis to atom
feeds if available. (rss doesn't allow such info on a per-post basis)
* meta: Allow copyright/license metadata to contain arbitrary markup.
2008-01-09 01:05:54 -05:00
Joey Hess 86781fc43e * aggregate: Include copyright statements from rss feed as meta copyright
directives.
* aggregate: Yet another state saving fix (sigh).
* aggregate: Add hack to support feeds with invalidly escaped html entities.
2008-01-08 20:41:25 -05:00
Joey Hess 4c1a4402f9 * htmlscrubber: Further work around #365971 by adding tags for 'br/', 'hr/'
and 'p/'.
2008-01-07 18:32:50 -05:00
Joey Hess d7b2bb13d1 fixes 2008-01-07 16:37:19 -05:00
Joey Hess c487b847e2 * Improved the canedit hook interface, allowing a callback function to be
returned (and not run in some cases) rather than the plugins directly
  forcing a user to log in.
* opendiscussion: allow editing of the toplevel discussion page,
  and, indirectly, allow creating new discussion pages.
2008-01-07 16:34:13 -05:00
Joey Hess 45de8dc710 * opendiscussion: allow editing of the toplevel discussion page 2008-01-07 16:10:32 -05:00
Joey Hess 4ac5685744 fix some bad copy and pasted plugin ids 2008-01-07 15:28:53 -05:00
Joey Hess ceffae8af1 * aggregate: Only save state if it was already loaded. This didn't used to
* table: Fix dependency tracking for external data files. Closes: #458387
2008-01-05 02:23:31 -05:00
Joey Hess 76e941a480 * aggregate: Only save state if it was already loaded. 2008-01-05 01:26:09 -05:00
Joey Hess 41234a3f0f round days old message 2008-01-02 23:38:45 -05:00
Joey Hess c3eec7fdf0 I *think* that this comment is out of date. 2007-12-30 14:57:33 -05:00
Joey Hess f0f52e602d * aggregate: Fix stupid mistake introduced when converting it to use
the needsbuild hook. This resulted in feeds not being removed when pages
  were updated, and probably other bugs.
* aggregate: Avoid uninitialised value warning when removing a feed that
  has an expired guid.
2007-12-30 14:49:25 -05:00
Joey Hess 3e784ea8a1 * map: Fix handling of common prefix to handle the case where it's
in a subdirectory. Patch by Larry Clapp.
2007-12-28 17:22:17 -05:00
Joey Hess 63f62ef520 * conditional: Improve regexp testing for simple uses of pagespecs
that match only the page using the directive, adding 'included()'
  and supporting negated pagespecs and added whitespace.
2007-12-28 16:55:20 -05:00
Joey Hess c2afda7f90 * img: Allow the link parameter to point to an exterior url. 2007-12-28 16:14:43 -05:00
Joey Hess 2332b40595 * img: Avoid nesting images when linking to another image. Closes: #457780 2007-12-26 10:49:15 -05:00
Thomas Schwinge 1ac0fd03bb IkiWiki/Plugin/meta.pm <redir>: Support for specifying anchors. 2007-12-22 13:10:55 -05:00