Commit Graph

2165 Commits (beae7ef9db01ab2af75d3176b016113c9d33f0a9)

Author SHA1 Message Date
Joey Hess 9a0b9bdc88 minor refactor/optimisation 2010-02-14 18:09:28 -05:00
Joey Hess 34fff64e7b setup file ordering 2010-02-12 06:35:52 -05:00
Joey Hess 20ba12802b add section information 2010-02-12 04:22:15 -05:00
Joey Hess 73242f0890 remove unnecessary IkiWiki:: 2010-02-12 04:01:04 -05:00
Joey Hess 9cee2962e0 format plugin categorization 2010-02-12 01:10:36 -05:00
Joey Hess 18394f6ba9 improve websetup fieldset display
to handle sections
2010-02-12 00:21:12 -05:00
Joey Hess 8fdc238c8c fix websetup display of unsafe arrays in expert mode 2010-02-11 22:55:35 -05:00
Joey Hess a63929f6cc Group related plugins into sections in the setup file, and drop unused rcs plugins from the setup file. 2010-02-11 22:24:15 -05:00
Joey Hess 7af18f2a1e reorder canedit checks during page creation to have best_loc first
When creating a page, multiple locations are tested to see if they can be
edited. If all fail, one of the failure subs is called, to log the user in
to allow them to proceed with the edit. So far so good.

But, what if some pages fail for one reason, and some for another? This
occurs when httpauth_pagespec is used in conjunction with signinedit (and
openid or something). When the user is not signed in at all
The former will fail to edit a page because the user was not httpauthed.
The latter will fail to edit a different page, because the user was not
signed in. One of their failure methods gets to run first.

The page creation code always ran the failure method corresponding to the
topmost page location. So, when editing a foo/Discussion page, and with
httpauth_pagespec => "*!/Discussion", it ran the httpauth failure method,
which was exactly the wrong thing to do.

I fixed this by making it instead run the failure method for the *best*
page location. In the above example, that's foo/Discussion, so signinedit
runs, as desired, and we get the signin page.

This seems like it will be the right choice, or at least an acceptable
choice. If a user wants to use httpauth they can always choose it on the
signin page.
2010-02-11 20:13:30 -05:00
Joey Hess 6f1d623618 partially fix httpauth canedit hook
My logic was right before. Cleaned up some code.

(Page creation is still a problem.)

Also, I removed the Edit url munging, because that is not
necessary with the canedit hook, since canedit will handle
redirection through cgiauthurl if necessary.
2010-02-11 19:54:40 -05:00
Joey Hess e6678275a9 fix logic error 2010-02-11 18:32:07 -05:00
Joey Hess e11876b700 httpauth: Add httpauth_pagespec setting that can be used to limit pages to only being edited via users authed with httpauth. 2010-02-11 18:25:10 -05:00
Joey Hess 046095552a httpauth: When cgiauthurl is configured, httpauth can now be used alongside other authentication methods (like openid or anonok). Rather than always redirect to the cgiauthurl for authentication, there is now a button on the login form to use it. 2010-02-11 17:26:09 -05:00
Joey Hess f2d6d4f6b2 patch so far 2010-02-11 16:36:19 -05:00
Joey Hess a4ec579d1a amazon_s3: Fix to support the EU S3 datacenter, which is more picky about attempts to create already existing buckets. 2010-02-09 16:24:14 -05:00
Joey Hess 5a2de27947 Fix color and format plugins to appear in the websetup interface. 2010-02-06 16:25:39 -05:00
Joey Hess b384af237d opendiscussion: This plugin will also now allow posting comments
to otherwise locked-down sites.
2010-02-06 16:19:17 -05:00
Joey Hess e33a65719a ensure opendiscussion hook is always called before lockedit
This was only ordered ok due to luck before.
2010-02-06 16:12:29 -05:00
Joey Hess 1af8db763b revert accidental code change 2010-02-05 23:06:29 -05:00
Joey Hess 5541b06de4 response 2010-02-05 15:22:02 -05:00
Joey Hess 8380a9d000 factor out a userpage function
Not yet exported, as only 4 quite core plugins use it.
2010-02-04 18:24:15 -05:00
Joey Hess a2e78ebcf2 Add link to userpage (or creation link) to top of preferences page. 2010-02-04 15:30:41 -05:00
Joey Hess 68f7be91e5 typo 2010-02-04 15:10:55 -05:00
Joey Hess b547170a96 Improve display of openid in preferences page.
Now that openiduser is in IkiWiki core, it's ok to have passwordauth check
for it, and avoid displaying useless password fields when showing
preferences for an openid.

Also improved the styling of the display of the openid in the preferneces
page.
2010-02-04 15:07:10 -05:00
Joey Hess 345b40c652 Allow jumping directly into account registration process by going to ikiwiki.cgi?do=register 2010-02-04 14:51:56 -05:00
David Riebenbauer 25741100b0 Export add_autofile() for use in Plugins. 2010-02-02 14:04:39 +01:00
David Riebenbauer a8d313aba1 Use add_autofile() in tag.pm
to make the automatically created tagpages render.
2010-02-02 14:04:29 +01:00
David Riebenbauer f35d35abe3 Automatically create tag pages,
if "tag_autocreate=1" is set in the configuration. The pages will be created in
tagbase, if and only if they do not exist in the srcdir yet. Tag pages will be create from
"autotag.tmpl".

At this stage a second refresh is needed for the tag pages to be rendered.

Add autotag.tmpl template.
2010-02-02 14:04:28 +01:00
Joey Hess f91d79f469 img: Fix a bug that could taint @links with undef values. 2010-01-28 21:07:23 -05:00
Joey Hess 73253d6925 template: Preprocess parameters before htmlizing.
Consider a template like:

[[!template type=note text="""
[[!inline pages="*foo*"]]
"""]]

The text parameter is htmlized before being passed into the template (in
case the template wraps it in a <span> that prevents markdown from
htmlizing it later).

But, when markdown sees "*foo*", it turns that into <em>foo</em>.
Later, when preprocessing the inline directive, that leads to suprising
results.

To fix this, I made template parameters be preprocessed (and filtered)
before being htmlized.

Note that I left in the preprocessing (and filtering) of the template
output at the end. That's still relevant when the template itself contains
preprocessor directives.
2010-01-26 22:33:46 -05:00
Joey Hess ee9ae0a314 po: avoid crash when page is empty
Note that there is an associated po4a warning when a page is empty:
  Use of uninitialized value $file in substitution (s///) at /usr/share/perl5/Locale/Po4a/Text.pm line 205.
I've filed a bug with po4a about that, but the important thing is fixing
the crash here.
2010-01-21 15:33:20 -05:00
Joey Hess 8bf2f5a31a handle git-notes breakage
The new git-notes feature in git 1.6.6 changes git log output in a way that
broke ikiwiki's parser if notes are added to commits.

I decided to deal with this by disabling notes when ikiwiki uses git,
by setting GIT_NOTES_REF="". AFAICS, looking up notes when dumping logs
will only waste time, since it does not currently seem to make sense for
ikiwiki to do anything with the notes.
2010-01-19 23:42:04 -05:00
Joey Hess ccf14b185e brace style and layout 2010-01-18 12:34:19 -05:00
Joey Hess 461804a5e4 clarify error 2010-01-18 12:09:54 -05:00
Joey Hess 9dc5685de4 linkmap: Simplify and improve browser compatability by using an img, not object tag.
I noticed that chromium was not hyperlinking the areas in the object-based
linkmap, while img works ok. Dunno why, but img based is nicer anyway since
it is allowed right through the htmlscrubber with no workarounds.
2010-01-09 23:10:26 -05:00
intrigeri 73f4a88358 po: inject custom isselflink to fix selflink detection on translation pages 2010-01-09 22:54:34 +01:00
Joey Hess 1f51af907e websetup: Fix bug in array change detection. 2010-01-09 16:27:08 -05:00
Joey Hess 59d929d6b1 websetup: Fix utf-8 problems. 2010-01-09 16:20:09 -05:00
Joey Hess eb30cfb310 only use css alignment stuff for table
This way users can use all the other alignment values when not including a
caption. Also, it will work without the standard style, and I don't have to
worry about regressions this way.
2010-01-07 16:09:34 -05:00
Joey Hess e31cb975a7 img: remove special case handling of link=yes
Only exists as an undocumented backwards compatability hack.
2010-01-07 15:41:16 -05:00
Joey Hess 253b1a41c1 refactor 2010-01-07 15:36:49 -05:00
Joey Hess e68cce6d1d brace style 2010-01-07 15:12:17 -05:00
Giuseppe Bilotta 4bda18a50a Support align attribute for img with caption
This is achieved by preparing CSS definitions that emulates the behavior
of the align attribute, and passing it to the outermost IMG wrapper
(A or TABLE) instead of passing the align value to IMG directly.
2010-01-06 21:02:09 +01:00
Joey Hess d78e8ee452 comments: Fix permalinks for comments using new conflict-free filenames. 2010-01-04 20:51:40 -05:00
Joey Hess 264f469894 lockedit can make sense with no auth plugins
On second though, you might want a wide-open wiki with some locked
pages that cannot be edited online.

So, the right thing for lockedit to do when there are no auth plugins is
to just say the page cannot be edited.
2010-01-04 19:40:33 -05:00
Joey Hess ae493178cf lockedit: Detect if no authentication plugins are enabled, and die with an error message as this configuration does not make sense. 2010-01-04 15:01:25 -05:00
Joey Hess f8bd25bfc7 signinedit: Auto-disable the plugin when all authentication methods are disabled. 2010-01-04 14:56:17 -05:00
Joey Hess aed16b4833 inline: Avoid showing edit links if page editing is disabled. (Sjoerd) 2010-01-04 12:54:18 -05:00
Joey Hess 7dd074e2e7 Fix several places that did not properly handle capitalization of the discussionpage setting.
Specifically, fixes discussion actions on discussion pages, and unbreaks the opendiscussion plugin.
2010-01-02 15:52:38 -05:00
Joey Hess 9747c47670 Merge remote branch 'tove/master' 2010-01-02 15:11:51 -05:00
Torsten Veller 59277c9b6b Terminate the arrow entities with ";" 2010-01-02 19:22:25 +01:00
Joey Hess 63cc5384bb inline: Fix bug that limited displayed pages when feedshow was specified w/o show. 2010-01-01 15:09:15 -05:00
Joey Hess 2ae1d9d928 linkmap: Add option to omit disconnected pages from the map. 2010-01-01 03:37:59 -05:00
Joey Hess 6af6c89df3 comments: Add a checksum to the name of comment pages, to avoid merge conflicts when comments are posted to two branches of a site. 2009-12-30 15:41:17 -05:00
Joey Hess ffc9f25e73 toc: Add startlevel parameter. (kerravonsen) 2009-12-25 15:28:18 -05:00
Joey Hess 3a1c8c2b46 pagestats: Add show parameter. Closes: #562129 2009-12-25 14:31:51 -05:00
Joey Hess 2bceb10b5f 404/goto: Fix 404 display of utf-8 pages.
Problem here was that no charset http header was being sent.

I fixed this globally by making cgi_custom_failure send the header.
Required changing its parameters.
2009-12-14 18:16:47 -05:00
Joey Hess 40078b1781 404: fix utf-8 encoding of REDIRECT_URL 2009-12-14 18:07:24 -05:00
Joey Hess 4ee754536d remove: Fix problem removing pages with utf-8 in the name. 2009-12-14 17:26:48 -05:00
Joey Hess cdbdf19c36 attachment: Fix reversion in attachment sorting by age.
Reversion was introduced by over-eager removal of mtime_raw in
2b569f99d9
2009-12-14 17:19:31 -05:00
Joey Hess bb1ce7207d attachment: Fix several utf-8 problems.
Similar to those in the rename plugin, although here we can't use
the form object.
2009-12-14 17:16:40 -05:00
Joey Hess b4bc7d1708 rename: Fix some utf-8 problems.
The crux of the problem is that the cgi object has raw values not converted
to utf-8, and rename was using its fields. Also fixed a missed place where
the form object did not get its fields utf-8 encoded.
2009-12-14 17:15:50 -05:00
Joey Hess f843033749 monotone: Deal with format change in version 0.45. (Thanks, Richard Levitte) 2009-12-13 13:00:42 -05:00
Joey Hess b8ed5e7228 more idomatic perl 2009-12-04 13:13:41 -05:00
Joey Hess f02f806cf7 calendar: Fix month wraparound error that broke in December. 2009-12-02 12:58:45 -05:00
Joey Hess c5b554b9b2 inline: Avoid using %links to test for page existence
%links is populated even for just-deleted pages, so %pagesources
should be used for such tests instead.
2009-11-30 18:15:33 -05:00
Joey Hess 2255a6a0bb calendar: Add title attributes for all links in the calendars. 2009-11-26 14:58:35 -05:00
Joey Hess 09dbbaf245 fix hook names 2009-11-25 06:49:26 -05:00
Joey Hess df75c5b93a date: New plugin that allows inserting date directives that expand to pretty-printed dates, using the same formatting as used for page modification date display, etc. 2009-11-25 01:18:43 -05:00
Joey Hess da92e91769 inline: Use caching of inlined pages to speed up builds of inlines that include feeds.
Speedup of about 25% for small inlines; could be much larger for inlines of
many, or complex pages.

Not bloating memory with excessive memoization data was the key to this.
The method chosen does not squeeze out every erg of speed possible when
inlines are nested, but that's rare. It uses less memory than other
optimisation hacks (I'm looking at you,
f937c1fb80 !) already used in inline.pm.
2009-11-17 01:29:28 -05:00
Joey Hess 43a1640345 meta: Allow use of DESCRIPTION in templates to get at the meta description value. (Thanks, NicolasLimare) 2009-11-16 15:54:11 -05:00
Joey Hess 4fa17df57d meta: Generate meta description tags even when the html scrubber is enabled.
Unlike generic meta foo tags, meta description is known to be safe, so can
be special cased to be allowed despite the html scrubber. This makes meta
description much more useful, since it is otherwise limited to being used
by other plugins like map.
2009-11-16 15:51:00 -05:00
Joey Hess 20cdadba32 avoid fallthrough to default meta header addition for title
With the htmlscrubber disabled, it was adding a <meta name=title>
tag for the title, which is pointless.
2009-11-16 15:44:03 -05:00
Joey Hess d8cfd8d431 inline: Fix display of all pages when archive=yes or show=0 are used. 2009-11-13 20:50:27 -05:00
Joey Hess ad303e878e inline: Allow direct inclusion of non-page files in raw mode. 2009-11-13 15:10:58 -05:00
Joey Hess 5ccf68f113 inline: Do not generated feeds for nested inlines.
My experience is that when inlines are nested, the old behavior of
generating feeds for the nested inlines was never really desired. Since the
feeds were numbered sequentially, the numbers could easily change, and it did
not make sense to subscribe to or use those feeds. And generating those nested
feeds often meant a lot of unnecessary calculation, and data being written.
So, I dropped them.

Looking back, nested feeds originally were a free side effect of properly
handing multiple feeds on one page. Of course, that is still supported.
2009-11-13 14:56:24 -05:00
Joey Hess 8ec53967c1 typo 2009-11-10 00:53:34 -05:00
Joey Hess 92a6f2e5e8 httpauth: Add cgiauthurl setting that can be used to do http basic auth only when ikiwiki needs authentication, rather than for any access to the cgi/wiki. 2009-11-10 00:50:59 -05:00
Joey Hess 9f0931ce21 localstyle: New plugin, allows overrding the toplevel local.css with one that is closer to a page.
I chose not to have it override style.css, because style.css is not really
intended to be edited; the one from the underlay is intended to be used as
a base that local.css overrides.

I chose to use a plugin rather than changing the default behavior, both
because I didn't want to have to worry about possibly breaking backwards
compatability (though this seems unlikely), and because it seemed cleaner
to not include style template parameters in the main page template code.

I suppose someone might want a way to not override the toplevel
local.css, but instead include it as well as foo/local.css. Probably the
best way to do that would be to have foo/local.css @import ../local.css
(modulo browser compatability issues). Alternatively, edit page.tmpl
to always include the toplevel local.css, or swap out this plugin for
another one.
2009-11-09 13:39:05 -05:00
Joey Hess 910cbae922 underlay: Avoid crashing if lists of underlays (or template directories) are not configured. 2009-11-07 12:36:13 -05:00
Joey Hess 70ee70e276 underlay: Fix example values put in setup file to be array references. 2009-11-06 12:06:46 -05:00
Joey Hess c29957e017 google: Pass the whole wiki url to google, not just the domain, so that search works correctly for wikis that are located in subdirectories of domains. 2009-10-29 18:05:58 -04:00
Joey Hess 8dfd5289a9 moderatedcomments: New plugin to allow comment moderation w/o relying on blogspam.net. 2009-10-26 13:24:27 -04:00
Joey Hess a2979b2b52 mdwn: Avoid trying to use multimarkdown if it is not installed. 2009-10-26 11:56:42 -04:00
Joey Hess f756d7e6de po: Fix breakage caused by changes to render code. 2009-10-26 11:53:55 -04:00
Joey Hess 789e0bfd6b inline: Fix raw mode. Closes: #552114 2009-10-23 12:38:30 -04:00
Joey Hess b907108271 meta: Gather permalink info on scan pass so it is available to inline when using a template that does not include page content. 2009-10-21 16:42:25 -04:00
Joey Hess 2d60ea7fa8 edittemplate: Work around bug #551499 in CGI::FormBuilder. 2009-10-18 13:56:35 -04:00
Joey Hess d1a88c892e edittemplate: Allow template page name to be specified using anything legal for a wikilink (including eg, leading slashes).
Before, the htmllink would display the link to the template as if it were a
wikilink, but what was stored was not, which could lead to confusing
situations.
2009-10-18 13:47:30 -04:00
Joey Hess 6a955e86bb fix logic error
This sometimes caused infinite recursion when rebuilding a wiki
with po files.
2009-10-17 20:45:03 -04:00
Joey Hess fc1bad2e7b slight optimisation 2009-10-15 20:01:47 -04:00
Joey Hess d0213917ad inline: Optimize generation of archives, etc
Don't generate inlined page content if the template does not use it.
2009-10-15 16:25:43 -04:00
Joey Hess 2fced917a5 sparkline: show error if php does not run 2009-10-14 16:59:21 -04:00
Joey Hess 28c4caea59 year calendar: Avoid highlighting the current month in a different year 2009-10-12 14:24:28 -04:00
Joey Hess 5c78192435 year calendar: only link to months that have posts
This does mean the year calendars depend on existence of all posts made in
the year and have to be updated.
2009-10-12 14:19:04 -04:00
Joey Hess 22737e53f1 remove whitespace from within arrow links 2009-10-12 14:05:56 -04:00
Joey Hess 227540fd87 calendar: Add creation time limits to user's pagespec
This avoids all calendars rebuilding when a new page is added
that will only show in one of them.
2009-10-12 12:30:10 -04:00
Joey Hess 11e6d650ea calendar: Fix CSS for year calendar to match the plugin documentation.
The names in the documentation were completly different, but
also seemed better chosen than the names in the code.
2009-10-12 12:19:42 -04:00
Joey Hess e82b43bf95 skip merges
git log --follow seems to sometimes show merges from before the file was
ever created. So, skip them, a file shouldn't be first created during a
merge anyway.
2009-10-12 00:50:48 -04:00
Joey Hess bf577d34c7 can't use --reverse with git log --follow
Meh, git.
2009-10-11 23:36:06 -04:00
Joey Hess 85af97c9a2 Merge branch 'master' into dependency-types
Conflicts:
	debian/changelog
2009-10-11 22:39:31 -04:00
Joey Hess 33f42db2ea git: --getctime will now follow renames back to the original creation of a file.
This will be a bit more expensive, but --getctime does not need to be fast.
And getting the real creation time a very useful when untangling blog
histories that involve renames.
2009-10-11 22:38:42 -04:00
Joey Hess e4c765c64f calendar: avoid inline images in links 2009-10-11 22:11:11 -04:00
Joey Hess cf74cf7a37 calendar: use left and right arrows for next/prev months
This is consistent with the year display, and I think it is less
visually confusing than using the full month names.
2009-10-11 21:55:06 -04:00
Joey Hess 23a21850fa fix next/prev month padding bug 2009-10-11 21:52:50 -04:00
Joey Hess 8a37be35ac fix day links
I broke this recently.
2009-10-11 21:43:16 -04:00
Joey Hess f3342773d3 calendar: Fix bug in next/previous year/month links, which sometimes linked to an archive page from the wrong year. 2009-10-11 21:42:59 -04:00
Joey Hess dd80be66ee calendar: Fix midnight rebuild trigger of calendars with explicit month/year.
It was just broken for calendars with an explicit month or year, not
triggering at all.

Now it will update those at appropriate times.
2009-10-11 21:26:43 -04:00
Joey Hess 71e266b939 avoid temporary variables
and fix a bug in pagespec variable name
2009-10-11 20:15:54 -04:00
Joey Hess 74409f940d add_depends: optimise influence calculation
I made match_* functions whose influences can vary depending on the page
matched set a special "" influence to indicate this.

Then add_depends can try just one page, and if static influences are found,
stop there.
2009-10-09 17:15:40 -04:00
Joey Hess c5e237c013 img: use presence dependency when linking to a page 2009-10-09 13:37:06 -04:00
Joey Hess 1b6b1ee2d8 brokenlinks: use pagespec_match_list 2009-10-09 13:35:11 -04:00
Joey Hess 6f2cc5ac8c pagespec_match_list: change limit to filter 2009-10-09 13:20:41 -04:00
Joey Hess f9f7a6e9f3 conditional: use pagespec_match_list 2009-10-09 13:07:50 -04:00
Joey Hess c7da991158 indentation 2009-10-09 13:02:03 -04:00
Joey Hess b7351daacd conditional: use yesno 2009-10-09 12:54:35 -04:00
Joey Hess 96682e3084 progress: switch to new pagespec_match_list 2009-10-09 12:48:16 -04:00
Joey Hess c791f84fb5 linkmap: Use new pagespec_match_list 2009-10-09 12:35:41 -04:00
Joey Hess 5e7b2dea84 rename use_pagespec to pagespec_match_list
To avoid breaking plugins, also support the old pagespec_match_list
calling convention, with a deprecation warning.
2009-10-08 23:51:06 -04:00
Joey Hess 332821144b calendar: rework so it can use use_pagespec
This was tricky because of the caching, and because use_pagespec always
adds a dependency. That would have made year calendars depend on the whole
pagespec, which is overly broad. So I removed the caching, format_month,
and in format_year just look at %pagesources to see if month pages are
available.

In format_month, I make it always call use_pagespec, so each month calendar
gets the right dependency and any influcences added. This means a bit more
work, but the added work is fairly minimal, and presence dependencies
remove a *lot* of work it used to do.

(100% untested!)
2009-10-08 23:30:34 -04:00
Joey Hess 80ab1dbc12 postsparkline: switch to use_pagespec
Also, fixed up the dependency type for time=mtime. That has
to remain a content dependency, sadly.
2009-10-08 22:56:36 -04:00
Joey Hess 3be7a02e7d orphans: switch to use_pagespec 2009-10-08 22:56:12 -04:00
Joey Hess 57d04ed892 fix feedpages dependency
This dependency was missing before switching to use_pagespec.
It is correct to add it, but it needs to be combined with the regular
"pages" dependency to ensure that it does not match extra pages.

(Also fixed its dependency type.)
2009-10-08 20:55:12 -04:00
Joey Hess bc4ef28f3e pagestate: switch to use_pagespec 2009-10-08 20:29:51 -04:00
Joey Hess 1abbc6a404 pagecount: switched to use_pagespec 2009-10-08 18:47:25 -04:00
Joey Hess 32cd5f0b79 inline: switch to use_pagespec
Taking advantage of every single one of its features, of course.
Even had to add one more..
2009-10-08 18:30:50 -04:00
Joey Hess de24c0df87 map: switch to use_pagespec 2009-10-08 17:53:45 -04:00
Joey Hess c57908b9d0 change how dependency types are specified to add_depends
Also, this fixes 2 bugs in dependency info.
2009-10-08 16:49:03 -04:00
Joey Hess f2b3d13414 fix handling of influences of pagespecs that fail to match
If a pagespec fails to match, I had been throwing the influences away, but
that is not right. Consider `backlink(foo)`, where foo does not exist.
It still needs to be added as an influence, because if it is created, it
will influence the pagespec to match.

But with that fix, `link(bar)` had as influences all pages, whether they
link to bar or not. Which is not necessary, because modifiying a page to
add a link to bar will directly cause the pagespec to match.

So, in match_link (and all the match_* functions for page metadata),
only return an influence if the match succeeds.

match_backlink had been implemented as the inverse of match_link, but that
is no longer completly true. While match_link does not return an influence
on failure, match_backlink does.

match_created_before/after also return the influence on failure, this way
if created_after(foo) currently fails because foo does not exist, it will
still update the page with the pagespec if foo is created.
2009-10-08 13:38:46 -04:00
Joey Hess 957ded9d64 remove explicit addition of dependencies for displayed pages
that hack is not needed, thanks to pagespec influences calculation
2009-10-07 21:57:31 -04:00
Joey Hess 5f9860e65c add type info to influence information 2009-10-07 21:52:37 -04:00
Joey Hess 4002d7c1a4 add influence info to match_*
Also update docs, test suite.
2009-10-07 20:31:13 -04:00
Joey Hess 77598dfa9f linkmap, pagestats: avoid using %links to get a list of pages
When a page is deleted, it is removed from %pagesources, but
not from %links. So use the former.
2009-10-06 19:29:28 -04:00
Joey Hess a5d825f286 linkmap: does need presence deps
Otherwise, removal of a page with no links will not be noticed,
since no links will change.
2009-10-06 19:28:52 -04:00
Joey Hess 15fd89d64d presence dependencies not needed
Using just a link dependency is sufficient, since
2009-10-06 18:41:09 -04:00
Joey Hess af85f62d6f linkmap: Use a combination of presence and link dependencies.
This makes the map be regenerated much less frequently, so larger maps are
more practical to use now.
2009-10-06 17:47:10 -04:00
Joey Hess 031d1bf504 use among limit for correctness 2009-10-05 17:03:16 -04:00
Joey Hess c21f9e7093 pagestats: Use a combination of precense and link dependencies.
This makes it more efficient.

It also fixes the same bug that I fixed in orphans recently,
that only changes to the set of displayed pages were considered (or amoung),
which missed changes to links on other pages to those.

Probably this bug was never noticed because pagestats is most often put
on a blog type page, which gets updated anyway when posts change,
and thus the tag cloud was updated.
2009-10-05 15:44:26 -04:00
Joey Hess 7123178732 oprhans: Use a combination of precense and link dependencies.
This makes it more efficient.

It also fixes a longstanding bug, where if only a small set of pages were
considered by orphans, changes to links on other pages failed to cause an
update.
2009-10-05 15:14:18 -04:00
Joey Hess f41caf57ea use links dependency 2009-10-05 15:09:09 -04:00
Joey Hess e96992bbc8 fix add_depends to new api 2009-10-05 14:33:42 -04:00
Joey Hess be032a7b87 rework dependency types code
Simplify, change default content depends number to 1,
change interface to make more sense.
2009-10-04 20:30:21 -04:00
Joey Hess 7982c3c177 postsparkline and progress: also contentless dependencies 2009-10-04 16:16:50 -04:00
Joey Hess 66852de775 meta redir dependency is contentless 2009-10-04 16:12:05 -04:00
Joey Hess 2af988b86f listdirectives: contentless dependency
Another one that probably doesn't matter, but for completness.
2009-10-04 16:11:10 -04:00
Joey Hess de6eba6ddd not a contentless dependency
needs link info
2009-10-04 16:10:34 -04:00
Joey Hess ce78b69927 edittemplate: contentless dependency
This one is unlikely to matter much, but yeah, it's contentless.
2009-10-04 16:07:02 -04:00
Joey Hess a6689f9c7a calendar: all dependencies are contentless 2009-10-04 16:05:41 -04:00
Joey Hess e529c561f5 inline: Use a contentless dependency in quick mode. 2009-10-04 16:03:01 -04:00
Joey Hess 2fbfcd16e6 map: Use a contentless dependency unless show= is specified.
This makes simple maps efficient enough that they can be used on sidebars!
2009-10-04 15:46:23 -04:00
Joey Hess 6eaf9e4015 orphans and brokenlinks cannot use contentless dependency
Tried a contentless dep and it does not work; changes to links in pages
are not noticed. Drat.
2009-10-03 15:59:30 -04:00
Joey Hess dc4e44adf1 pagecount: Use contentless dependency
This will avoid lots of unnecessary updates of pages using the pagecount
directive. Yay!
2009-10-03 15:36:23 -04:00
Joey Hess 0c6648f02c mirrorlist: Display nothing if list is empty. 2009-10-02 12:37:53 -04:00
Joey Hess ac8ecdcf68 Support RPC::XML 0.69's incompatable object instantiation method. 2009-09-29 13:35:30 -04:00
Joey Hess 1f929e7f64 typo 2009-09-29 13:33:23 -04:00
Joey Hess 3525a6b7f2 toggle, relativedate: Support templates that add attributes to the body tag. 2009-09-28 16:21:03 -04:00
Joey Hess 7cb620d0e8 img: Fix dependency code for full size images.
I had assumed that an image shown full size did not need add_depends, since
a change would not need a change to the displaying page.

But this is not true if the image is modified and its size changes. Then
the page needs to update its img tag to reflect the current size.
2009-09-27 20:57:27 -04:00
Joey Hess f42215cb65 img: Correct bug in image size calculation code.
If an image was resized smaller, with width and height specified to values
that did not fit its aspect ratio, the image tag with/height were not
adjusted to the actual size imagemagick chooses.

This was broken by 03449610d6.

To fix it right, it unfortunatly needs to always read the src image now,
in order to determine if the image is being displayed larger, or resized
smaller. When resized smaller, it then always uses the size of the
thumbnail, while for larger it calculates the size.

(Only way to get rid of this sometimes extra image read would be to change
it to not allow displaying images larger.)
2009-09-27 20:53:02 -04:00
Joey Hess 2acaa15830 parentlinks: Add has_parentlinks template parameter to allow styling the toplevel index differently etc. 2009-09-27 18:29:16 -04:00
Joey Hess 34991b7d35 otl: Avoid globally filtering non-otl pages
Through a complex chain of circumstances, that filtering was causing
dumpsetup to trigger undefined warning messages from the po plugin. But
anyway, munging the otl in htmlize is less error-prone and less expensive,
a win all around.
2009-09-23 15:11:51 -04:00
Joey Hess af26398c14 avoid tempfile warning
Allow tempfile to open the file, so it doesn't warn about possible
insecurity. This probably fixes a real, but unlikely security hole too.
2009-09-13 20:20:21 -04:00
Joey Hess f1999df705 remove cgi exclusion
Note that a typical use of this plugin is for a static site, w/o cgi
support enabled.
2009-09-12 00:24:57 -04:00
Joey Hess a7545978c7 got rid of the postrefresh hook after all
Instead, use the change and delete hooks, and launch rsync if either hook
is called.
2009-09-11 18:29:56 -04:00
Joey Hess 5b818c9f2a doc update, add --exclude ikiwiki.cgi to examples 2009-09-11 18:28:35 -04:00
Joey Hess 3c80557054 localize user-visible warnings and tack on missing newlines 2009-09-11 18:22:06 -04:00
Joey Hess c6ac7409bd Merge commit 'schmonz/master'
Conflicts:
	IkiWiki/Plugin/rsync.pm
2009-09-11 18:20:23 -04:00
Joey Hess 2d9e97c283 chdir to the destdir before running rsync
Avoids needing to specify the path in the rsync command, can just use "."
2009-09-11 18:19:21 -04:00
Joey Hess dcc177440e remove unixauth; I am only adding render at the moment
yeah, you need branches :P
2009-09-11 18:15:19 -04:00
Amitai Schlair 604037b0f2 Don't error out, either warn or say nothing, depending. 2009-09-11 17:42:51 -04:00
Amitai Schlair a69d628b2c Whoops, copyright 2009. /usr/bin/perl for the interpreter like other plugins. 2009-09-11 14:13:47 -04:00
Amitai Schlair b2bd2e93f0 Revivify unixauth and rsync plugins (and hook needed by rsync) lost in
the last merge. I should really put each feature on its own git branch.
2009-09-10 17:34:52 -04:00
Joey Hess 9ef4b5e677 Merge commit 'schmonz/master' 2009-09-10 17:04:20 -04:00
Amitai Schlair fb6c6895c6 Add NetBSD-style 2-clause BSD license. 2009-09-10 17:03:06 -04:00
Joey Hess 60111384a9 formatting 2009-09-10 16:21:03 -04:00
Joey Hess 73224daf2c minor simplification 2009-09-10 16:20:21 -04:00
Joey Hess 1365ebf12f Merge commit 'schmonz/master' into cvs 2009-09-10 16:18:27 -04:00
Joey Hess 93cd30bc0a Merge branch 'master' into cvs 2009-09-10 16:18:23 -04:00
Joey Hess 26dae8f049 clean up use of IkiWiki::Receive
Loading and use of IkiWiki::Receive can all be pushed into the git plugin,
rather than scattered around.

I had at first wanted to make a receive plugin and move it there,
but a plugin was not a good fit; you don't want users to have to manually
load it, and making the git plugin load the receive plugin at the right
times would need more, and ugly code.
2009-09-10 16:15:48 -04:00
Amitai Schlair 8063bc3402 Catch up to the new genwrapper hook. 2009-09-10 15:12:45 -04:00
Amitai Schlair 460b1a0deb Merge branch 'master' of git://github.com/joeyh/ikiwiki 2009-09-10 15:03:18 -04:00
Joey Hess 3ebd4e0b45 Add genwrapper hook, that can be used to add code into the C wrapper. 2009-09-10 14:04:46 -04:00
Joey Hess c22b938631 Merge commit 'schmonz/master' into cvs 2009-09-10 13:44:31 -04:00
Joey Hess 81a9b5feff Merge branch 'master' into cvs 2009-09-10 13:44:27 -04:00
Amitai Schlair 98553d1537 CVS operations generally need to be within CVS checkouts, so these chdir()
calls are warranted. They shouldn't modify the caller's working directory,
though. Use File::chdir to keep the scope of the changes subroutine-local.
The tests now pass without resetting the working directory.
2009-09-10 00:51:34 -04:00
Amitai Schlair aafd267ee0 Abstract out CVS's involvement in the wrapper:
* In Wrapper.pm, add a new hook "wrapperargcheck" to examine argc/argv
  and return success or failure. In the failure case, the wrapper
  terminates.

* In cvs.pm, implement the new hook to return failure if a directory is
  being cvs added.
2009-09-09 21:58:42 -04:00
Amitai Schlair 5f44dd8e77 Merge branch 'master' of git://github.com/joeyh/ikiwiki 2009-09-09 14:44:52 -04:00
Joey Hess 2a99ebf276 underlay: Also allow configuring additional directories to search for template files in. 2009-09-08 17:27:37 -04:00
Joey Hess 8c55424b11 Merge commit 'schmonz/master' into cvs
Conflicts:
	IkiWiki/Plugin/cvs.pm
2009-09-04 17:16:28 -04:00
Amitai Schlair d79cf3728d It's STDOUT we have to shut up for cvs, and $savedout has to be
restored just so.
2009-09-04 14:56:55 -05:00
Amitai Schlair 9de742bb00 Stop using IPC::Cmd and String::ShellQuote, since quoting (and
having to quote, and the possible use of the shell) sucks. Stop
passing args to cvs_runcvs() as an arrayref, since that also sucks
(and was a sop to IPC::Cmd). Instead, use Joey's construction for
temporarily redirecting stderr to /dev/null. Much much simpler and
better. Works on my laptop with bozohttpd, now to test on the NetBSD
wiki.
2009-09-04 12:40:04 -05:00
Joey Hess de7c3aa16b minor formatting 2009-09-02 16:08:18 -04:00
Joey Hess 9f5cc7c9a2 remove two plugins that are unrelated to cvs 2009-09-02 15:36:56 -04:00
Amitai Schlair 85844b8494 whitespace 2009-08-30 21:03:18 -04:00
Amitai Schlair fe350e8b89 Merge branch 'master' of git://github.com/joeyh/ikiwiki 2009-08-30 16:34:32 -04:00
Amitai Schlair 1af7d7d842 On some systems the commit message gets quoted properly already. Don't
requote in such cases, do quote in all others.
2009-08-30 16:13:17 -04:00
Joey Hess d678147410 Revert "po: do not inject custom bestlink function when po_link_to eq default"
This reverts commit cdc3576c8d.

Conflicts:

	IkiWiki/Plugin/po.pm

This change broke the test suite and is not strictly necessary.
2009-08-30 14:50:43 -04:00
Amitai Schlair e972cadf78 Fix uninitialized value when editing a page being vivified from the
basewiki. Makes the filetype-testing logic more explicit anyway.
2009-08-30 13:49:38 -04:00
Amitai Schlair c36d2fa896 Merge branch 'master' of git://github.com/joeyh/ikiwiki 2009-08-30 03:02:15 -04:00
Amitai Schlair 968c6c93b4 Remove debug statement. 2009-08-30 01:45:09 -04:00
Amitai Schlair 2d1ff30e13 Knock off another to-do item: "Don't slurp the entire cvsps output
into memory (!)."
2009-08-30 01:14:22 -04:00
Amitai Schlair b493f9b6d8 Knock off a to-do item: "If the argument to cvs add smells like a
binary file, cvs add -kb it (for attachment support)."
2009-08-30 00:17:42 -04:00
Amitai Schlair 6191f3fbb9 Remove getopt() hook (it's a dead end, unsafe to pass wrapper args to
ikiwiki). Crunch on-demand module loads into one-liners. Comment why
cvsps output is getting read in its entirety and reversed.
2009-08-29 21:35:54 -04:00
Josh Triplett 9f75d3b1f3 teximg: Make TeX handle preventing unsafe things; remove insufficient blacklist
TeX has configuration options that prevent unsafe things like shell
escapes and insecure file reads/writes.  Turn all of them on.

teximg's regex-based blacklist does not suffice.  For instance:

[[!teximg code="""
\catcode`\%=0
%input{/etc/passwd}
"""]]

Remove the blacklist, since the TeX configuration options seal off the
underlying mechanisms more safely, and the blacklist blocks other TeX
commands that can prove useful.
2009-08-28 23:18:07 -07:00
Joey Hess 03449610d6 img: Don't generate new verison of image if it is scaled to be larger in either dimension.
Although imagemagick handles even really large sizes sanely, using a page
file, doing so would just waste time and disk space, since the browser
can be told to resize it larger.
2009-08-28 23:31:53 -04:00
Joey Hess 3811c5f559 Merge commit 'intrigeri/po' 2009-08-28 19:48:32 -04:00
Joey Hess ec26a96193 avoid clobbering origsub if checkconfig runs more than once
checkconfig can run more than once in a single ikiwiki run if setup is
building wrappers. That clobbered the origsub value for bestlink, leading
to infinite recursion
2009-08-28 19:15:25 -04:00
intrigeri 646c9a4c95 po: fix link() pagespec when used on translation pages
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-08-28 16:34:58 +02:00
Simon McVittie d92f767fb7 inline: if using pagenames, don't add a dependency on "page1 or page2 or..."
This is unnecessary and just slows us down (by a factor of 2, in the
pessimal case where every page has an inline with pagenames); it's also
not possible to optimize it into add_depends_exact calls.
2009-08-28 15:34:35 +01:00
intrigeri e671e72053 po: better rootpage logic for inline's post form
Set rootpage to the non-l10n'd rootpage parameter if it is set,
else to the masterpage of the linking page.

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-08-28 15:00:16 +02:00
intrigeri 53dc18ec2b Revert "po: keep masterpage as the rootpage for inline's post form"
This reverts commit cf43ae5a1f, which actually
only works when a rootpage parameter is set. A more complete fix will be
written soon.
2009-08-28 14:47:11 +02:00
intrigeri cf43ae5a1f po: keep masterpage as the rootpage for inline's post form
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-08-28 14:22:36 +02:00
intrigeri 72ac9821e5 inline: moved rootpage logic to a function
The po plugin's injected bestlink must do something special when called by this
exact part of inline's code.

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

Signed-off-by: intrigeri <intrigeri@boum.org>
(cherry picked from commit 1914ae2fd2)
2009-08-28 07:32:41 -04:00
intrigeri c9301d2c29 po: favor the type of linking page's masterpage on page creation
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-08-28 13:12:58 +02:00
intrigeri 1914ae2fd2 po: fix interdiction to create pages of type po
... which was broken by the new page_types code.

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

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

It is better in this one case if the link goes direct to the translated version
of the page.
2009-08-26 07:56:33 +02:00
intrigeri 0113c69d4f po: (hopefully) fixed WikiLink to self with po_link_to=default 2009-08-26 07:02:29 +02:00
Joey Hess 5bcdc39999 Revert "Allow add_depends to take an arrayref"
This reverts commit e4cd168ebe.

There was no benefit to this change.
2009-08-25 17:11:29 -04:00
Simon McVittie e4cd168ebe Allow add_depends to take an arrayref 2009-08-25 00:31:24 +01:00
Simon McVittie b6fcb1cb0e calendar, inline, map: don't pre-join dependencies
The new dependency handling works better (eliminates more duplicates) if
dependencies are split up. On the same wiki mentioned in the previous
commit, this saves about a second (i.e. 4%) on the same test.
2009-08-24 23:18:16 +01:00
Amitai Schlair 607534cecc Explain that command must run unattended, and lose the debug statement. 2009-08-23 15:43:18 -04:00
Amitai Schlair 844169c9b0 I'm not redefining any subs after all, don't prevent those warnings. 2009-08-23 15:21:39 -04:00
Amitai Schlair 3d6bc6e1b7 Add rsync plugin, though the only rsync-specific thing about it is the
assumption that uploading an entire site is efficient.
2009-08-23 15:18:41 -04:00
Amitai Schlair 5bdcd4d57b Oops, use the more recent (and less brittle) directory test. 2009-08-22 02:22:36 -04:00
Amitai Schlair 524de4db26 Pass along wrapper args to ikiwiki, then handle the "cvs add dir"
case with a getopt hook directly in my plugin. If the wrapper change
is safe, we won't need a wrapper wrapper.
2009-08-22 01:25:41 -04:00
Amitai Schlair 5c0e56d149 Put old unixauth plugin under git control. Needs some serious attention. 2009-08-21 22:51:12 -04:00
Joey Hess 9b799ccc85 po: Fixed to run rcs_add ralative to srcdir. 2009-08-19 14:05:59 -04:00
Joey Hess 8b99e68743 use pagespec_match_list for feedpages
This is both faster, and propigates any error in processing the feedpages
pagespec out to display on the page. Which may have been why I didn't use
it before, but currently seems like a good thing to do, since it explains
why your feeds are empty..
2009-08-16 13:45:10 -04:00
Joey Hess 4ff3e2a540 po: Better fix for missing underlay translation problem.
If a page is taken from the underlay, and one of the specified languages
does not have po files in the underlay, it would create a broken link
to the translated version of the page for that language.

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

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

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