Commit Graph

2989 Commits (22146f4518a00d9c38d9254581cbbbefc68dc1d5)

Author SHA1 Message Date
Joey Hess 243b0dd082 fix the other half of the filecheck filename bug 2010-03-26 00:16:21 -04:00
Simon McVittie b86276ffed Reimplement extensible sorting mechanisms, in the same way as pagespecs 2010-03-25 23:31:53 +00:00
Joey Hess 3d671ea8c1 filecheck: Fix bug that prevented the pagespecs from matching when not called by attachment plugin. 2010-03-25 14:39:09 -04:00
Joey Hess baa07e0b52 remove a few leftover manual folding indicators 2010-03-25 14:23:16 -04:00
Joey Hess 0219529699 fix unicode with YAML::Syck
Syck-- it doesn't use unicode by default?! Hello, 2010 calling..
2010-03-24 16:19:50 -04:00
Joey Hess eb06a01355 use perl YAML for dumping
Only it understands $YAML::UseHeader
2010-03-24 16:12:35 -04:00
Joey Hess a76206d480 fix back-compat with old Net::OpenID
Debian stable's Net::OpenID does not support getting extension fields.
2010-03-24 15:32:35 -04:00
Joey Hess 3166479fe4 fall back from YAML::Any to just YAML
for portabilty to old YAML in Debian stable that lacks the former.
2010-03-24 14:53:32 -04:00
Joey Hess 271449062a use YAML::Any to allow faster versions to be used if available 2010-03-24 14:30:38 -04:00
Simon McVittie b0ae19872d Add an optional "sort" argument to meta titles, defaulting to the title
This allows correct sorting of titles, names, etc., with:

    [[!meta title="David Bowie" sort="Bowie, David"]]
    [[!meta title="The Beatles" sort="Beatles, The"]]
2010-03-24 03:18:24 +00:00
Simon McVittie 0618f099da Have the meta plugin add a meta_title sort order 2010-03-24 03:15:50 +00:00
Joey Hess 440e18bc15 reset setuptype first, actually
so setup file can override default
2010-03-21 14:59:21 -04:00
Joey Hess 85778f59fd check for 'require' instead of 'use' 2010-03-21 14:52:21 -04:00
Joey Hess aea5bf9b40 reset setuptype to standard after an automator setup file is loaded
so a standard file is generated (by default)
2010-03-21 14:51:47 -04:00
Joey Hess dc128dd829 fix newlines in commented defaults 2010-03-19 17:54:58 -04:00
Joey Hess 3b08789e6f load YAML on demand
so as not to break test suite if YAML is not avilable
2010-03-19 16:09:07 -04:00
Joey Hess 07bb08d094 shorten setuptype 2010-03-19 15:55:10 -04:00
Joey Hess bba513a3e5 Add support for setup files written in YAML.
Not the default. (Yet?)
2010-03-19 15:52:53 -04:00
Joey Hess 19a794b482 parameterized indent 2010-03-19 15:44:28 -04:00
Joey Hess 10f8a2c858 improve comments 2010-03-19 15:36:33 -04:00
Joey Hess bbe1f2e493 move generic comment into IkiWiki::Setup 2010-03-19 15:35:21 -04:00
Joey Hess 522daa7ea8 factored out generic commented line dumping 2010-03-19 15:27:15 -04:00
Joey Hess 8a5084bc62 whitespace 2010-03-19 15:09:08 -04:00
Joey Hess b1dade8d96 allow multiple setup file types, and support safe parsing
Finally removed the last hardcoding of IkiWiki::Setup::Standard.
Take the first "IkiWiki::Setup::*" in the setup file to define the
setuptype, and remember that type to use in dumping later. (But it can be
overridden using --set, etc.)

Also, support setup file types that are not evaled.
2010-03-19 14:52:17 -04:00
Joey Hess cbf269eee2 audited use POSIX
The POSIX perl module exports a huge number of functions by default, so
make sure all imports are qualified. (And remove one that was not
necessary.)
2010-03-19 13:12:28 -04:00
Joey Hess dddd6aa990 Allow wrappers to be built using tcc. 2010-03-18 17:44:46 -04:00
Joey Hess b4ab74e722 C warning cleanup 2010-03-18 17:40:18 -04:00
Joey Hess a01e0679f4 openid: Use Openid Simple Registration or OpenID Attribute Exchange to get the user's email address and username.
The info is stored in the session database, not the user database.
There should be no reason to need it when a user is not logged in.

Also, hide the email field in the preferences page for openid users.

Note that the email and username are not yet actually used for anything.
The email will be useful for gravatar, while the username might be used
for a more pretty display of the openid.
2010-03-13 19:08:15 -05:00
Joey Hess e56ec7a96c websetup: Add websetup_unsafe to allow marking other settings as unsafe. 2010-03-13 15:08:00 -05:00
Joey Hess edec9514f4 typo 2010-03-12 15:01:24 -05:00
Joey Hess 2ad3e60ee8 htmlscrubber: Security fix: In data:image/* uris, only allow a few whitelisted image types. No svg. 2010-03-12 14:50:26 -05:00
Joey Hess 45dfdcb257 search: Avoid '$' in the wikiname appearing unescaped on omega's query template, where it might crash omega.
Really, a more general fix, this deals with any $ that might appear on the
misctemplate.
2010-03-11 16:10:04 -05:00
Joey Hess ac3aac560f moderatedcomments: Added moderate_pagespec
* moderatedcomments: Added moderate_pagespec that can be used
  to control which users or comment locations are moderated.
  This can be used, just for example, to moderate http://myopenid.com/*
  if you're getting a lot of spammers from one particular openid
  provider (who should perhaps answer your emails about them),
  while not moderating other users.
* moderatedcomments: The moderate_users setting is deprecated. Instead,
  set moderate_pagespec to "!admin()" or "user(*)" instead.
2010-03-11 15:44:10 -05:00
Joey Hess 6eb71547dd typo 2010-03-09 19:55:50 -05:00
Joey Hess 6d27bbd026 Fix utf8 issues in calls to md5_hex.
This prevented comments containing some utf-8, including euro sign, from
being submitted. Since md5_hex is a C implementation, the string has to be
converted from perl's internal encoding to utf-8 when it is called. Some
utf-8 happened to work before, apparently by accident.

Note that this will change the checksums returned.

unique_comment_location is only used when posting comments, so the checksum
does not need to be stable there.

I only changed page_to_id for completeness; it is passed a comment page
name, and they can currently never contain utf-8.

In teximg, the bug could perhaps be triggered if the tex source contained
utf-8. If that happens, the checksum will change, and some extra work might
be performed on upgrade to rebuild the image.
2010-03-09 19:55:19 -05:00
Joey Hess 60d2dd318f Add new --clean option; this makes ikiwiki remove all built files in the destdir, as well as wrappers and the .ikiwiki directory. 2010-02-28 00:12:47 -05:00
Joey Hess 6aaa6e0d24 Fix admin openid detection in setup automator, and avoid prompting for a password. 2010-02-27 16:36:57 -05:00
Joey Hess a12c386c86 Add force_overwrite setting to make setup automator overwrite existing files/directories.
This can be useful if you're driving the setup automator from another
program.
2010-02-27 16:26:18 -05:00
Joey Hess 068e47aa45 catch failure to open the filetypes file 2010-02-24 20:28:52 -05:00
Joey Hess c21eb47e62 comments: Display number of comments in comment action link.
This was not doable before, but when I added transitive dependency handling
in the big dependency rewrite, it became possible to include a comment
count when inlining.

This also improves the action link when a page has no comments. It will
link direct to the cgi to allow posting the first comment. And if the page
is locked to prevent posting new comments, the link is no longer shown.
2010-02-14 19:11:18 -05:00
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 805b3afff7 formatting sillyness 2010-02-12 04:09:57 -05:00
Joey Hess 73242f0890 remove unnecessary IkiWiki:: 2010-02-12 04:01:04 -05:00
Joey Hess 2d4b84e45f borders 2010-02-12 01:16:20 -05:00
Joey Hess 9cee2962e0 format plugin categorization 2010-02-12 01:10:36 -05:00
Joey Hess 0ea2f0936b add plugin section, and show which plugins need no configuration 2010-02-12 01:10:27 -05:00
Joey Hess 5b76fc824c reword 2010-02-12 00:22:00 -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 da5d29f95f fix bugs in `find_src_files()`.
Use `_` to avoid superfluous stat.

Check for `defined $file`, instead of just `$file`.

Add spaces after commas.

Change return values of `verify_src_file()` to not return the tainted filename.
Rename `$f` to `$file_untainted in `verify_src_file()`.
$f changes to `$file` in `find_src_files()`.

This attempts to fix commit f3abeac919.
For discussion see
<http://ikiwiki.info/todo/auto-create_tag_pages_according_to_a_template/>
2010-02-03 07:34:04 +01:00
David Riebenbauer 25741100b0 Export add_autofile() for use in Plugins. 2010-02-02 14:04:39 +01:00
David Riebenbauer f58f3e1bec Revert the effects of find_del_files() for (re)autoadded files.
This also means that if autoadded files are deleted they will just be
recreated.
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 f3c59ed3e5 Process files from @autofiles in refresh().
To make automatically added files render they have to be added to the $files,
$pages, $new, and $changed variables.

After that scan() is called on them.
2010-02-02 14:04:28 +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
David Riebenbauer f3abeac919 Code deduplication fin find_src_files()
This also has the advantage that I can use the resulting new function
elsewhere.
2010-02-02 14:04:28 +01:00
Joey Hess 49d8c5b821 setup automator: Configure Term::Readline to use bold for prompt, rather than default underline. Closes: #517656 2010-02-01 15:18:53 -05: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 32472c02eb brace style 2010-01-18 12:33:25 -05:00
Joey Hess 461804a5e4 clarify error 2010-01-18 12:09:54 -05:00
Joey Hess 97bc5d8bca typos 2010-01-18 12:08:26 -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 6a0af02d3f make decode_form_utf8 safe for arrays 2010-01-09 16:07:01 -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 4c89a26934 fix actions accounting 2010-01-04 12:51:45 -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 3fd8a7f91c cvs: Add missing bit to Automator. 2009-12-02 17:22:42 -05:00
Joey Hess ae161be8f9 fix inverted test 2009-12-02 13:07:58 -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 f1ddf4bd98 fix bestlink to not return just-deleted pages
bestlink was looking at whether %links existed for a page in order to tell
if the page exists, but just-deleted pages still have entries in there (for
reasons it may be best not to explore). So bestlink would return
just-deleted pages. Instead, make bestlink use %pagesources.

Also, when finding a deleted page, %pagecase was not cleared of that page.
This, again, made bestlink return just-deleted pages. Now that is cleared.

Fixing bestlink exposed another issue though. The backlink calculation code
uses bestlink. So when a page was deleted, no backlinks to it are found,
and pages that really did backlink to it were not updated, and had broken
links.

To fix that, the code that actually removes deleted pages had to be split
out from find_del_files, so it can run a bit later. It is run just after
backlinks are calculated. This way, backlink calculation still sees the
deleted pages, but everything afterwards does not.

However, it does not address the original bug report that started this
whole thing, [[bugs/bestlink_returns_deleted_pages]]. Because there
bestlink is run in the needsbuild hook. And that happens before backlink
calculation, and so bestlink still returns deleted pages then. Also in the
scan hook.

If bestlink needs to work consistently during those hooks, a more involved
fix will be needed.
2009-11-30 17:34:29 -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 66b46576ec Moved the postscan hook to run on the raw html of a page, before the template is filled out. This improves the search plugin's indexing, since it will not include navigational elements from the page template or sidebar. 2009-11-08 13:48:07 -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 ce785c8702 fix url encoding in redir
When redirecting to a page, ie, after editing, ensure that the url is
uri-encoded. Most browsers other than MSIE don't care, but it's the right
thing to do.

The known failure case involved editing a page that had utf-8 in the name
using MSIE.
2009-10-29 10:17:30 -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 b6f6f126d0 avoid -O default for CFLAGS, and document 2009-10-21 16:27:47 -04:00
Giulio Eulisse 990a4b99b0 Pick up user specified CFLAGS when compiling the wrapper.
(cherry picked from commit 13e9383b48857daa206387f3486eb00e3b171a68)
2009-10-21 16:10:14 -04:00
Joey Hess 587e0c3d21 Fix a bug introduced in the last version that caused ikiwiki to skip all files if a sourcedir of "./" was specified. 2009-10-21 13:50:49 -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 37ec6a8243 Merge branch 'master' into dependency-types
Conflicts:
	IkiWiki.pm
	IkiWiki/Render.pm
	debian/changelog
2009-10-08 20:33:58 -04:00
Joey Hess bc4ef28f3e pagestate: switch to use_pagespec 2009-10-08 20:29:51 -04:00
Joey Hess 3bb00d142a Optimize away most expensive file prune calls, when refreshing
Benchmarking refresh of a a wiki with 25 thousand pages showed
file_pruned() using most of the time. But, when refreshing, ikiwiki already
knows about nearly all the files. So we can skip calling file_pruned() for
those it knows about. While tricky to do, this sped up a refresh (that
otherwise does no work) by 10-50%.
2009-10-08 20:27:56 -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 136979fac6 fix backlink new change detection code 2009-10-07 14:08:03 -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 ee56af29e1 typo 2009-10-06 18:45:22 -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 ba1dfb4ec6 fix support of a single dependency that combines links and exists types
This is very common, and the code has to test each type differently, since
the list of candidates to test, as well as the test, will vary per type.
Much happier with this code now.
2009-10-06 18:09:46 -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 2494a23fdd fix handling of links+content dependency
Such a dependency is unlikely, but can happen.
2009-10-06 04:45:57 -04:00
Joey Hess 2a0e6b782c refactor 3
Only left one new global
2009-10-06 02:00:34 -04:00
Joey Hess 96b1f95192 refresh refactor 2
killed one global
2009-10-06 00:10:20 -04:00
Joey Hess 577eed0e7e split up refresh
I'd rather have the global variables than the 300 line function
2009-10-05 23:54:29 -04:00
Joey Hess fd7b5767d3 new link change detection method and general code rework
This new method for determining when links on pages
have changed should be more efficient, since it avoids
double calculation of the bestlinks.

It also allows collecting data about the old links, before
the scan pass, so the data is accurate when pages move around
and bestlinks change.

Also got some code back to a saner indent level.
2009-10-05 22:21:25 -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 c6bf4228d5 make links dependencies fire if broken links change 2009-10-05 15:01:05 -04:00
Joey Hess e96992bbc8 fix add_depends to new api 2009-10-05 14:33:42 -04:00
Joey Hess 666a9613a1 implement links dependencies
Involved some code refactoring so that same code that detects
link changes for backlinks updating can be used for link dependency
checking. The nice thing is that link dep checking is thus
comopletly free!
2009-10-05 14:33:23 -04:00
Joey Hess 89b65695e7 typos 2009-10-05 13:40:35 -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 9403045b7e Merge branch 'dependency-types' into transitive-dependencies
Conflicts:
	IkiWiki/Render.pm
2009-10-04 16:33:58 -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 26dbc09bd8 implement support for DEPEND_EXISTS
Preliminary support, anyway.

If a dependency only includes DEPEND_EXISTS, then only changes that
involved adding or deleting a page can trigger it.

This is complicated by internal pages, since the code did not previously
differentiate between add, delete, and change of internal pages.
Now it tracks change separately from add+delete, so DEPEND_EXISTS pagespecs
that actually match internal pages (which will probably be quite rare in
practice) should work.
2009-10-03 15:50:22 -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 52134dc0ef minor optimisation
As soon as a change happens, we know we will need to rescan all
dependencies from the start, so bail out of the current scan partway to
avoid doing redundant work.

Only problem with this is that ikiwiki sometimes ends up printing out
dependencies that, while correct, are not obvious. Before:

building B, which depends on A
building C, which depends on A
building D, which depends on A

After:

building B, which depends on A
building C, which depends on B
building D, which depends on C
2009-10-02 15:41:09 -04:00
Joey Hess 71eabd44d5 handle transitive dependencies by re-running dep resolver
This is a rather expensive solution to the transitive dependency problem.
2009-10-02 15:38:04 -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 3f5a646a41 avoid ugly messages when running ikiwiki -setup on a *directory* 2009-09-23 14:56:18 -04:00
Joey Hess 01a9a12bbf auto.setup, auto-blog.setup: Fix sanitization of entered wikiname. Closes: #547378 2009-09-23 13:46:32 -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 e3f5fdcf37 remove hook not used by cvs 2009-09-10 16:28:39 -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 f5bd1cf3cd typo 2009-09-10 13:49:42 -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 55474f44d9 Expand banned_users; it can now include PageSpecs, which allows banning by IP address. 2009-09-08 15:17:39 -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 5e94e973ee Only examine argv if the VCS is cvs. 2009-08-30 02:00:49 -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 992d0aac09 The string to match might not be "New directory" exactly, so match that
substring instead.
2009-08-30 00:05:23 -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
Joey Hess 125c6ec650 <pedant>rename depends_exact to depends_simple
It's not "exact" since case munging has to be done, and I think
"simple" captures the optimisation better.</pedant>

With apologies to smcv, who probably has to rebuild his wiki now.
2009-08-28 15:13:45 -04:00
Simon McVittie 20a38fbf6d Avoid duplicating debug message for building a page due to a dependency
As per Joey's review
2009-08-28 15:42:07 +01:00
Simon McVittie 2a7f3b91d4 Force %depends_exact to lower case, fixing incorrect case-sensitivity 2009-08-28 15:42:04 +01: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 ec2367cfbf Fix typo in dependency debug message 2009-08-28 15:34:35 +01:00
Simon McVittie c80a3cbcfd Add depends_exact: simplified dependency tracking for dependencies on a single page
Let E be the number of dependencies per page of the form "A depends on B and
nothing else", let D be the number of other dependencies per page,
let P be the total number of pages, and let C be the number of changed
pages in a refresh.

This patch should speed up a refresh from O(E*C*P + D*C*P) to
O(C + E*P + D*C*P), assuming that hash lookups are O(1).

In practice, plugins like inline and map produce a lot of these very simple
dependencies, and my album plugin's combination of inline with a large
number of pages causes it to suffer particularly badly.

In testing on a wiki with about 7000 objects (3500 full pages, 3500
images), a full rebuild continued to take about 5:30, and a refresh
after touching about 350 pages and 350 images reduced from 5:30 to 1:30.

As with my previous optimizations, this change will result in downgrades not
working correctly until the wiki is rebuilt.
2009-08-28 15:34:35 +01: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 7dd9b65db4 don't use pagespec_match_list
This should be more efficient than pagespec_match_list since it short-circuits
after the first match is found.

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

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

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

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

Getting the benefit of this change on an existing wiki requires a rebuild.
2009-08-24 23:18:10 +01:00
Amitai Schlair 5da229aa51 Instead of passing the args through the wrapper so the CVS plugin
can evaluate them, check them in the wrapper right off the bat.
This doesn't prevent the deadlock in web commits that need to cvs
add directories, but I'm committing so Joey can take a look if he
wants.
2009-08-23 18:25:02 -04: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 63ce4459f5 fix some more foreaches that clal functions to not use $_ 2009-08-12 12:49:16 -04:00
Joey Hess 906c8f6e58 use a more idiomatic foreach my 2009-08-12 12:43:57 -04:00
Joey Hess 04014e4775 inline: Avoid use of my $_ as it fails with older perls. Closes: #541215 2009-08-12 12:33:02 -04:00
Joey Hess b4d7dfcbe1 po: Detect if nowrapi18n can't be passed to po4a, and warn about the old version, but continue. Closes: #541205 2009-08-12 12:26:07 -04:00
Joey Hess 83480665c2 po: Fix copy of po file from underlay when editing
When first editing a page that was in the underlay, avoid losing
the translation by copying the po file over from the underlay.
2009-08-10 15:59:32 -04:00
Joey Hess 8f6e0212fd verify page name is sane
paranoia; I was thinking about XSS attacks specificaly
2009-08-08 12:27:48 -04:00
Joey Hess 22edaf77c2 fix misleading comment 2009-08-08 12:23:50 -04:00
Joey Hess 79312b2754 Merge commit 'smcv/ready/getsource'
Conflicts:
	debian/changelog
2009-08-08 12:22:10 -04:00
Joey Hess f1a70921e3 Merge commit 'remotes/smcv/ready/inline-pagenames' into staging 2009-07-31 10:25:43 +02:00
Joey Hess 0bbb3d201e Merge commit 'remotes/smcv/ready/harishcm-map-fix' into staging 2009-07-31 10:23:06 +02:00
Joey Hess 3d27dac809 Merge commit 'remotes/smcv/ready/among' 2009-07-31 10:12:23 +02:00
Joey Hess 9d96250fc5 img: Fix adding of dependency from page to the image.
This was impressively broken. add_depends was being called with params
backwards, and on parameter was set to the name of the generated
file, which isn't in the source.

Now updates to images will update the page that contains them, thus
updating them. This is unncessary for fullsize images, so skipped.
2009-07-27 22:22:26 +02:00
Simon McVittie 70b1c2aabd getsource: remove temporary variable 2009-07-27 11:58:36 +01:00
Simon McVittie 2ef53b128d getsource: remove unnecessary IkiWiki:: prefixes
Many variables and functions are exported.
2009-07-26 17:04:49 +01:00
Simon McVittie ea244ab7b5 getsource: don't allow getting the source of an attachment
Serving up images etc. as text/plain; charset=utf-8 is unlikely to work
very well, and there's no point in having this CGI action for attachments
(since they're copied into the output as-is anyway).
2009-07-26 17:04:34 +01:00
Simon McVittie 0afcec7346 getsource: turn missing pages into a 404
Also restructure so we return early on missing pages.
2009-07-26 17:04:30 +01:00
Simon McVittie 3f520da78a getsource: default to saying page source is in UTF-8, and make the example match the default
IkiWiki mostly assumes that pages are in UTF-8; anyone this doesn't work
for can override it in the setup file.
2009-07-26 16:36:17 +01:00
Simon McVittie eaf59e5ba9 getsource: run as plain CGI, rather than sessioncgi
As I suggested when reviewing Will's code, calling loadindex() should be
sufficient.
2009-07-26 16:33:12 +01:00
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
Jonas Smedegaard dc9e0f3e32 Fix typo attepting→attempting 2009-07-23 00:41:33 +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 73ae87a4d4 split two helper functions of of render() 2009-07-20 05:23:16 +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 9c13e29d4f IkiWiki::Render: split out backlink_pages() function from backlinks()
This separates style from content - backlinks() performs lossy
transformations on the page names to get it in the form that the page
template wants.
2009-07-17 11:12:50 +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
intrigeri 17b3d73f6e Revert "quick fix for http://ikiwiki.info/bugs/unwanted_discussion_links_on_discussion_pages/"
This reverts commit 2ed033a4aa.
It has been more properly fixed in upstream's master, that will be merged in
immediately.

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-06-06 14:01:28 +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 0293ae8e3d Setup automator: Check that each plugin added to the generated setup file can be loaded and that its config is ok. If a plugin fails for any reason, disable it in the generated file. Closes: 532001 2009-06-05 16:58:06 -04:00
Joey Hess 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
Joey Hess 6842328405 Avoid relying on translators preserving the case when translating "discussion", which caused Discussion pages to get unwanted Discussion links. 2009-06-04 13:15:05 -04:00
intrigeri 091f11be76 po: better discussion link logic
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-06-03 18:30:00 +02:00
intrigeri 2ed033a4aa quick fix for http://ikiwiki.info/bugs/unwanted_discussion_links_on_discussion_pages/
Signed-off-by: intrigeri <intrigeri@boum.org>
2009-06-03 18:29:20 +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 760e100947 Merge branch 'darcs'
Conflicts:
	debian/changelog
2009-04-04 18:38:16 -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 91e583bce1 fix name of wrapper 2009-04-04 18:32:41 -04:00
Joey Hess 01b063d2e2 fix bug I introduced 2009-04-04 18:30:29 -04:00
Joey Hess 3fb4653d8a Add missing newline to Confirm Password prompt. 2009-04-04 18:25:52 -04:00
Joey Hess a9c0d7e288 support darcs in setup automator
use a consistent name for the ikiwiki wrapper file
2009-04-04 18:17:38 -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
intrigeri cc5be82b8b revert exposing of %backlinks and $backlinks_calculated
This change was introduced in 85f865b5d9 and
c3af3840a2 ; it may be necessary for the meta-po
integration, but the po branch alone is supposed to work without it.

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-03-09 00:16:39 +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 062f87ce38 Setup automator: Fix bug in password comparison. Closes: #517654 2009-03-01 15:01:08 -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 158c6c3ac8 detect sslcookie set and no https
This is likely a misconfiguration and can cause login to fail as the
browser refuses the send the session cookie back over http.

Not entirely happy with putting the check where I did, since users have to
try to log in, and fail, to see the misconfiguration explained. But I could
not find a better place to put the check.
2009-02-26 01:59:05 -05:00
Joey Hess 63439fa10b bzr: Add missing stub rcs_diff. 2009-02-25 16:56:02 -05:00
Joey Hess 8682daad58 Setup automator: Prompt for password twice. Closes: #516973 2009-02-24 16:35:33 -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
Joey Hess badc6c229f Create any missing directory necessary to put the wrapper file into. Closes: #514384 2009-02-09 15:13:12 -05:00
Joey Hess 9711181a3f doubled semicolon 2009-02-04 13:12:05 -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 dedbe110f2 CGI: pad error responses with 512 bytes of spaces so IE will display them
IE displays its own error responses unless the server's was >= 512 bytes.
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294807
2009-01-31 18:26:37 +00:00
Simon McVittie 170b86a2ef CGI: set up goto hook so that /ikiwiki.cgi?do=goto can be an Apache ErrorDocument 2009-01-31 18:09:24 +00:00
Simon McVittie 8322b8c9c8 CGI: add cgi_page_from_404(), which remaps a path like $REDIRECT_URL to an IkiWiki page name
Also add a regression test
2009-01-31 18:07:42 +00:00
Simon McVittie 3e290ce7ee IkiWiki::Wrapper: allow REDIRECT_STATUS and REDIRECT_URL through from environment
This is useful to act as an Apache 404 ErrorDocument.
2009-01-31 18:06:44 +00:00
Simon McVittie 78d1b2340e CGI: if the page is missing, give the "missing page" a 404 status 2009-01-31 16:51:13 +00:00
Simon McVittie 5ce3a01300 CGI: document why commenter and recentchanges_link are supported 2009-01-31 15:05:17 +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
Simon McVittie 18f4aeffb1 CGI: if the "do" parameter is goto, recentchanges_link or commenter, redirect to a page
This can replace equivalent functionality in comments and recentchanges.
2009-01-31 14:48:44 +00:00
Simon McVittie c2dafcb4e5 CGI: add cgi_goto(CGI, [page])
This redirects to the given page (or if none is given, the page parameter
given to the CGI), or displays an error with a create link if the page
doesn't exist.
2009-01-31 14:36:23 +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
Joey Hess 639f464cb3 Avoid feeding decoded unicode to Term::ReadLine
That resulted in double encoded display when using perl's stub
readline module. Apparently that module unconditionally upgrades
text to utf8, in a quite braindead way.

(Term::ReadLine::Gnu::Perl worked ok.)
2009-01-18 14:52:49 -05: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 e6992480e2 Merge commit 'upstream/master' into prv/po
Conflicts:

	debian/control
2009-01-15 20:04:31 +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 6d785d6401 Add auto-blog.setup
It will set up an ikiwiki instance tuned for use in blogging.

As part of this change, move the example sites into /usr/share/ikiwiki so
they are available even if docs are not installed.
2009-01-12 19:04:24 -05: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 c3af3840a2 Render.pm: also use 'our' for $backlinks_calculated
Since %backlinks are now declared with 'our', this variable must be as well.

Signed-off-by: intrigeri <intrigeri@boum.org>
2009-01-01 13:07:08 +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