Erreur : %s s'est terminé, valeur de sortie nonzero (%s)"
+msgstr ""
+"
Erreur : %s s'est terminé, valeur de sortie nonzero (%s)"
#: ../IkiWiki/Receive.pm:35
#, perl-format
msgid "cannot determine id of untrusted committer %s"
-msgstr "Impossible de déterminer l'identifiant de %s, (enregistrement non fiable)"
+msgstr ""
+"Impossible de déterminer l'identifiant de %s, (enregistrement non fiable)"
#: ../IkiWiki/Receive.pm:85
#, perl-format
@@ -929,19 +931,19 @@ msgstr "Le nom du fichier CGI n'a pas été indiqué"
#. translators: The first parameter is a filename, and the second is
#. translators: a (probably not translated) error message.
-#: ../IkiWiki/Wrapper.pm:79
+#: ../IkiWiki/Wrapper.pm:97
#, perl-format
msgid "failed to write %s: %s"
msgstr "Échec de l'écriture de %s : %s"
#. translators: The parameter is a C filename.
-#: ../IkiWiki/Wrapper.pm:135
+#: ../IkiWiki/Wrapper.pm:154
#, perl-format
msgid "failed to compile %s"
msgstr "Échec de la compilation de %s"
#. translators: The parameter is a filename.
-#: ../IkiWiki/Wrapper.pm:155
+#: ../IkiWiki/Wrapper.pm:174
#, perl-format
msgid "successfully generated %s"
msgstr "%s a été créé avec succès"
@@ -954,41 +956,42 @@ msgstr "Syntaxe : ikiwiki [options] source destination"
msgid " ikiwiki --setup configfile"
msgstr " ikiwiki --setup fichier de configuration"
-#: ../ikiwiki.in:90
+#: ../ikiwiki.in:91
msgid "usage: --set var=value"
msgstr "Syntaxe : -- set var=valeur"
-#: ../ikiwiki.in:138
+#: ../ikiwiki.in:139
msgid "generating wrappers.."
msgstr "Création des fichiers CGI..."
-#: ../ikiwiki.in:195
+#: ../ikiwiki.in:197
msgid "rebuilding wiki.."
msgstr "Reconstruction du wiki..."
-#: ../ikiwiki.in:198
+#: ../ikiwiki.in:200
msgid "refreshing wiki.."
msgstr "Rafraîchissement du wiki..."
-#: ../IkiWiki.pm:466
+#: ../IkiWiki.pm:480
msgid "Must specify url to wiki with --url when using --cgi"
-msgstr "Vous devez indiquer l'URL du wiki par --url lors de l'utilisation de --cgi"
+msgstr ""
+"Vous devez indiquer l'URL du wiki par --url lors de l'utilisation de --cgi"
-#: ../IkiWiki.pm:512
+#: ../IkiWiki.pm:526
msgid "cannot use multiple rcs plugins"
msgstr "impossible d'utiliser plusieurs systèmes de contrôle des versions"
-#: ../IkiWiki.pm:541
+#: ../IkiWiki.pm:555
#, perl-format
msgid "failed to load external plugin needed for %s plugin: %s"
msgstr "Impossible de charger le greffon externe nécessaire au greffon %s : %s"
-#: ../IkiWiki.pm:1165
+#: ../IkiWiki.pm:1187
#, perl-format
msgid "preprocessing loop detected on %s at depth %i"
msgstr "une boucle de pré traitement a été détectée sur %s à hauteur de %i"
-#: ../IkiWiki.pm:1678
+#: ../IkiWiki.pm:1688
msgid "yes"
msgstr "oui"
diff --git a/po/ikiwiki.pot b/po/ikiwiki.pot
index feb36c742..11c865363 100644
--- a/po/ikiwiki.pot
+++ b/po/ikiwiki.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-11-11 20:48-0500\n"
+"POT-Creation-Date: 2008-12-11 14:46-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
@@ -48,7 +48,7 @@ msgstr ""
msgid "You are banned."
msgstr ""
-#: ../IkiWiki/CGI.pm:385 ../IkiWiki/CGI.pm:386 ../IkiWiki.pm:1189
+#: ../IkiWiki/CGI.pm:385 ../IkiWiki/CGI.pm:386 ../IkiWiki.pm:1204
msgid "Error"
msgstr ""
@@ -111,16 +111,16 @@ msgstr ""
msgid "(invalid UTF-8 stripped from feed)"
msgstr ""
-#: ../IkiWiki/Plugin/aggregate.pm:504
+#: ../IkiWiki/Plugin/aggregate.pm:506
#, perl-format
msgid "(feed entities escaped)"
msgstr ""
-#: ../IkiWiki/Plugin/aggregate.pm:510
+#: ../IkiWiki/Plugin/aggregate.pm:514
msgid "feed crashed XML::Feed!"
msgstr ""
-#: ../IkiWiki/Plugin/aggregate.pm:591
+#: ../IkiWiki/Plugin/aggregate.pm:595
#, perl-format
msgid "creating new page %s"
msgstr ""
@@ -129,7 +129,7 @@ msgstr ""
msgid "deleting bucket.."
msgstr ""
-#: ../IkiWiki/Plugin/amazon_s3.pm:38 ../ikiwiki.in:206
+#: ../IkiWiki/Plugin/amazon_s3.pm:38 ../ikiwiki.in:208
msgid "done"
msgstr ""
@@ -172,7 +172,7 @@ msgid "automatic index generation"
msgstr ""
#: ../IkiWiki/Plugin/brokenlinks.pm:33 ../IkiWiki/Plugin/editpage.pm:261
-#: ../IkiWiki/Plugin/inline.pm:327 ../IkiWiki/Plugin/opendiscussion.pm:26
+#: ../IkiWiki/Plugin/inline.pm:344 ../IkiWiki/Plugin/opendiscussion.pm:26
#: ../IkiWiki/Plugin/orphans.pm:37 ../IkiWiki/Render.pm:79
#: ../IkiWiki/Render.pm:149
msgid "discussion"
@@ -320,15 +320,15 @@ msgstr ""
msgid "failed to determine size of image %s"
msgstr ""
-#: ../IkiWiki/Plugin/inline.pm:93
+#: ../IkiWiki/Plugin/inline.pm:92
msgid "Must specify url to wiki with --url when using --rss or --atom"
msgstr ""
-#: ../IkiWiki/Plugin/inline.pm:139
+#: ../IkiWiki/Plugin/inline.pm:138
msgid "page editing not allowed"
msgstr ""
-#: ../IkiWiki/Plugin/inline.pm:156
+#: ../IkiWiki/Plugin/inline.pm:155
msgid "missing pages parameter"
msgstr ""
@@ -337,20 +337,20 @@ msgstr ""
msgid "unknown sort type %s"
msgstr ""
-#: ../IkiWiki/Plugin/inline.pm:285
+#: ../IkiWiki/Plugin/inline.pm:297
msgid "Add a new post titled:"
msgstr ""
-#: ../IkiWiki/Plugin/inline.pm:301
+#: ../IkiWiki/Plugin/inline.pm:318
#, perl-format
msgid "nonexistant template %s"
msgstr ""
-#: ../IkiWiki/Plugin/inline.pm:335 ../IkiWiki/Render.pm:83
+#: ../IkiWiki/Plugin/inline.pm:352 ../IkiWiki/Render.pm:83
msgid "Discussion"
msgstr ""
-#: ../IkiWiki/Plugin/inline.pm:572
+#: ../IkiWiki/Plugin/inline.pm:577
msgid "RPC::XML::Client not found, not pinging"
msgstr ""
@@ -563,16 +563,16 @@ msgstr ""
msgid "need either `percent` or `totalpages` and `donepages` parameters"
msgstr ""
-#: ../IkiWiki/Plugin/recentchanges.pm:100
+#: ../IkiWiki/Plugin/recentchanges.pm:101
msgid "missing page"
msgstr ""
-#: ../IkiWiki/Plugin/recentchanges.pm:102
+#: ../IkiWiki/Plugin/recentchanges.pm:103
#, perl-format
msgid "The page %s does not exist."
msgstr ""
-#: ../IkiWiki/Plugin/recentchangesdiff.pm:36
+#: ../IkiWiki/Plugin/recentchangesdiff.pm:37
msgid "(Diff truncated)"
msgstr ""
@@ -935,41 +935,41 @@ msgstr ""
msgid " ikiwiki --setup configfile"
msgstr ""
-#: ../ikiwiki.in:90
+#: ../ikiwiki.in:91
msgid "usage: --set var=value"
msgstr ""
-#: ../ikiwiki.in:138
+#: ../ikiwiki.in:139
msgid "generating wrappers.."
msgstr ""
-#: ../ikiwiki.in:195
+#: ../ikiwiki.in:197
msgid "rebuilding wiki.."
msgstr ""
-#: ../ikiwiki.in:198
+#: ../ikiwiki.in:200
msgid "refreshing wiki.."
msgstr ""
-#: ../IkiWiki.pm:473
+#: ../IkiWiki.pm:480
msgid "Must specify url to wiki with --url when using --cgi"
msgstr ""
-#: ../IkiWiki.pm:519
+#: ../IkiWiki.pm:526
msgid "cannot use multiple rcs plugins"
msgstr ""
-#: ../IkiWiki.pm:548
+#: ../IkiWiki.pm:555
#, perl-format
msgid "failed to load external plugin needed for %s plugin: %s"
msgstr ""
-#: ../IkiWiki.pm:1172
+#: ../IkiWiki.pm:1187
#, perl-format
msgid "preprocessing loop detected on %s at depth %i"
msgstr ""
-#: ../IkiWiki.pm:1673
+#: ../IkiWiki.pm:1688
msgid "yes"
msgstr ""
--
cgit v1.2.3
From 574640b06943939d08ff99833f8028e091a6daf2 Mon Sep 17 00:00:00 2001
From: tschwinge
Date: Thu, 11 Dec 2008 19:36:36 -0500
Subject: Fix cut'n'past-o.
---
doc/plugins/cutpaste.mdwn | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'doc/plugins')
diff --git a/doc/plugins/cutpaste.mdwn b/doc/plugins/cutpaste.mdwn
index 1b78e60fc..f74f8a269 100644
--- a/doc/plugins/cutpaste.mdwn
+++ b/doc/plugins/cutpaste.mdwn
@@ -1,4 +1,4 @@
-[[!template id=plugin name=toggle author="[[Enrico]]"]]
+[[!template id=plugin name=cutpaste author="[[Enrico]]"]]
[[!tag type/chrome]]
This plugin provides the [[ikiwiki/directive/cut]],
--
cgit v1.2.3
From b8c16705006a8f4562bd2f2b525a9d978ed18a8b Mon Sep 17 00:00:00 2001
From: "http://smcv.pseudorandom.co.uk/"
Date: Fri, 12 Dec 2008 06:29:02 -0500
Subject: update with some more code improvements
---
doc/plugins/contrib/comments.mdwn | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
(limited to 'doc/plugins')
diff --git a/doc/plugins/contrib/comments.mdwn b/doc/plugins/contrib/comments.mdwn
index a832c571a..47295ebe1 100644
--- a/doc/plugins/contrib/comments.mdwn
+++ b/doc/plugins/contrib/comments.mdwn
@@ -50,12 +50,12 @@ can use the following additional ``s:
* `COMMENTAUTHORURL`: if the user was signed in with an OpenID, that URL; if the user was signed
in with some other username, a CGI URL that redirects to their user page (if any)
-This plugin also adds a `\[[!comment]]` directive which is used when storing comments. This
-directive shouldn't be used on pages that are edited in the usual way.
+This plugin also adds a `\[[!_comment]]` directive which is used when storing comments. This
+directive is for internal use only and shouldn't be used on pages that are edited in the usual way.
This plugin aims to close the [[todo]] item "[[todo/supporting_comments_via_disussion_pages]]",
and is currently available from [[smcv]]'s git repository on git.pseudorandom.co.uk (it's the
-`comments-rebase1` branch). A demo wiki with the plugin enabled is running at
+`comments-rebase2` branch). A demo wiki with the plugin enabled is running at
; the
[sandbox page](http://www.pseudorandom.co.uk/2008/ikiwiki/demo/sandbox/#comments) has some
examples of comments.
@@ -67,11 +67,8 @@ Known issues:
* There is some common code cargo-culted from other plugins (notably inline and editpage) which
should probably be shared
* Joey doesn't think it should necessarily use internal pages (see [[discussion]])
-* `\[[!comment]]` should perhaps be `\[[!_comment]]`, or a special filter/htmlize hook rather
- than being a directive at all
* Previews always say "unknown IP address"
-* [[todo/inline_plugin:_ability_to_override_the_feed_name]]
-* [[todo/inline_plugin:_hide_feed_buttons_if_empty]]
+* Add `COMMENTOPENID`: the authenticated/verified user name, if and only if it was an OpenID
> I haven't done a detailed code review, but I will say I'm pleased you
> avoided re-implementing inline! --[[Joey]]
@@ -84,5 +81,9 @@ Fixed issues:
* tbm wanted anonymous people to be able to enter their name and possibly email
address; a name and website can now be supplied
* There is now an indication of who you're signed in as
-* Each comment is now one big \[[!comment]] directive invocation, avoiding previous
+* Each comment is now one big \[[!_comment]] directive invocation, avoiding previous
issues with unambiguous and un-spoofable metadata
+* `\[[!comment]]` should be `\[[!_comment]]`, or a special filter/htmlize hook rather
+ than being a directive at all
+* [[todo/inline_plugin:_ability_to_override_the_feed_name]]
+* [[todo/inline_plugin:_hide_feed_buttons_if_empty]]
--
cgit v1.2.3
From 5625be3bcd76b5990cb7799437def3521cc53a9d Mon Sep 17 00:00:00 2001
From: "http://smcv.pseudorandom.co.uk/"
Date: Fri, 12 Dec 2008 06:34:51 -0500
Subject: Another TODO item
---
doc/plugins/contrib/comments.mdwn | 2 ++
1 file changed, 2 insertions(+)
(limited to 'doc/plugins')
diff --git a/doc/plugins/contrib/comments.mdwn b/doc/plugins/contrib/comments.mdwn
index 47295ebe1..d2ca8d17d 100644
--- a/doc/plugins/contrib/comments.mdwn
+++ b/doc/plugins/contrib/comments.mdwn
@@ -69,6 +69,8 @@ Known issues:
* Joey doesn't think it should necessarily use internal pages (see [[discussion]])
* Previews always say "unknown IP address"
* Add `COMMENTOPENID`: the authenticated/verified user name, if and only if it was an OpenID
+* The default template should have a (?) icon next to unauthenticated users (with the IP address
+ as title) and an OpenID icon next to OpenIDs
> I haven't done a detailed code review, but I will say I'm pleased you
> avoided re-implementing inline! --[[Joey]]
--
cgit v1.2.3
From 9d5075ab521a24d718a2b663e11856c8cc80eb03 Mon Sep 17 00:00:00 2001
From: Joey Hess
Date: Fri, 12 Dec 2008 14:52:05 -0500
Subject: first pass through comments documentation
Moved documentation out of contrib.
Mostly tweaked some wording. Moved documentation of various bits to other
pages (pagespec, etc), and linked to those.
Documented the new templates in wikitemplates.
Small quantities of documentation were removed. Particularly the list of
template variables, which I think is fairly obvious when editing the
template.
---
doc/ikiwiki/pagespec.mdwn | 2 +
doc/plugins/anonok.mdwn | 7 +-
doc/plugins/comments.mdwn | 52 +++++++++
doc/plugins/comments/discussion.mdwn | 160 +++++++++++++++++++++++++++
doc/plugins/contrib/comments.mdwn | 91 ---------------
doc/plugins/contrib/comments/discussion.mdwn | 160 ---------------------------
doc/plugins/lockedit.mdwn | 4 +
doc/wikitemplates.mdwn | 4 +
8 files changed, 228 insertions(+), 252 deletions(-)
create mode 100644 doc/plugins/comments.mdwn
create mode 100644 doc/plugins/comments/discussion.mdwn
delete mode 100644 doc/plugins/contrib/comments.mdwn
delete mode 100644 doc/plugins/contrib/comments/discussion.mdwn
(limited to 'doc/plugins')
diff --git a/doc/ikiwiki/pagespec.mdwn b/doc/ikiwiki/pagespec.mdwn
index c78666c40..90b96c936 100644
--- a/doc/ikiwiki/pagespec.mdwn
+++ b/doc/ikiwiki/pagespec.mdwn
@@ -47,6 +47,8 @@ Some more elaborate limits can be added to what matches using these functions:
wiki admins.
* "`ip(address)`" - tests whether a modification is being made from the
specified IP address.
+* "`postcomment(glob)`" - matches internal-use pages created by the
+ comments plugin as comments for pages that match the specified glob.
For example, to match all pages in a blog that link to the page about music
and were written in 2005:
diff --git a/doc/plugins/anonok.mdwn b/doc/plugins/anonok.mdwn
index 2a8a922cd..ab2f744e2 100644
--- a/doc/plugins/anonok.mdwn
+++ b/doc/plugins/anonok.mdwn
@@ -5,5 +5,10 @@ By default, anonymous users cannot edit the wiki. This plugin allows
anonymous web users, who have not signed in, to edit any page in the wiki
by default.
-The plugin also has a configuration setting, `anonok_pagespec`. This
+The plugin also has a configuration setting, `anonok_pages`. This
[[PageSpec]] can be used to allow anonymous editing of matching pages.
+
+If you're using the [[comments]] plugin, you can allow anonymous comments
+to be posted by setting:
+
+ anonok_pages => "postcomment(*)"
diff --git a/doc/plugins/comments.mdwn b/doc/plugins/comments.mdwn
new file mode 100644
index 000000000..347d7fc8d
--- /dev/null
+++ b/doc/plugins/comments.mdwn
@@ -0,0 +1,52 @@
+[[!template id=plugin name=comments author="[[Simon_McVittie|smcv]]"]]
+[[!tag type/useful]]
+
+This plugin adds "blog-style" comments. Unlike the wiki-style freeform
+Discussion pages, these comments are posted by a simple form, cannot later
+be edited, and rss/atom feeds are provided of each page's comments.
+
+When using this plugin, you should also enable [[htmlscrubber]] and either
+[[htmltidy]] or [[htmlbalance]]. Directives are filtered out by default, to
+avoid commenters slowing down the wiki by causing time-consuming
+processing. As long as the recommended plugins are enabled, comment
+authorship should hopefully be unforgeable by CGI users.
+
+The intention is that on a non-wiki site (like a blog) you can lock all
+pages for admin-only access, then allow otherwise unprivileged (or perhaps
+even anonymous) users to comment on posts. See the documentation of the
+[[lockedit]] and [[anonok]] pages for details on locking down a wiki so
+users can only post comments.
+
+Individual comments are stored as internal-use pages named something like
+`page/comment_1`, `page/comment_2`, etc. These pages internally use a
+`\[[!_comment]]` [[ikiwiki/directive]], and comment pages can be matched
+using a special `postcomment()` [[ikiwiki/PageSpec]].
+
+There are some global options for the setup file:
+
+* `comments_shown_pagespec`: pages where comments will be displayed inline,
+ e.g. `blog/*` or `!*/discussion`.
+* `comments_open_pagespec`: pages where new comments can be posted, e.g.
+ `blog/* and created_after(close_old_comments)` or `!*/discussion`
+* `comments_pagename`: if this is e.g. `comment_` (the default), then
+ comment pages will be named something like `page/comment_12`
+* `comments_allowdirectives`: if true (default false), comments may
+ contain IkiWiki [[directives|ikiwiki/directive]]
+* `comments_commit`: if true (default true), comments will be committed to
+ the version control system
+* `comments_allowauthor`: if true (default false), anonymous commenters may
+ specify a name for themselves, and the \[[!meta author]] and
+ \[[!meta authorurl]] directives will not be overridden by the comments
+ plugin
+
+Known issues:
+
+* Needs code review
+* The access control via postcomment() is rather strange (see [[discussion]] for more details)
+* There is some common code cargo-culted from other plugins (notably inline and editpage) which
+ should probably be shared
+* Joey doesn't think it should necessarily use internal pages (see [[discussion]])
+* Previews always say "unknown IP address"
+* Add `COMMENTOPENID`: the authenticated/verified user name, if and only if it was an OpenID
+* The default template should have a (?) icon next to unauthenticated users (with the IP address
+ as title) and an OpenID icon next to OpenIDs
diff --git a/doc/plugins/comments/discussion.mdwn b/doc/plugins/comments/discussion.mdwn
new file mode 100644
index 000000000..59740ec37
--- /dev/null
+++ b/doc/plugins/comments/discussion.mdwn
@@ -0,0 +1,160 @@
+## Why internal pages? (unresolved)
+
+Comments are saved as internal pages, so they can never be edited through the CGI,
+only by direct committers.
+
+> So, why do it this way, instead of using regular wiki pages in a
+> namespace, such as `$page/comments/*`? Then you could use [[plugins/lockedit]] to
+> limit editing of comments in more powerful ways. --[[Joey]]
+
+>> Er... I suppose so. I'd assumed that these pages ought to only exist as inlines
+>> rather than as individual pages (same reasoning as aggregated posts), though.
+>>
+>> lockedit is actually somewhat insufficient, since `check_canedit()`
+>> doesn't distinguish between creation and editing; I'd have to continue to use
+>> some sort of odd hack to allow creation but not editing.
+>>
+>> I also can't think of any circumstance where you'd want a user other than
+>> admins (~= git committers) and possibly the commenter (who we can't check for
+>> at the moment anyway, I don't think?) to be able to edit comments - I think
+>> user expectations for something that looks like ordinary blog comments are
+>> likely to include "others can't put words into my mouth".
+>>
+>> My other objection to using a namespace is that I'm not particularly happy about
+>> plugins consuming arbitrary pieces of the wiki namespace - /discussion is bad
+>> enough already. Indeed, this very page would accidentally get matched by rules
+>> aiming to control comment-posting... :-) --[[smcv]]
+
+>>> Thinking about it, perhaps one way to address this would be to have the suffix
+>>> (e.g. whether commenting on Sandbox creates sandbox/comment1 or sandbox/c1 or
+>>> what) be configurable by the wiki admin, in the same way that recentchanges has
+>>> recentchangespage => 'recentchanges'? I'd like to see fewer hard-coded page
+>>> names in general, really - it seems odd to me that shortcuts and smileys
+>>> hard-code the name of the page to look at. Perhaps I could add
+>>> discussionpage => 'discussion' too? --[[smcv]]
+
+>>> (I've now implemented this in my branch. --[[smcv]])
+
+>> The best reason to keep the pages internal seems to me to be that you
+>> don't want the overhead of every comment spawning its own wiki page. --[[Joey]]
+
+## Formats (resolved)
+
+The plugin now allows multiple comment formats while still using internal
+pages; each comment is saved as a page containing one `\[[!comment]]` directive,
+which has a superset of the functionality of [[ikiwiki/directives/format]].
+
+## Access control (unresolved?)
+
+By the way, I think that who can post comments should be controllable by
+the existing plugins opendiscussion, anonok, signinedit, and lockedit. Allowing
+posting comments w/o any login, while a nice capability, can lead to
+spam problems. So, use `check_canedit` as at least a first-level check?
+--[[Joey]]
+
+> This plugin already uses `check_canedit`, but that function doesn't have a concept
+> of different actions. The hack I use is that when a user comments on, say, sandbox,
+> I call `check_canedit` for the pseudo-page "sandbox[postcomment]". The
+> special `postcomment(glob)` [[ikiwiki/pagespec]] returns true if the page ends with
+> "[postcomment]" and the part before (e.g. sandbox) matches the glob. So, you can
+> have postcomment(blog/*) or something. (Perhaps instead of taking a glob, postcomment
+> should take a pagespec, so you can have postcomment(link(tags/commentable))?)
+>
+> This is why `anonok_pages => 'postcomment(*)'` and `locked_pages => '!postcomment(*)'`
+> are necessary to allow anonymous and logged-in editing (respectively).
+>
+> This is ugly - one alternative would be to add `check_permission()` that takes a
+> page and a verb (create, edit, rename, remove and maybe comment are the ones I
+> can think of so far), use that, and port the plugins you mentioned to use that
+> API too. This plugin could either call `check_can("$page/comment1", 'create')` or
+> call `check_can($page, 'comment')`.
+>
+> One odd effect of the code structure I've used is that we check for the ability to
+> create the page before we actually know what page name we're going to use - when
+> posting the comment I just increment a number until I reach an unused one - so
+> either the code needs restructuring, or the permission check for 'create' would
+> always be for 'comment1' and never 'comment123'. --[[smcv]]
+
+>> Now resolved, in fact --[[smcv]]
+
+> Another possibility is to just check for permission to edit (e.g.) `sandbox/comment1`.
+> However, this makes the "comments can only be created, not edited" feature completely
+> reliant on the fact that internal pages can't be edited. Perhaps there should be a
+> `editable_pages` pagespec, defaulting to `'*'`? --[[smcv]]
+
+## comments directive vs global setting (resolved?)
+
+When comments have been enabled generally, you still need to mark which pages
+can have comments, by including the `\[[!comments]]` directive in them. By default,
+this directive expands to a "post a comment" link plus an `\[[!inline]]` with
+the comments. [This requirement has now been removed --[[smcv]]]
+
+> I don't like this, because it's hard to explain to someone why they have
+> to insert this into every post to their blog. Seems that the model used
+> for discussion pages could work -- if comments are enabled, automatically
+> add the comment posting form and comments to the end of each page.
+> --[[Joey]]
+
+>> I don't think I'd want comments on *every* page (particularly, not the
+>> front page). Perhaps a pagespec in the setup file, where the default is "*"?
+>> Then control freaks like me could use "link(tags/comments)" and tag pages
+>> as allowing comments.
+>>
+>>> Yes, I think a pagespec is the way to go. --[[Joey]]
+
+>>>> Implemented --[[smcv]]
+
+>>
+>> The model used for discussion pages does require patching the existing
+>> page template, which I was trying to avoid - I'm not convinced that having
+>> every possible feature hard-coded there really scales (and obviously it's
+>> rather annoying while this plugin is on a branch). --[[smcv]]
+
+>>> Using the template would allow customising the html around the comments
+>>> which seems like a good thing? --[[Joey]]
+
+>>>> The \[[!comments]] directive is already template-friendly - it expands to
+>>>> the contents of the template `comments_embed.tmpl`, possibly with the
+>>>> result of an \[[!inline]] appended. I should change `comments_embed.tmpl`
+>>>> so it uses a template variable `INLINE` for the inline result rather than
+>>>> having the perl code concatenate it, which would allow a bit more
+>>>> customization (whether the "post" link was before or after the inline).
+>>>> Even if you want comments in page.tmpl, keeping the separate comments_embed.tmpl
+>>>> and having a `COMMENTS` variable in page.tmpl might be the way forward,
+>>>> since the smaller each templates is, the easier it will be for users
+>>>> to maintain a patched set of templates. (I think so, anyway, based on what happens
+>>>> with dpkg prompts in Debian packages with monolithic vs split
+>>>> conffiles.) --[[smcv]]
+
+>>>>> I've switched my branch to use page.tmpl instead; see what you think? --[[smcv]]
+
+## Raw HTML (resolved?)
+
+Raw HTML was not initially allowed by default (this was configurable).
+
+> I'm not sure that raw html should be a problem, as long as the
+> htmlsanitizer and htmlbalanced plugins are enabled. I can see filtering
+> out directives, as a special case. --[[Joey]]
+
+>> Right, if I sanitize each post individually, with htmlscrubber and either htmltidy
+>> or htmlbalance turned on, then there should be no way the user can forge a comment;
+>> I was initially wary of allowing meta directives, but I think those are OK, as long
+>> as the comment template puts the \[[!meta author]] at the *end*. Disallowing
+>> directives is more a way to avoid commenters causing expensive processing than
+>> anything else, at this point.
+>>
+>> I've rebased the plugin on master, made it sanitize individual posts' content
+>> and removed the option to disallow raw HTML. Sanitizing individual posts before
+>> they've been htmlized required me to preserve whitespace in the htmlbalance
+>> plugin, so I did that. Alternatively, we could htmlize immediately and always
+>> save out raw HTML? --[[smcv]]
+
+>>> There might be some use cases for other directives, such as img, in
+>>> comments.
+>>>
+>>> I don't know if meta is "safe" (ie, guaranteed to be inexpensive and not
+>>> allow users to do annoying things) or if it will continue to be in the
+>>> future. Hard to predict really, all that can be said with certainty is
+>>> all directives will contine to be inexpensive and safe enough that it's
+>>> sensible to allow users to (ab)use them on open wikis.
+>>> --[[Joey]]
diff --git a/doc/plugins/contrib/comments.mdwn b/doc/plugins/contrib/comments.mdwn
deleted file mode 100644
index d2ca8d17d..000000000
--- a/doc/plugins/contrib/comments.mdwn
+++ /dev/null
@@ -1,91 +0,0 @@
-[[!template id=plugin name=comments author="[[Simon_McVittie|smcv]]"]]
-[[!tag type/useful]]
-
-This plugin adds "blog-style" comments. The intention is that on a non-wiki site
-(like a blog) you can lock all pages for admin-only access, then allow otherwise
-unprivileged (or perhaps even anonymous) users to comment on posts.
-
-When using this plugin, you should also enable [[htmlscrubber]] and either [[htmltidy]]
-or [[htmlbalance]]. Directives are filtered out by default, to avoid commenters slowing
-down the wiki by causing time-consuming processing. As long as the recommended plugins
-are enabled, comment authorship should hopefully be unforgeable by CGI users.
-
-The plugin adds a new [[ikiwiki/PageSpec]] match type, `postcomment`, for use
-with `anonok_pagespec` from the [[plugins/anonok]] plugin or `locked_pages` from
-the [[plugins/lockedit]] plugin. Typical usage would be something like:
-
- locked_pages => "!postcomment(*)"
-
-to allow non-admin users to comment on pages, but not edit anything. You can also do
-
- anonok_pages => "postcomment(*)"
-
-to allow anonymous comments (the IP address will be used as the "author").
-
-There are some global options for the setup file:
-
-* `comments_shown_pagespec`: pages where comments will be displayed inline, e.g. `blog/*`
- or `*/discussion`.
-* `comments_open_pagespec`: pages where new comments can be posted, e.g.
- `blog/* and created_after(close_old_comments)` or `*/discussion`
-* `comments_pagename`: if this is e.g. `comment_` (the default), then comments on the
- [[sandbox]] will be called something like `sandbox/comment_12`
-* `comments_allowdirectives`: if true (default false), comments may contain IkiWiki
- directives
-* `comments_commit`: if true (default true), comments will be committed to the version
- control system
-* `comments_allowauthor`: if true (default false), anonymous commenters may specify a
- name for themselves, and the \[[!meta author]] and \[[!meta authorurl]] directives
- will not be overridden by the comments plugin
-
-Templates that will display comments (by default that means `comments_display.tmpl`)
-can use the following additional ``s:
-
-* `COMMENTUSER`: the authenticated/verified user name, or undefined if the user was not signed in
-* `COMMENTIP`: the remote IP address, or undefined if not known (this is not currently recorded
- for users who are signed in, who are assumed to be vaguely accountable)
-* `COMMENTAUTHOR`: a "prettier" version of the authenticated/verified user name (e.g. OpenIDs are
- formatted the same way as in [[RecentChanges]]), or the result of localizing "Anonymous" if the
- user was not signed in
-* `COMMENTAUTHORURL`: if the user was signed in with an OpenID, that URL; if the user was signed
- in with some other username, a CGI URL that redirects to their user page (if any)
-
-This plugin also adds a `\[[!_comment]]` directive which is used when storing comments. This
-directive is for internal use only and shouldn't be used on pages that are edited in the usual way.
-
-This plugin aims to close the [[todo]] item "[[todo/supporting_comments_via_disussion_pages]]",
-and is currently available from [[smcv]]'s git repository on git.pseudorandom.co.uk (it's the
-`comments-rebase2` branch). A demo wiki with the plugin enabled is running at
-; the
-[sandbox page](http://www.pseudorandom.co.uk/2008/ikiwiki/demo/sandbox/#comments) has some
-examples of comments.
-
-Known issues:
-
-* Needs code review
-* The access control via postcomment() is rather strange (see [[discussion]] for more details)
-* There is some common code cargo-culted from other plugins (notably inline and editpage) which
- should probably be shared
-* Joey doesn't think it should necessarily use internal pages (see [[discussion]])
-* Previews always say "unknown IP address"
-* Add `COMMENTOPENID`: the authenticated/verified user name, if and only if it was an OpenID
-* The default template should have a (?) icon next to unauthenticated users (with the IP address
- as title) and an OpenID icon next to OpenIDs
-
-> I haven't done a detailed code review, but I will say I'm pleased you
-> avoided re-implementing inline! --[[Joey]]
-
-Fixed issues:
-
-* Joey didn't think the `\[[!comments]]` directive was appropriate; comments now appear
- on pages selected with a [[ikiwiki/pagespec]]
-* Joey thought that raw HTML should always be allowed; it now is
-* tbm wanted anonymous people to be able to enter their name and possibly email
- address; a name and website can now be supplied
-* There is now an indication of who you're signed in as
-* Each comment is now one big \[[!_comment]] directive invocation, avoiding previous
- issues with unambiguous and un-spoofable metadata
-* `\[[!comment]]` should be `\[[!_comment]]`, or a special filter/htmlize hook rather
- than being a directive at all
-* [[todo/inline_plugin:_ability_to_override_the_feed_name]]
-* [[todo/inline_plugin:_hide_feed_buttons_if_empty]]
diff --git a/doc/plugins/contrib/comments/discussion.mdwn b/doc/plugins/contrib/comments/discussion.mdwn
deleted file mode 100644
index 59740ec37..000000000
--- a/doc/plugins/contrib/comments/discussion.mdwn
+++ /dev/null
@@ -1,160 +0,0 @@
-## Why internal pages? (unresolved)
-
-Comments are saved as internal pages, so they can never be edited through the CGI,
-only by direct committers.
-
-> So, why do it this way, instead of using regular wiki pages in a
-> namespace, such as `$page/comments/*`? Then you could use [[plugins/lockedit]] to
-> limit editing of comments in more powerful ways. --[[Joey]]
-
->> Er... I suppose so. I'd assumed that these pages ought to only exist as inlines
->> rather than as individual pages (same reasoning as aggregated posts), though.
->>
->> lockedit is actually somewhat insufficient, since `check_canedit()`
->> doesn't distinguish between creation and editing; I'd have to continue to use
->> some sort of odd hack to allow creation but not editing.
->>
->> I also can't think of any circumstance where you'd want a user other than
->> admins (~= git committers) and possibly the commenter (who we can't check for
->> at the moment anyway, I don't think?) to be able to edit comments - I think
->> user expectations for something that looks like ordinary blog comments are
->> likely to include "others can't put words into my mouth".
->>
->> My other objection to using a namespace is that I'm not particularly happy about
->> plugins consuming arbitrary pieces of the wiki namespace - /discussion is bad
->> enough already. Indeed, this very page would accidentally get matched by rules
->> aiming to control comment-posting... :-) --[[smcv]]
-
->>> Thinking about it, perhaps one way to address this would be to have the suffix
->>> (e.g. whether commenting on Sandbox creates sandbox/comment1 or sandbox/c1 or
->>> what) be configurable by the wiki admin, in the same way that recentchanges has
->>> recentchangespage => 'recentchanges'? I'd like to see fewer hard-coded page
->>> names in general, really - it seems odd to me that shortcuts and smileys
->>> hard-code the name of the page to look at. Perhaps I could add
->>> discussionpage => 'discussion' too? --[[smcv]]
-
->>> (I've now implemented this in my branch. --[[smcv]])
-
->> The best reason to keep the pages internal seems to me to be that you
->> don't want the overhead of every comment spawning its own wiki page. --[[Joey]]
-
-## Formats (resolved)
-
-The plugin now allows multiple comment formats while still using internal
-pages; each comment is saved as a page containing one `\[[!comment]]` directive,
-which has a superset of the functionality of [[ikiwiki/directives/format]].
-
-## Access control (unresolved?)
-
-By the way, I think that who can post comments should be controllable by
-the existing plugins opendiscussion, anonok, signinedit, and lockedit. Allowing
-posting comments w/o any login, while a nice capability, can lead to
-spam problems. So, use `check_canedit` as at least a first-level check?
---[[Joey]]
-
-> This plugin already uses `check_canedit`, but that function doesn't have a concept
-> of different actions. The hack I use is that when a user comments on, say, sandbox,
-> I call `check_canedit` for the pseudo-page "sandbox[postcomment]". The
-> special `postcomment(glob)` [[ikiwiki/pagespec]] returns true if the page ends with
-> "[postcomment]" and the part before (e.g. sandbox) matches the glob. So, you can
-> have postcomment(blog/*) or something. (Perhaps instead of taking a glob, postcomment
-> should take a pagespec, so you can have postcomment(link(tags/commentable))?)
->
-> This is why `anonok_pages => 'postcomment(*)'` and `locked_pages => '!postcomment(*)'`
-> are necessary to allow anonymous and logged-in editing (respectively).
->
-> This is ugly - one alternative would be to add `check_permission()` that takes a
-> page and a verb (create, edit, rename, remove and maybe comment are the ones I
-> can think of so far), use that, and port the plugins you mentioned to use that
-> API too. This plugin could either call `check_can("$page/comment1", 'create')` or
-> call `check_can($page, 'comment')`.
->
-> One odd effect of the code structure I've used is that we check for the ability to
-> create the page before we actually know what page name we're going to use - when
-> posting the comment I just increment a number until I reach an unused one - so
-> either the code needs restructuring, or the permission check for 'create' would
-> always be for 'comment1' and never 'comment123'. --[[smcv]]
-
->> Now resolved, in fact --[[smcv]]
-
-> Another possibility is to just check for permission to edit (e.g.) `sandbox/comment1`.
-> However, this makes the "comments can only be created, not edited" feature completely
-> reliant on the fact that internal pages can't be edited. Perhaps there should be a
-> `editable_pages` pagespec, defaulting to `'*'`? --[[smcv]]
-
-## comments directive vs global setting (resolved?)
-
-When comments have been enabled generally, you still need to mark which pages
-can have comments, by including the `\[[!comments]]` directive in them. By default,
-this directive expands to a "post a comment" link plus an `\[[!inline]]` with
-the comments. [This requirement has now been removed --[[smcv]]]
-
-> I don't like this, because it's hard to explain to someone why they have
-> to insert this into every post to their blog. Seems that the model used
-> for discussion pages could work -- if comments are enabled, automatically
-> add the comment posting form and comments to the end of each page.
-> --[[Joey]]
-
->> I don't think I'd want comments on *every* page (particularly, not the
->> front page). Perhaps a pagespec in the setup file, where the default is "*"?
->> Then control freaks like me could use "link(tags/comments)" and tag pages
->> as allowing comments.
->>
->>> Yes, I think a pagespec is the way to go. --[[Joey]]
-
->>>> Implemented --[[smcv]]
-
->>
->> The model used for discussion pages does require patching the existing
->> page template, which I was trying to avoid - I'm not convinced that having
->> every possible feature hard-coded there really scales (and obviously it's
->> rather annoying while this plugin is on a branch). --[[smcv]]
-
->>> Using the template would allow customising the html around the comments
->>> which seems like a good thing? --[[Joey]]
-
->>>> The \[[!comments]] directive is already template-friendly - it expands to
->>>> the contents of the template `comments_embed.tmpl`, possibly with the
->>>> result of an \[[!inline]] appended. I should change `comments_embed.tmpl`
->>>> so it uses a template variable `INLINE` for the inline result rather than
->>>> having the perl code concatenate it, which would allow a bit more
->>>> customization (whether the "post" link was before or after the inline).
->>>> Even if you want comments in page.tmpl, keeping the separate comments_embed.tmpl
->>>> and having a `COMMENTS` variable in page.tmpl might be the way forward,
->>>> since the smaller each templates is, the easier it will be for users
->>>> to maintain a patched set of templates. (I think so, anyway, based on what happens
->>>> with dpkg prompts in Debian packages with monolithic vs split
->>>> conffiles.) --[[smcv]]
-
->>>>> I've switched my branch to use page.tmpl instead; see what you think? --[[smcv]]
-
-## Raw HTML (resolved?)
-
-Raw HTML was not initially allowed by default (this was configurable).
-
-> I'm not sure that raw html should be a problem, as long as the
-> htmlsanitizer and htmlbalanced plugins are enabled. I can see filtering
-> out directives, as a special case. --[[Joey]]
-
->> Right, if I sanitize each post individually, with htmlscrubber and either htmltidy
->> or htmlbalance turned on, then there should be no way the user can forge a comment;
->> I was initially wary of allowing meta directives, but I think those are OK, as long
->> as the comment template puts the \[[!meta author]] at the *end*. Disallowing
->> directives is more a way to avoid commenters causing expensive processing than
->> anything else, at this point.
->>
->> I've rebased the plugin on master, made it sanitize individual posts' content
->> and removed the option to disallow raw HTML. Sanitizing individual posts before
->> they've been htmlized required me to preserve whitespace in the htmlbalance
->> plugin, so I did that. Alternatively, we could htmlize immediately and always
->> save out raw HTML? --[[smcv]]
-
->>> There might be some use cases for other directives, such as img, in
->>> comments.
->>>
->>> I don't know if meta is "safe" (ie, guaranteed to be inexpensive and not
->>> allow users to do annoying things) or if it will continue to be in the
->>> future. Hard to predict really, all that can be said with certainty is
->>> all directives will contine to be inexpensive and safe enough that it's
->>> sensible to allow users to (ab)use them on open wikis.
->>> --[[Joey]]
diff --git a/doc/plugins/lockedit.mdwn b/doc/plugins/lockedit.mdwn
index 71bf232ab..d2e98e07a 100644
--- a/doc/plugins/lockedit.mdwn
+++ b/doc/plugins/lockedit.mdwn
@@ -17,6 +17,10 @@ One handy thing to do if you're using ikiwiki for your blog is to lock
posts in your blog, while still letting them comment via the Discussion
pages.
+Alternatively, if you're using the [[comments]] plugin, you can lock
+"!postcomment(*)" to allow users to comment on pages, but not edit anything
+else.
+
Wiki administrators can always edit locked pages. The [[ikiwiki/PageSpec]]
can specify that some pages are not locked for some users. For example,
"important_page and !user(joey)" locks `important_page` while still
diff --git a/doc/wikitemplates.mdwn b/doc/wikitemplates.mdwn
index babd70211..6fb4d5f49 100644
--- a/doc/wikitemplates.mdwn
+++ b/doc/wikitemplates.mdwn
@@ -29,6 +29,10 @@ located in /usr/share/ikiwiki/templates by default.
form to wiki pages.
* `searchquery.tmpl` - This is an omega template, used by the
[[plugins/search]] plugin.
+* `comments_display.tmpl` - This template is used to display a comment
+ by the [[plugins/comments]] plugin.
+* `comments_form.tmpl` - This template is the comment post form for the
+ [[plugins/comments]] plugin.
The [[plugins/pagetemplate]] plugin can allow individual pages to use a
different template than `page.tmpl`.
--
cgit v1.2.3
From e9797ee0863855da93c7a98612c984fecc8d1e23 Mon Sep 17 00:00:00 2001
From: Joey Hess
Date: Fri, 12 Dec 2008 15:02:40 -0500
Subject: improve documentation of postcomment
---
doc/ikiwiki/pagespec.mdwn | 4 ++--
doc/plugins/comments.mdwn | 3 +--
2 files changed, 3 insertions(+), 4 deletions(-)
(limited to 'doc/plugins')
diff --git a/doc/ikiwiki/pagespec.mdwn b/doc/ikiwiki/pagespec.mdwn
index 90b96c936..d4dd265cc 100644
--- a/doc/ikiwiki/pagespec.mdwn
+++ b/doc/ikiwiki/pagespec.mdwn
@@ -47,8 +47,8 @@ Some more elaborate limits can be added to what matches using these functions:
wiki admins.
* "`ip(address)`" - tests whether a modification is being made from the
specified IP address.
-* "`postcomment(glob)`" - matches internal-use pages created by the
- comments plugin as comments for pages that match the specified glob.
+* "`postcomment(glob)`" - matches only when comments are being
+ posted to a page matching the specified glob
For example, to match all pages in a blog that link to the page about music
and were written in 2005:
diff --git a/doc/plugins/comments.mdwn b/doc/plugins/comments.mdwn
index 347d7fc8d..fa263ef40 100644
--- a/doc/plugins/comments.mdwn
+++ b/doc/plugins/comments.mdwn
@@ -19,8 +19,7 @@ users can only post comments.
Individual comments are stored as internal-use pages named something like
`page/comment_1`, `page/comment_2`, etc. These pages internally use a
-`\[[!_comment]]` [[ikiwiki/directive]], and comment pages can be matched
-using a special `postcomment()` [[ikiwiki/PageSpec]].
+`\[[!_comment]]` [[ikiwiki/directive]].
There are some global options for the setup file:
--
cgit v1.2.3
From fdd994fb7365308bde162b72b280512f2db6a339 Mon Sep 17 00:00:00 2001
From: Joey Hess
Date: Wed, 17 Dec 2008 14:15:52 -0500
Subject: more comments doc updates
Moved todo items to a todo page, mark the old todo item about comments as
done, etc.
---
doc/plugins/comments.mdwn | 12 ------------
doc/plugins/comments/discussion.mdwn | 3 +++
doc/todo/comments.mdwn | 8 ++++++++
doc/todo/supporting_comments_via_disussion_pages.mdwn | 3 +++
4 files changed, 14 insertions(+), 12 deletions(-)
create mode 100644 doc/todo/comments.mdwn
(limited to 'doc/plugins')
diff --git a/doc/plugins/comments.mdwn b/doc/plugins/comments.mdwn
index fa263ef40..aab75e9b7 100644
--- a/doc/plugins/comments.mdwn
+++ b/doc/plugins/comments.mdwn
@@ -37,15 +37,3 @@ There are some global options for the setup file:
specify a name for themselves, and the \[[!meta author]] and
\[[!meta authorurl]] directives will not be overridden by the comments
plugin
-
-Known issues:
-
-* Needs code review
-* The access control via postcomment() is rather strange (see [[discussion]] for more details)
-* There is some common code cargo-culted from other plugins (notably inline and editpage) which
- should probably be shared
-* Joey doesn't think it should necessarily use internal pages (see [[discussion]])
-* Previews always say "unknown IP address"
-* Add `COMMENTOPENID`: the authenticated/verified user name, if and only if it was an OpenID
-* The default template should have a (?) icon next to unauthenticated users (with the IP address
- as title) and an OpenID icon next to OpenIDs
diff --git a/doc/plugins/comments/discussion.mdwn b/doc/plugins/comments/discussion.mdwn
index 59740ec37..2a87a3d93 100644
--- a/doc/plugins/comments/discussion.mdwn
+++ b/doc/plugins/comments/discussion.mdwn
@@ -63,6 +63,9 @@ spam problems. So, use `check_canedit` as at least a first-level check?
> This is why `anonok_pages => 'postcomment(*)'` and `locked_pages => '!postcomment(*)'`
> are necessary to allow anonymous and logged-in editing (respectively).
>
+>> I changed that to move the flag out of the page name, and into a variable that the `match_postcomment`
+>> function checks for. Other ugliness still applies. :-) --[[Joey]]
+>
> This is ugly - one alternative would be to add `check_permission()` that takes a
> page and a verb (create, edit, rename, remove and maybe comment are the ones I
> can think of so far), use that, and port the plugins you mentioned to use that
diff --git a/doc/todo/comments.mdwn b/doc/todo/comments.mdwn
new file mode 100644
index 000000000..adc302a25
--- /dev/null
+++ b/doc/todo/comments.mdwn
@@ -0,0 +1,8 @@
+Known issues with the [[plugins/comments]] plugin:
+
+* There is some common code cargo-culted from other plugins (notably inline and editpage) which
+ should probably be shared
+* Previews always say "unknown IP address"
+* Add `COMMENTOPENID`: the authenticated/verified user name, if and only if it was an OpenID
+* The default template should have a (?) icon next to unauthenticated users (with the IP address
+ as title) and an OpenID icon next to OpenIDs
diff --git a/doc/todo/supporting_comments_via_disussion_pages.mdwn b/doc/todo/supporting_comments_via_disussion_pages.mdwn
index bc4e331d0..892db18a9 100644
--- a/doc/todo/supporting_comments_via_disussion_pages.mdwn
+++ b/doc/todo/supporting_comments_via_disussion_pages.mdwn
@@ -215,3 +215,6 @@ do you think so far? Known issues include:
--[[smcv]]
I've updated smcvpostcomment and publicised it as [[plugins/contrib/comments]]. --[[smcv]]
+
+> While there is still room for improvement and entirely other approaches,
+> I am calling this done since smcv's comments plugin is ready. --[[Joey]]
--
cgit v1.2.3
From bb93fccf0690344aa77f9538a508959a6de09847 Mon Sep 17 00:00:00 2001
From: Joey Hess
Date: Wed, 17 Dec 2008 15:22:16 -0500
Subject: Coding style change: Remove explcit vim folding markers.
---
IkiWiki.pm | 388 ++++++++++-----------
IkiWiki/CGI.pm | 60 ++--
IkiWiki/Plugin/aggregate.pm | 108 +++---
IkiWiki/Plugin/amazon_s3.pm | 32 +-
IkiWiki/Plugin/anonok.pm | 12 +-
IkiWiki/Plugin/attachment.pm | 32 +-
IkiWiki/Plugin/autoindex.pm | 16 +-
IkiWiki/Plugin/brokenlinks.pm | 12 +-
IkiWiki/Plugin/bzr.pm | 54 +--
IkiWiki/Plugin/calendar.pm | 30 +-
IkiWiki/Plugin/camelcase.pm | 14 +-
IkiWiki/Plugin/color.pm | 20 +-
IkiWiki/Plugin/comments.pm | 38 +-
IkiWiki/Plugin/conditional.pm | 28 +-
IkiWiki/Plugin/creole.pm | 12 +-
IkiWiki/Plugin/cutpaste.pm | 20 +-
IkiWiki/Plugin/ddate.pm | 12 +-
IkiWiki/Plugin/editdiff.pm | 16 +-
IkiWiki/Plugin/editpage.pm | 16 +-
IkiWiki/Plugin/edittemplate.pm | 24 +-
IkiWiki/Plugin/embed.pm | 20 +-
IkiWiki/Plugin/external.pm | 48 +--
IkiWiki/Plugin/favicon.pm | 12 +-
IkiWiki/Plugin/filecheck.pm | 30 +-
IkiWiki/Plugin/format.pm | 8 +-
IkiWiki/Plugin/fortune.pm | 12 +-
IkiWiki/Plugin/git.pm | 72 ++--
IkiWiki/Plugin/goodstuff.pm | 8 +-
IkiWiki/Plugin/google.pm | 16 +-
IkiWiki/Plugin/googlecalendar.pm | 20 +-
IkiWiki/Plugin/graphviz.pm | 16 +-
IkiWiki/Plugin/haiku.pm | 12 +-
IkiWiki/Plugin/hnb.pm | 12 +-
IkiWiki/Plugin/html.pm | 12 +-
IkiWiki/Plugin/htmlbalance.pm | 12 +-
IkiWiki/Plugin/htmlscrubber.pm | 16 +-
IkiWiki/Plugin/htmltidy.pm | 12 +-
IkiWiki/Plugin/httpauth.pm | 12 +-
IkiWiki/Plugin/img.pm | 12 +-
IkiWiki/Plugin/inline.pm | 54 +--
IkiWiki/Plugin/link.pm | 24 +-
IkiWiki/Plugin/linkmap.pm | 20 +-
IkiWiki/Plugin/listdirectives.pm | 20 +-
IkiWiki/Plugin/lockedit.pm | 16 +-
IkiWiki/Plugin/map.pm | 12 +-
IkiWiki/Plugin/mdwn.pm | 12 +-
IkiWiki/Plugin/mercurial.pm | 52 +--
IkiWiki/Plugin/meta.pm | 52 +--
IkiWiki/Plugin/mirrorlist.pm | 16 +-
IkiWiki/Plugin/monotone.pm | 72 ++--
IkiWiki/Plugin/more.pm | 10 +-
IkiWiki/Plugin/norcs.pm | 48 +--
IkiWiki/Plugin/opendiscussion.pm | 12 +-
IkiWiki/Plugin/openid.pm | 28 +-
IkiWiki/Plugin/orphans.pm | 12 +-
IkiWiki/Plugin/otl.pm | 16 +-
IkiWiki/Plugin/pagecount.pm | 12 +-
IkiWiki/Plugin/pagestats.pm | 12 +-
IkiWiki/Plugin/pagetemplate.pm | 16 +-
IkiWiki/Plugin/parentlinks.pm | 16 +-
IkiWiki/Plugin/passwordauth.pm | 26 +-
IkiWiki/Plugin/pingee.pm | 12 +-
IkiWiki/Plugin/pinger.pm | 16 +-
IkiWiki/Plugin/poll.pm | 16 +-
IkiWiki/Plugin/polygen.pm | 12 +-
IkiWiki/Plugin/postsparkline.pm | 12 +-
IkiWiki/Plugin/prettydate.pm | 16 +-
IkiWiki/Plugin/progress.pm | 16 +-
IkiWiki/Plugin/rawhtml.pm | 8 +-
IkiWiki/Plugin/recentchanges.pm | 30 +-
IkiWiki/Plugin/recentchangesdiff.pm | 12 +-
IkiWiki/Plugin/relativedate.pm | 20 +-
IkiWiki/Plugin/remove.pm | 34 +-
IkiWiki/Plugin/rename.pm | 48 +--
IkiWiki/Plugin/search.pm | 40 +--
IkiWiki/Plugin/shortcut.pm | 20 +-
IkiWiki/Plugin/sidebar.pm | 16 +-
IkiWiki/Plugin/signinedit.pm | 12 +-
IkiWiki/Plugin/skeleton.pm.example | 102 +++---
IkiWiki/Plugin/smiley.pm | 16 +-
IkiWiki/Plugin/sparkline.pm | 12 +-
IkiWiki/Plugin/svn.pm | 54 +--
IkiWiki/Plugin/table.pm | 26 +-
IkiWiki/Plugin/tag.pm | 32 +-
IkiWiki/Plugin/template.pm | 12 +-
IkiWiki/Plugin/testpagespec.pm | 12 +-
IkiWiki/Plugin/teximg.pm | 32 +-
IkiWiki/Plugin/textile.pm | 12 +-
IkiWiki/Plugin/tla.pm | 46 +--
IkiWiki/Plugin/toc.pm | 14 +-
IkiWiki/Plugin/toggle.pm | 28 +-
IkiWiki/Plugin/txt.pm | 4 +-
IkiWiki/Plugin/typography.pm | 16 +-
IkiWiki/Plugin/version.pm | 16 +-
IkiWiki/Plugin/websetup.pm | 36 +-
IkiWiki/Plugin/wikitext.pm | 12 +-
IkiWiki/Receive.pm | 16 +-
IkiWiki/Render.pm | 34 +-
IkiWiki/Setup.pm | 12 +-
IkiWiki/Setup/Automator.pm | 12 +-
IkiWiki/Setup/Standard.pm | 16 +-
IkiWiki/UserInfo.pm | 32 +-
IkiWiki/Wrapper.pm | 4 +-
debian/changelog | 1 +
.../Allow_overriding_of_symlink_restriction.mdwn | 6 +-
doc/bugs/Can__39__t_create_root_page.mdwn | 4 +-
...dency_in_eval_while_running_with_-T_switch.mdwn | 4 +-
doc/bugs/Monotone_rcs_support.mdwn | 2 +-
..._blog_items_when_filename_contains_a_colon.mdwn | 8 +-
doc/bugs/Problem_with_toc.pm_plug-in.mdwn | 4 +-
doc/bugs/Problems_with_graphviz.pm_plug-in.mdwn | 14 +-
.../RecentChanges_broken_with_empty_svnpath.mdwn | 2 +-
...itles_are_lower-cased_when_creating_a_page.mdwn | 2 +-
...n_and_a_directive_does_not_contain_a_space.mdwn | 4 +-
...celed:_Broken_pipe__34_____40__patch__41__.mdwn | 2 +-
doc/bugs/git_stderr_output_causes_problems.mdwn | 2 +-
...plugin_should_pass_through_class_attribute.mdwn | 4 +-
doc/bugs/inline_sort-by-title_issues.mdwn | 2 +-
doc/bugs/mercurial_fail_to_add.mdwn | 2 +-
doc/bugs/methodResponse_in_add__95__plugins.mdwn | 2 +-
doc/bugs/multiple_pages_with_same_name.mdwn | 6 +-
...pec_parsing_chokes_on_function__40____41__.mdwn | 2 +-
doc/bugs/prune_causing_taint_mode_failures.mdwn | 4 +-
doc/bugs/quieten_mercurial.mdwn | 4 +-
..._for_locale_data_in_the_installed_location.mdwn | 2 +-
doc/bugs/tbasewiki__95__brokenlinks.t_broken.mdwn | 6 +-
doc/plugins/contrib/headinganchors.mdwn | 8 +-
doc/plugins/contrib/siterel2pagerel.mdwn | 8 +-
doc/plugins/contrib/unixauth.mdwn | 24 +-
.../Add_DATE_parameter_for_use_in_templates.mdwn | 14 +-
...for_latest_Text::Markdown_as_found_on_CPAN.mdwn | 2 +-
doc/todo/Allow_change_of_wiki_file_types.mdwn | 8 +-
doc/todo/Allow_edittemplate_to_set_file_type.mdwn | 8 +-
.../Bestdir_along_with_bestlink_in_IkiWiki.pm.mdwn | 8 +-
doc/todo/Default_text_for_new_pages.mdwn | 8 +-
..._templates_inserted_by_the_template_plugin.mdwn | 2 +-
...nline_plugin_option_to_show_full_page_path.mdwn | 2 +-
.../Move_teximg_latex_preamble_to_config_file.mdwn | 10 +-
...bitrary_date_to_be_used_by_calendar_plugin.mdwn | 12 +-
doc/todo/Silence_monotone_warning.mdwn | 2 +-
...side_of_link__40____41___within_a_pagespec.mdwn | 4 +-
doc/todo/Wrapper_config_with_multiline_regexp.mdwn | 4 +-
.../add_forward_age_sorting_option_to_inline.mdwn | 2 +-
.../discussion.mdwn | 20 +-
doc/todo/blogpost_plugin.mdwn | 20 +-
doc/todo/bzr.mdwn | 28 +-
doc/todo/cas_authentication.mdwn | 14 +-
doc/todo/color_plugin.mdwn | 20 +-
doc/todo/darcs.mdwn | 26 +-
doc/todo/datearchives-plugin.mdwn | 8 +-
doc/todo/different_search_engine.mdwn | 40 +--
doc/todo/directive_docs.mdwn | 12 +-
doc/todo/enable-htaccess-files.mdwn | 2 +-
doc/todo/format_escape.mdwn | 16 +-
.../fortune:_select_options_via_environment.mdwn | 4 +-
doc/todo/index.html_allowed.mdwn | 10 +-
doc/todo/inline:_numerical_ordering_by_title.mdwn | 22 +-
.../language_definition_for_the_meta_plugin.mdwn | 4 +-
doc/todo/meta_rcsid.mdwn | 2 +-
doc/todo/missingparents.pm.mdwn | 44 +--
doc/todo/modify_page_filename_in_plugin.mdwn | 6 +-
doc/todo/pagespec_relative_to_a_target.mdwn | 16 +-
doc/todo/provide_sha1_for_git_diffurl.mdwn | 2 +-
doc/todo/require_CAPTCHA_to_edit.mdwn | 22 +-
doc/todo/source_link.mdwn | 14 +-
doc/todo/structured_page_data.mdwn | 50 +--
.../supporting_comments_via_disussion_pages.mdwn | 12 +-
doc/todo/syntax_highlighting.mdwn | 4 +-
doc/todo/tidy_git__39__s_ctime_debug_output.mdwn | 2 +-
doc/todo/tmplvars_plugin.mdwn | 12 +-
doc/todo/tracking_bugs_with_dependencies.mdwn | 58 +--
...turn_edittemplate_verbosity_off_by_default.mdwn | 6 +-
doc/todo/using_meta_titles_for_parentlinks.html | 8 +-
...closures_for_values__41___in_ikiwiki.setup.mdwn | 8 +-
ikiwiki.in | 12 +-
175 files changed, 1776 insertions(+), 1775 deletions(-)
(limited to 'doc/plugins')
diff --git a/IkiWiki.pm b/IkiWiki.pm
index 1c68c2cb3..d93ff7374 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -34,7 +34,7 @@ memoize("abs2rel");
memoize("pagespec_translate");
memoize("file_pruned");
-sub getsetup () { #{{{
+sub getsetup () {
wikiname => {
type => "string",
default => "wiki",
@@ -431,9 +431,9 @@ sub getsetup () { #{{{
safe => 0,
rebuild => 0,
},
-} #}}}
+}
-sub defaultconfig () { #{{{
+sub defaultconfig () {
my %s=getsetup();
my @ret;
foreach my $key (keys %s) {
@@ -441,9 +441,9 @@ sub defaultconfig () { #{{{
}
use Data::Dumper;
return @ret;
-} #}}}
+}
-sub checkconfig () { #{{{
+sub checkconfig () {
# locale stuff; avoid LC_ALL since it overrides everything
if (defined $ENV{LC_ALL}) {
$ENV{LANG} = $ENV{LC_ALL};
@@ -490,9 +490,9 @@ sub checkconfig () { #{{{
run_hooks(checkconfig => sub { shift->() });
return 1;
-} #}}}
+}
-sub listplugins () { #{{{
+sub listplugins () {
my %ret;
foreach my $dir (@INC, $config{libdir}) {
@@ -510,9 +510,9 @@ sub listplugins () { #{{{
}
return keys %ret;
-} #}}}
+}
-sub loadplugins () { #{{{
+sub loadplugins () {
if (defined $config{libdir} && length $config{libdir}) {
unshift @INC, possibly_foolish_untaint($config{libdir});
}
@@ -539,9 +539,9 @@ sub loadplugins () { #{{{
}
return 1;
-} #}}}
+}
-sub loadplugin ($) { #{{{
+sub loadplugin ($) {
my $plugin=shift;
return if grep { $_ eq $plugin} @{$config{disable_plugins}};
@@ -567,9 +567,9 @@ sub loadplugin ($) { #{{{
}
$loaded_plugins{$plugin}=1;
return 1;
-} #}}}
+}
-sub error ($;$) { #{{{
+sub error ($;$) {
my $message=shift;
my $cleaner=shift;
log_message('err' => $message) if $config{syslog};
@@ -577,15 +577,15 @@ sub error ($;$) { #{{{
$cleaner->();
}
die $message."\n";
-} #}}}
+}
-sub debug ($) { #{{{
+sub debug ($) {
return unless $config{verbose};
return log_message(debug => @_);
-} #}}}
+}
my $log_open=0;
-sub log_message ($$) { #{{{
+sub log_message ($$) {
my $type=shift;
if ($config{syslog}) {
@@ -605,44 +605,44 @@ sub log_message ($$) { #{{{
else {
return print STDERR "@_\n";
}
-} #}}}
+}
-sub possibly_foolish_untaint ($) { #{{{
+sub possibly_foolish_untaint ($) {
my $tainted=shift;
my ($untainted)=$tainted=~/(.*)/s;
return $untainted;
-} #}}}
+}
-sub basename ($) { #{{{
+sub basename ($) {
my $file=shift;
$file=~s!.*/+!!;
return $file;
-} #}}}
+}
-sub dirname ($) { #{{{
+sub dirname ($) {
my $file=shift;
$file=~s!/*[^/]+$!!;
return $file;
-} #}}}
+}
-sub pagetype ($) { #{{{
+sub pagetype ($) {
my $page=shift;
if ($page =~ /\.([^.]+)$/) {
return $1 if exists $hooks{htmlize}{$1};
}
return;
-} #}}}
+}
-sub isinternal ($) { #{{{
+sub isinternal ($) {
my $page=shift;
return exists $pagesources{$page} &&
$pagesources{$page} =~ /\._([^.]+)$/;
-} #}}}
+}
-sub pagename ($) { #{{{
+sub pagename ($) {
my $file=shift;
my $type=pagetype($file);
@@ -652,9 +652,9 @@ sub pagename ($) { #{{{
$page=$1;
}
return $page;
-} #}}}
+}
-sub newpagefile ($$) { #{{{
+sub newpagefile ($$) {
my $page=shift;
my $type=shift;
@@ -664,9 +664,9 @@ sub newpagefile ($$) { #{{{
else {
return $page."/index.".$type;
}
-} #}}}
+}
-sub targetpage ($$;$) { #{{{
+sub targetpage ($$;$) {
my $page=shift;
my $ext=shift;
my $filename=shift;
@@ -680,15 +680,15 @@ sub targetpage ($$;$) { #{{{
else {
return $page."/index.".$ext;
}
-} #}}}
+}
-sub htmlpage ($) { #{{{
+sub htmlpage ($) {
my $page=shift;
return targetpage($page, $config{htmlext});
-} #}}}
+}
-sub srcfile_stat { #{{{
+sub srcfile_stat {
my $file=shift;
my $nothrow=shift;
@@ -698,13 +698,13 @@ sub srcfile_stat { #{{{
}
error("internal error: $file cannot be found in $config{srcdir} or underlay") unless $nothrow;
return;
-} #}}}
+}
-sub srcfile ($;$) { #{{{
+sub srcfile ($;$) {
return (srcfile_stat(@_))[0];
-} #}}}
+}
-sub add_underlay ($) { #{{{
+sub add_underlay ($) {
my $dir=shift;
if ($dir !~ /^\//) {
@@ -716,9 +716,9 @@ sub add_underlay ($) { #{{{
}
return 1;
-} #}}}
+}
-sub readfile ($;$$) { #{{{
+sub readfile ($;$$) {
my $file=shift;
my $binary=shift;
my $wantfd=shift;
@@ -738,9 +738,9 @@ sub readfile ($;$$) { #{{{
}
close $in || error("failed to read $file: $!");
return $ret;
-} #}}}
+}
-sub prep_writefile ($$) { #{{{
+sub prep_writefile ($$) {
my $file=shift;
my $destdir=shift;
@@ -764,9 +764,9 @@ sub prep_writefile ($$) { #{{{
}
return 1;
-} #}}}
+}
-sub writefile ($$$;$$) { #{{{
+sub writefile ($$$;$$) {
my $file=shift; # can include subdirs
my $destdir=shift; # directory to put file in
my $content=shift;
@@ -794,10 +794,10 @@ sub writefile ($$$;$$) { #{{{
error("failed renaming $newfile to $destdir/$file: $!", $cleanup);
return 1;
-} #}}}
+}
my %cleared;
-sub will_render ($$;$) { #{{{
+sub will_render ($$;$) {
my $page=shift;
my $dest=shift;
my $clear=shift;
@@ -821,9 +821,9 @@ sub will_render ($$;$) { #{{{
$destsources{$dest}=$page;
return 1;
-} #}}}
+}
-sub bestlink ($$) { #{{{
+sub bestlink ($$) {
my $page=shift;
my $link=shift;
@@ -859,15 +859,15 @@ sub bestlink ($$) { #{{{
#print STDERR "warning: page $page, broken link: $link\n";
return "";
-} #}}}
+}
-sub isinlinableimage ($) { #{{{
+sub isinlinableimage ($) {
my $file=shift;
return $file =~ /\.(png|gif|jpg|jpeg)$/i;
-} #}}}
+}
-sub pagetitle ($;$) { #{{{
+sub pagetitle ($;$) {
my $page=shift;
my $unescaped=shift;
@@ -879,31 +879,31 @@ sub pagetitle ($;$) { #{{{
}
return $page;
-} #}}}
+}
-sub titlepage ($) { #{{{
+sub titlepage ($) {
my $title=shift;
# support use w/o %config set
my $chars = defined $config{wiki_file_chars} ? $config{wiki_file_chars} : "-[:alnum:]+/.:_";
$title=~s/([^$chars]|_)/$1 eq ' ' ? '_' : "__".ord($1)."__"/eg;
return $title;
-} #}}}
+}
-sub linkpage ($) { #{{{
+sub linkpage ($) {
my $link=shift;
my $chars = defined $config{wiki_file_chars} ? $config{wiki_file_chars} : "-[:alnum:]+/.:_";
$link=~s/([^$chars])/$1 eq ' ' ? '_' : "__".ord($1)."__"/eg;
return $link;
-} #}}}
+}
-sub cgiurl (@) { #{{{
+sub cgiurl (@) {
my %params=@_;
return $config{cgiurl}."?".
join("&", map $_."=".uri_escape_utf8($params{$_}), keys %params);
-} #}}}
+}
-sub baseurl (;$) { #{{{
+sub baseurl (;$) {
my $page=shift;
return "$config{url}/" if ! defined $page;
@@ -912,9 +912,9 @@ sub baseurl (;$) { #{{{
$page=~s/[^\/]+$//;
$page=~s/[^\/]+\//..\//g;
return $page;
-} #}}}
+}
-sub abs2rel ($$) { #{{{
+sub abs2rel ($$) {
# Work around very innefficient behavior in File::Spec if abs2rel
# is passed two relative paths. It's much faster if paths are
# absolute! (Debian bug #376658; fixed in debian unstable now)
@@ -925,15 +925,15 @@ sub abs2rel ($$) { #{{{
my $ret=File::Spec->abs2rel($path, $base);
$ret=~s/^// if defined $ret;
return $ret;
-} #}}}
+}
-sub displaytime ($;$) { #{{{
+sub displaytime ($;$) {
# Plugins can override this function to mark up the time to
# display.
return ''.formattime(@_).'';
-} #}}}
+}
-sub formattime ($;$) { #{{{
+sub formattime ($;$) {
# Plugins can override this function to format the time.
my $time=shift;
my $format=shift;
@@ -944,9 +944,9 @@ sub formattime ($;$) { #{{{
# strftime doesn't know about encodings, so make sure
# its output is properly treated as utf8
return decode_utf8(POSIX::strftime($format, localtime($time)));
-} #}}}
+}
-sub beautify_urlpath ($) { #{{{
+sub beautify_urlpath ($) {
my $url=shift;
if ($config{usedirs}) {
@@ -960,9 +960,9 @@ sub beautify_urlpath ($) { #{{{
}
return $url;
-} #}}}
+}
-sub urlto ($$;$) { #{{{
+sub urlto ($$;$) {
my $to=shift;
my $from=shift;
my $absolute=shift;
@@ -982,9 +982,9 @@ sub urlto ($$;$) { #{{{
my $link = abs2rel($to, dirname(htmlpage($from)));
return beautify_urlpath($link);
-} #}}}
+}
-sub htmllink ($$$;@) { #{{{
+sub htmllink ($$$;@) {
my $lpage=shift; # the page doing the linking
my $page=shift; # the page that will contain the link (different for inline)
my $link=shift;
@@ -1047,9 +1047,9 @@ sub htmllink ($$$;@) { #{{{
}
return "$linktext";
-} #}}}
+}
-sub userlink ($) { #{{{
+sub userlink ($) {
my $user=shift;
my $oiduser=eval { openiduser($user) };
@@ -1064,9 +1064,9 @@ sub userlink ($) { #{{{
length $config{userdir} ? $config{userdir}."/".$user : $user
), noimageinline => 1);
}
-} #}}}
+}
-sub htmlize ($$$$) { #{{{
+sub htmlize ($$$$) {
my $page=shift;
my $destpage=shift;
my $type=shift;
@@ -1101,9 +1101,9 @@ sub htmlize ($$$$) { #{{{
}
return $content;
-} #}}}
+}
-sub linkify ($$$) { #{{{
+sub linkify ($$$) {
my $page=shift;
my $destpage=shift;
my $content=shift;
@@ -1117,11 +1117,11 @@ sub linkify ($$$) { #{{{
});
return $content;
-} #}}}
+}
our %preprocessing;
our $preprocess_preview=0;
-sub preprocess ($$$;$$) { #{{{
+sub preprocess ($$$;$$) {
my $page=shift; # the page the data comes from
my $destpage=shift; # the page the data will appear in (different for inline)
my $content=shift;
@@ -1274,9 +1274,9 @@ sub preprocess ($$$;$$) { #{{{
$content =~ s{$regex}{$handle->($1, $2, $3, $4)}eg;
return $content;
-} #}}}
+}
-sub filter ($$$) { #{{{
+sub filter ($$$) {
my $page=shift;
my $destpage=shift;
my $content=shift;
@@ -1287,15 +1287,15 @@ sub filter ($$$) { #{{{
});
return $content;
-} #}}}
+}
-sub indexlink () { #{{{
+sub indexlink () {
return "$config{wikiname}";
-} #}}}
+}
my $wikilock;
-sub lockwiki () { #{{{
+sub lockwiki () {
# Take an exclusive lock on the wiki to prevent multiple concurrent
# run issues. The lock will be dropped on program exit.
if (! -d $config{wikistatedir}) {
@@ -1307,17 +1307,17 @@ sub lockwiki () { #{{{
error("failed to get lock");
}
return 1;
-} #}}}
+}
-sub unlockwiki () { #{{{
+sub unlockwiki () {
POSIX::close($ENV{IKIWIKI_CGILOCK_FD}) if exists $ENV{IKIWIKI_CGILOCK_FD};
return close($wikilock) if $wikilock;
return;
-} #}}}
+}
my $commitlock;
-sub commit_hook_enabled () { #{{{
+sub commit_hook_enabled () {
open($commitlock, '+>', "$config{wikistatedir}/commitlock") ||
error("cannot write to $config{wikistatedir}/commitlock: $!");
if (! flock($commitlock, 1 | 4)) { # LOCK_SH | LOCK_NB to test
@@ -1326,23 +1326,23 @@ sub commit_hook_enabled () { #{{{
}
close($commitlock) || error("failed closing commitlock: $!");
return 1;
-} #}}}
+}
-sub disable_commit_hook () { #{{{
+sub disable_commit_hook () {
open($commitlock, '>', "$config{wikistatedir}/commitlock") ||
error("cannot write to $config{wikistatedir}/commitlock: $!");
if (! flock($commitlock, 2)) { # LOCK_EX
error("failed to get commit lock");
}
return 1;
-} #}}}
+}
-sub enable_commit_hook () { #{{{
+sub enable_commit_hook () {
return close($commitlock) if $commitlock;
return;
-} #}}}
+}
-sub loadindex () { #{{{
+sub loadindex () {
%oldrenderedfiles=%pagectime=();
if (! $config{rebuild}) {
%pagesources=%pagemtime=%oldlinks=%links=%depends=
@@ -1402,9 +1402,9 @@ sub loadindex () { #{{{
$destsources{$_}=$page foreach @{$renderedfiles{$page}};
}
return close($in);
-} #}}}
+}
-sub saveindex () { #{{{
+sub saveindex () {
run_hooks(savestate => sub { shift->() });
my %hookids;
@@ -1460,18 +1460,18 @@ sub saveindex () { #{{{
error("failed renaming $newfile to $config{wikistatedir}/indexdb", $cleanup);
return 1;
-} #}}}
+}
-sub template_file ($) { #{{{
+sub template_file ($) {
my $template=shift;
foreach my $dir ($config{templatedir}, "$installdir/share/ikiwiki/templates") {
return "$dir/$template" if -e "$dir/$template";
}
return;
-} #}}}
+}
-sub template_params (@) { #{{{
+sub template_params (@) {
my $filename=template_file(shift);
if (! defined $filename) {
@@ -1490,14 +1490,14 @@ sub template_params (@) { #{{{
@_
);
return wantarray ? @ret : {@ret};
-} #}}}
+}
-sub template ($;@) { #{{{
+sub template ($;@) {
require HTML::Template;
return HTML::Template->new(template_params(@_));
-} #}}}
+}
-sub misctemplate ($$;@) { #{{{
+sub misctemplate ($$;@) {
my $title=shift;
my $pagebody=shift;
@@ -1514,9 +1514,9 @@ sub misctemplate ($$;@) { #{{{
shift->(page => "", destpage => "", template => $template);
});
return $template->output;
-}#}}}
+}
-sub hook (@) { # {{{
+sub hook (@) {
my %param=@_;
if (! exists $param{type} || ! ref $param{call} || ! exists $param{id}) {
@@ -1527,9 +1527,9 @@ sub hook (@) { # {{{
$hooks{$param{type}}{$param{id}}=\%param;
return 1;
-} # }}}
+}
-sub run_hooks ($$) { # {{{
+sub run_hooks ($$) {
# Calls the given sub for each hook of the given type,
# passing it the hook function to call.
my $type=shift;
@@ -1550,53 +1550,53 @@ sub run_hooks ($$) { # {{{
}
return 1;
-} #}}}
+}
-sub rcs_update () { #{{{
+sub rcs_update () {
$hooks{rcs}{rcs_update}{call}->(@_);
-} #}}}
+}
-sub rcs_prepedit ($) { #{{{
+sub rcs_prepedit ($) {
$hooks{rcs}{rcs_prepedit}{call}->(@_);
-} #}}}
+}
-sub rcs_commit ($$$;$$) { #{{{
+sub rcs_commit ($$$;$$) {
$hooks{rcs}{rcs_commit}{call}->(@_);
-} #}}}
+}
-sub rcs_commit_staged ($$$) { #{{{
+sub rcs_commit_staged ($$$) {
$hooks{rcs}{rcs_commit_staged}{call}->(@_);
-} #}}}
+}
-sub rcs_add ($) { #{{{
+sub rcs_add ($) {
$hooks{rcs}{rcs_add}{call}->(@_);
-} #}}}
+}
-sub rcs_remove ($) { #{{{
+sub rcs_remove ($) {
$hooks{rcs}{rcs_remove}{call}->(@_);
-} #}}}
+}
-sub rcs_rename ($$) { #{{{
+sub rcs_rename ($$) {
$hooks{rcs}{rcs_rename}{call}->(@_);
-} #}}}
+}
-sub rcs_recentchanges ($) { #{{{
+sub rcs_recentchanges ($) {
$hooks{rcs}{rcs_recentchanges}{call}->(@_);
-} #}}}
+}
-sub rcs_diff ($) { #{{{
+sub rcs_diff ($) {
$hooks{rcs}{rcs_diff}{call}->(@_);
-} #}}}
+}
-sub rcs_getctime ($) { #{{{
+sub rcs_getctime ($) {
$hooks{rcs}{rcs_getctime}{call}->(@_);
-} #}}}
+}
-sub rcs_receive () { #{{{
+sub rcs_receive () {
$hooks{rcs}{rcs_receive}{call}->();
-} #}}}
+}
-sub globlist_to_pagespec ($) { #{{{
+sub globlist_to_pagespec ($) {
my @globlist=split(' ', shift);
my (@spec, @skip);
@@ -1620,20 +1620,20 @@ sub globlist_to_pagespec ($) { #{{{
}
}
return $spec;
-} #}}}
+}
-sub is_globlist ($) { #{{{
+sub is_globlist ($) {
my $s=shift;
return ( $s =~ /[^\s]+\s+([^\s]+)/ && $1 ne "and" && $1 ne "or" );
-} #}}}
+}
-sub safequote ($) { #{{{
+sub safequote ($) {
my $s=shift;
$s=~s/[{}]//g;
return "q{$s}";
-} #}}}
+}
-sub add_depends ($$) { #{{{
+sub add_depends ($$) {
my $page=shift;
my $pagespec=shift;
@@ -1647,9 +1647,9 @@ sub add_depends ($$) { #{{{
}
return 1;
-} # }}}
+}
-sub file_pruned ($$) { #{{{
+sub file_pruned ($$) {
require File::Spec;
my $file=File::Spec->canonpath(shift);
my $base=File::Spec->canonpath(shift);
@@ -1657,9 +1657,9 @@ sub file_pruned ($$) { #{{{
my $regexp='('.join('|', @{$config{wiki_file_prune_regexps}}).')';
return $file =~ m/$regexp/ && $file ne $base;
-} #}}}
+}
-sub gettext { #{{{
+sub gettext {
# Only use gettext in the rare cases it's needed.
if ((exists $ENV{LANG} && length $ENV{LANG}) ||
(exists $ENV{LC_ALL} && length $ENV{LC_ALL}) ||
@@ -1680,15 +1680,15 @@ sub gettext { #{{{
else {
return shift;
}
-} #}}}
+}
-sub yesno ($) { #{{{
+sub yesno ($) {
my $val=shift;
return (defined $val && lc($val) eq gettext("yes"));
-} #}}}
+}
-sub inject { #{{{
+sub inject {
# Injects a new function into the symbol table to replace an
# exported function.
my %params=@_;
@@ -1711,9 +1711,9 @@ sub inject { #{{{
}
use strict;
use warnings;
-} #}}}
+}
-sub pagespec_merge ($$) { #{{{
+sub pagespec_merge ($$) {
my $a=shift;
my $b=shift;
@@ -1728,9 +1728,9 @@ sub pagespec_merge ($$) { #{{{
}
return "($a) or ($b)";
-} #}}}
+}
-sub pagespec_translate ($) { #{{{
+sub pagespec_translate ($) {
my $spec=shift;
# Support for old-style GlobLists.
@@ -1784,9 +1784,9 @@ sub pagespec_translate ($) { #{{{
no warnings;
return eval 'sub { my $page=shift; '.$code.' }';
-} #}}}
+}
-sub pagespec_match ($$;@) { #{{{
+sub pagespec_match ($$;@) {
my $page=shift;
my $spec=shift;
my @params=@_;
@@ -1799,55 +1799,55 @@ sub pagespec_match ($$;@) { #{{{
my $sub=pagespec_translate($spec);
return IkiWiki::FailReason->new("syntax error in pagespec \"$spec\"") if $@;
return $sub->($page, @params);
-} #}}}
+}
-sub pagespec_valid ($) { #{{{
+sub pagespec_valid ($) {
my $spec=shift;
my $sub=pagespec_translate($spec);
return ! $@;
-} #}}}
+}
-sub glob2re ($) { #{{{
+sub glob2re ($) {
my $re=quotemeta(shift);
$re=~s/\\\*/.*/g;
$re=~s/\\\?/./g;
return $re;
-} #}}}
+}
package IkiWiki::FailReason;
-use overload ( #{{{
+use overload (
'""' => sub { ${$_[0]} },
'0+' => sub { 0 },
'!' => sub { bless $_[0], 'IkiWiki::SuccessReason'},
fallback => 1,
-); #}}}
+);
-sub new { #{{{
+sub new {
my $class = shift;
my $value = shift;
return bless \$value, $class;
-} #}}}
+}
package IkiWiki::SuccessReason;
-use overload ( #{{{
+use overload (
'""' => sub { ${$_[0]} },
'0+' => sub { 1 },
'!' => sub { bless $_[0], 'IkiWiki::FailReason'},
fallback => 1,
-); #}}}
+);
-sub new { #{{{
+sub new {
my $class = shift;
my $value = shift;
return bless \$value, $class;
-}; #}}}
+};
package IkiWiki::PageSpec;
-sub match_glob ($$;@) { #{{{
+sub match_glob ($$;@) {
my $page=shift;
my $glob=shift;
my %params=@_;
@@ -1873,13 +1873,13 @@ sub match_glob ($$;@) { #{{{
else {
return IkiWiki::FailReason->new("$glob does not match $page");
}
-} #}}}
+}
-sub match_internal ($$;@) { #{{{
+sub match_internal ($$;@) {
return match_glob($_[0], $_[1], @_, internal => 1)
-} #}}}
+}
-sub match_link ($$;@) { #{{{
+sub match_link ($$;@) {
my $page=shift;
my $link=lc(shift);
my %params=@_;
@@ -1911,13 +1911,13 @@ sub match_link ($$;@) { #{{{
}
}
return IkiWiki::FailReason->new("$page does not link to $link");
-} #}}}
+}
-sub match_backlink ($$;@) { #{{{
+sub match_backlink ($$;@) {
return match_link($_[1], $_[0], @_);
-} #}}}
+}
-sub match_created_before ($$;@) { #{{{
+sub match_created_before ($$;@) {
my $page=shift;
my $testpage=shift;
@@ -1932,9 +1932,9 @@ sub match_created_before ($$;@) { #{{{
else {
return IkiWiki::FailReason->new("$testpage has no ctime");
}
-} #}}}
+}
-sub match_created_after ($$;@) { #{{{
+sub match_created_after ($$;@) {
my $page=shift;
my $testpage=shift;
@@ -1949,36 +1949,36 @@ sub match_created_after ($$;@) { #{{{
else {
return IkiWiki::FailReason->new("$testpage has no ctime");
}
-} #}}}
+}
-sub match_creation_day ($$;@) { #{{{
+sub match_creation_day ($$;@) {
if ((gmtime($IkiWiki::pagectime{shift()}))[3] == shift) {
return IkiWiki::SuccessReason->new('creation_day matched');
}
else {
return IkiWiki::FailReason->new('creation_day did not match');
}
-} #}}}
+}
-sub match_creation_month ($$;@) { #{{{
+sub match_creation_month ($$;@) {
if ((gmtime($IkiWiki::pagectime{shift()}))[4] + 1 == shift) {
return IkiWiki::SuccessReason->new('creation_month matched');
}
else {
return IkiWiki::FailReason->new('creation_month did not match');
}
-} #}}}
+}
-sub match_creation_year ($$;@) { #{{{
+sub match_creation_year ($$;@) {
if ((gmtime($IkiWiki::pagectime{shift()}))[5] + 1900 == shift) {
return IkiWiki::SuccessReason->new('creation_year matched');
}
else {
return IkiWiki::FailReason->new('creation_year did not match');
}
-} #}}}
+}
-sub match_user ($$;@) { #{{{
+sub match_user ($$;@) {
shift;
my $user=shift;
my %params=@_;
@@ -1996,9 +1996,9 @@ sub match_user ($$;@) { #{{{
else {
return IkiWiki::FailReason->new("user is $params{user}, not $user");
}
-} #}}}
+}
-sub match_admin ($$;@) { #{{{
+sub match_admin ($$;@) {
shift;
shift;
my %params=@_;
@@ -2016,9 +2016,9 @@ sub match_admin ($$;@) { #{{{
else {
return IkiWiki::FailReason->new("user is not an admin");
}
-} #}}}
+}
-sub match_ip ($$;@) { #{{{
+sub match_ip ($$;@) {
shift;
my $ip=shift;
my %params=@_;
@@ -2033,6 +2033,6 @@ sub match_ip ($$;@) { #{{{
else {
return IkiWiki::FailReason->new("IP is $params{ip}, not $ip");
}
-} #}}}
+}
1
diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm
index a45e12e31..81cb42d13 100644
--- a/IkiWiki/CGI.pm
+++ b/IkiWiki/CGI.pm
@@ -9,7 +9,7 @@ use IkiWiki::UserInfo;
use open qw{:utf8 :std};
use Encode;
-sub printheader ($) { #{{{
+sub printheader ($) {
my $session=shift;
if ($config{sslcookie}) {
@@ -19,9 +19,9 @@ sub printheader ($) { #{{{
print $session->header(-charset => 'utf-8',
-cookie => $session->cookie(-httponly => 1));
}
-} #}}}
+}
-sub showform ($$$$;@) { #{{{
+sub showform ($$$$;@) {
my $form=shift;
my $buttons=shift;
my $session=shift;
@@ -36,9 +36,9 @@ sub showform ($$$$;@) { #{{{
printheader($session);
print misctemplate($form->title, $form->render(submit => $buttons), @_);
-} #}}}
+}
-sub redirect ($$) { #{{{
+sub redirect ($$) {
my $q=shift;
my $url=shift;
if (! $config{w3mmode}) {
@@ -48,9 +48,9 @@ sub redirect ($$) { #{{{
print "Content-type: text/plain\n";
print "W3m-control: GOTO $url\n\n";
}
-} #}}}
+}
-sub decode_cgi_utf8 ($) { #{{{
+sub decode_cgi_utf8 ($) {
# decode_form_utf8 method is needed for 5.10
if ($] < 5.01) {
my $cgi = shift;
@@ -58,9 +58,9 @@ sub decode_cgi_utf8 ($) { #{{{
$cgi->param($f, map { decode_utf8 $_ } $cgi->param($f));
}
}
-} #}}}
+}
-sub decode_form_utf8 ($) { #{{{
+sub decode_form_utf8 ($) {
if ($] >= 5.01) {
my $form = shift;
foreach my $f ($form->field) {
@@ -70,11 +70,11 @@ sub decode_form_utf8 ($) { #{{{
);
}
}
-} #}}}
+}
# Check if the user is signed in. If not, redirect to the signin form and
# save their place to return to later.
-sub needsignin ($$) { #{{{
+sub needsignin ($$) {
my $q=shift;
my $session=shift;
@@ -85,9 +85,9 @@ sub needsignin ($$) { #{{{
cgi_savesession($session);
exit;
}
-} #}}}
+}
-sub cgi_signin ($$) { #{{{
+sub cgi_signin ($$) {
my $q=shift;
my $session=shift;
@@ -127,9 +127,9 @@ sub cgi_signin ($$) { #{{{
}
showform($form, $buttons, $session, $q);
-} #}}}
+}
-sub cgi_postsignin ($$) { #{{{
+sub cgi_postsignin ($$) {
my $q=shift;
my $session=shift;
@@ -144,9 +144,9 @@ sub cgi_postsignin ($$) { #{{{
else {
error(gettext("login failed, perhaps you need to turn on cookies?"));
}
-} #}}}
+}
-sub cgi_prefs ($$) { #{{{
+sub cgi_prefs ($$) {
my $q=shift;
my $session=shift;
@@ -254,9 +254,9 @@ sub cgi_prefs ($$) { #{{{
}
showform($form, $buttons, $session, $q);
-} #}}}
+}
-sub check_banned ($$) { #{{{
+sub check_banned ($$) {
my $q=shift;
my $session=shift;
@@ -273,9 +273,9 @@ sub check_banned ($$) { #{{{
exit;
}
}
-} #}}}
+}
-sub cgi_getsession ($) { #{{{
+sub cgi_getsession ($) {
my $q=shift;
eval q{use CGI::Session; use HTML::Entities};
@@ -294,13 +294,13 @@ sub cgi_getsession ($) { #{{{
umask($oldmask);
return $session;
-} #}}}
+}
# To guard against CSRF, the user's session id (sid)
# can be stored on a form. This function will check
# (for logged in users) that the sid on the form matches
# the session id in the cookie.
-sub checksessionexpiry ($$) { # {{{
+sub checksessionexpiry ($$) {
my $q=shift;
my $session = shift;
@@ -310,18 +310,18 @@ sub checksessionexpiry ($$) { # {{{
error(gettext("Your login session has expired."));
}
}
-} # }}}
+}
-sub cgi_savesession ($) { #{{{
+sub cgi_savesession ($) {
my $session=shift;
# Force session flush with safe umask.
my $oldmask=umask(077);
$session->flush;
umask($oldmask);
-} #}}}
+}
-sub cgi (;$$) { #{{{
+sub cgi (;$$) {
my $q=shift;
my $session=shift;
@@ -391,16 +391,16 @@ sub cgi (;$$) { #{{{
else {
error("unknown do parameter");
}
-} #}}}
+}
# Does not need to be called directly; all errors will go through here.
-sub cgierror ($) { #{{{
+sub cgierror ($) {
my $message=shift;
print "Content-type: text/html\n\n";
print misctemplate(gettext("Error"),
"
".gettext("Error").": $message
");
die $@;
-} #}}}
+}
1
diff --git a/IkiWiki/Plugin/aggregate.pm b/IkiWiki/Plugin/aggregate.pm
index adaa619ab..29bc6d0ce 100644
--- a/IkiWiki/Plugin/aggregate.pm
+++ b/IkiWiki/Plugin/aggregate.pm
@@ -14,7 +14,7 @@ use open qw{:utf8 :std};
my %feeds;
my %guids;
-sub import { #{{{
+sub import {
hook(type => "getopt", id => "aggregate", call => \&getopt);
hook(type => "getsetup", id => "aggregate", call => \&getsetup);
hook(type => "checkconfig", id => "aggregate", call => \&checkconfig);
@@ -26,9 +26,9 @@ sub import { #{{{
if (exists $config{aggregate_webtrigger} && $config{aggregate_webtrigger}) {
hook(type => "cgi", id => "aggregate", call => \&cgi);
}
-} # }}}
+}
-sub getopt () { #{{{
+sub getopt () {
eval q{use Getopt::Long};
error($@) if $@;
Getopt::Long::Configure('pass_through');
@@ -36,9 +36,9 @@ sub getopt () { #{{{
"aggregate" => \$config{aggregate},
"aggregateinternal!" => \$config{aggregateinternal},
);
-} #}}}
+}
-sub getsetup () { #{{{
+sub getsetup () {
return
plugin => {
safe => 1,
@@ -58,16 +58,16 @@ sub getsetup () { #{{{
safe => 1,
rebuild => 0,
},
-} #}}}
+}
-sub checkconfig () { #{{{
+sub checkconfig () {
if ($config{aggregate} && ! ($config{post_commit} &&
IkiWiki::commit_hook_enabled())) {
launchaggregation();
}
-} #}}}
+}
-sub cgi ($) { #{{{
+sub cgi ($) {
my $cgi=shift;
if (defined $cgi->param('do') &&
@@ -90,9 +90,9 @@ sub cgi ($) { #{{{
}
exit 0;
}
-} #}}}
+}
-sub launchaggregation () { #{{{
+sub launchaggregation () {
# See if any feeds need aggregation.
loadstate();
my @feeds=needsaggregate();
@@ -135,16 +135,16 @@ sub launchaggregation () { #{{{
unlockaggregate();
return 1;
-} #}}}
+}
# Pages with extension _aggregated have plain html markup, pass through.
-sub htmlize (@) { #{{{
+sub htmlize (@) {
my %params=@_;
return $params{content};
-} #}}}
+}
# Used by ikiwiki-transition aggregateinternal.
-sub migrate_to_internal { #{{{
+sub migrate_to_internal {
if (! lockaggregate()) {
error("an aggregation process is currently running");
}
@@ -190,9 +190,9 @@ sub migrate_to_internal { #{{{
IkiWiki::unlockwiki;
unlockaggregate();
-} #}}}
+}
-sub needsbuild (@) { #{{{
+sub needsbuild (@) {
my $needsbuild=shift;
loadstate();
@@ -206,9 +206,9 @@ sub needsbuild (@) { #{{{
markunseen($feed->{sourcepage});
}
}
-} # }}}
+}
-sub preprocess (@) { #{{{
+sub preprocess (@) {
my %params=@_;
foreach my $required (qw{name url}) {
@@ -265,9 +265,9 @@ sub preprocess (@) { #{{{
($feed->{newposts} ? "; ".$feed->{newposts}.
" ".gettext("new") : "").
")";
-} # }}}
+}
-sub delete (@) { #{{{
+sub delete (@) {
my @files=@_;
# Remove feed data for removed pages.
@@ -275,9 +275,9 @@ sub delete (@) { #{{{
my $page=pagename($file);
markunseen($page);
}
-} #}}}
+}
-sub markunseen ($) { #{{{
+sub markunseen ($) {
my $page=shift;
foreach my $id (keys %feeds) {
@@ -285,11 +285,11 @@ sub markunseen ($) { #{{{
$feeds{$id}->{unseen}=1;
}
}
-} #}}}
+}
my $state_loaded=0;
-sub loadstate () { #{{{
+sub loadstate () {
return if $state_loaded;
$state_loaded=1;
if (-e "$config{wikistatedir}/aggregate") {
@@ -323,9 +323,9 @@ sub loadstate () { #{{{
close IN;
}
-} #}}}
+}
-sub savestate () { #{{{
+sub savestate () {
return unless $state_loaded;
garbage_collect();
my $newfile="$config{wikistatedir}/aggregate.new";
@@ -350,9 +350,9 @@ sub savestate () { #{{{
close OUT || error("save $newfile: $!", $cleanup);
rename($newfile, "$config{wikistatedir}/aggregate") ||
error("rename $newfile: $!", $cleanup);
-} #}}}
+}
-sub garbage_collect () { #{{{
+sub garbage_collect () {
foreach my $name (keys %feeds) {
# remove any feeds that were not seen while building the pages
# that used to contain them
@@ -375,9 +375,9 @@ sub garbage_collect () { #{{{
delete $guid->{md5};
}
}
-} #}}}
+}
-sub mergestate () { #{{{
+sub mergestate () {
# Load the current state in from disk, and merge into it
# values from the state in memory that might have changed
# during aggregation.
@@ -407,15 +407,15 @@ sub mergestate () { #{{{
$guids{$guid}=$myguids{$guid};
}
}
-} #}}}
+}
-sub clearstate () { #{{{
+sub clearstate () {
%feeds=();
%guids=();
$state_loaded=0;
-} #}}}
+}
-sub expire () { #{{{
+sub expire () {
foreach my $feed (values %feeds) {
next unless $feed->{expireage} || $feed->{expirecount};
my $count=0;
@@ -444,14 +444,14 @@ sub expire () { #{{{
}
}
}
-} #}}}
+}
-sub needsaggregate () { #{{{
+sub needsaggregate () {
return values %feeds if $config{rebuild};
return grep { time - $_->{lastupdate} >= $_->{updateinterval} } values %feeds;
-} #}}}
+}
-sub aggregate (@) { #{{{
+sub aggregate (@) {
eval q{use XML::Feed};
error($@) if $@;
eval q{use URI::Fetch};
@@ -542,9 +542,9 @@ sub aggregate (@) { #{{{
);
}
}
-} #}}}
+}
-sub add_page (@) { #{{{
+sub add_page (@) {
my %params=@_;
my $feed=$params{feed};
@@ -635,21 +635,21 @@ sub add_page (@) { #{{{
# Dummy value for expiry code.
$IkiWiki::pagectime{$guid->{page}}=time;
}
-} #}}}
+}
-sub wikiescape ($) { #{{{
+sub wikiescape ($) {
# escape accidental wikilinks and preprocessor stuff
return encode_entities(shift, '\[\]');
-} #}}}
+}
-sub urlabs ($$) { #{{{
+sub urlabs ($$) {
my $url=shift;
my $urlbase=shift;
URI->new_abs($url, $urlbase)->as_string;
-} #}}}
+}
-sub htmlabs ($$) { #{{{
+sub htmlabs ($$) {
# Convert links in html from relative to absolute.
# Note that this is a heuristic, which is not specified by the rss
# spec and may not be right for all feeds. Also, see Debian
@@ -685,15 +685,15 @@ sub htmlabs ($$) { #{{{
$p->eof;
return $ret;
-} #}}}
+}
-sub htmlfn ($) { #{{{
+sub htmlfn ($) {
return shift().".".($config{aggregateinternal} ? "_aggregated" : $config{htmlext});
-} #}}}
+}
my $aggregatelock;
-sub lockaggregate () { #{{{
+sub lockaggregate () {
# Take an exclusive lock to prevent multiple concurrent aggregators.
# Returns true if the lock was aquired.
if (! -d $config{wikistatedir}) {
@@ -706,11 +706,11 @@ sub lockaggregate () { #{{{
return 0;
}
return 1;
-} #}}}
+}
-sub unlockaggregate () { #{{{
+sub unlockaggregate () {
return close($aggregatelock) if $aggregatelock;
return;
-} #}}}
+}
1
diff --git a/IkiWiki/Plugin/amazon_s3.pm b/IkiWiki/Plugin/amazon_s3.pm
index 597539c13..93c10b629 100644
--- a/IkiWiki/Plugin/amazon_s3.pm
+++ b/IkiWiki/Plugin/amazon_s3.pm
@@ -16,13 +16,13 @@ BEGIN {
}
};
-sub import { #{{{
+sub import {
hook(type => "getopt", id => "amazon_s3", call => \&getopt);
hook(type => "getsetup", id => "amazon_s3", call => \&getsetup);
hook(type => "checkconfig", id => "amazon_s3", call => \&checkconfig);
-} # }}}
+}
-sub getopt () { #{{{
+sub getopt () {
eval q{use Getopt::Long};
error($@) if $@;
Getopt::Long::Configure('pass_through');
@@ -38,9 +38,9 @@ sub getopt () { #{{{
debug(gettext("done"));
exit(0);
});
-} #}}}
+}
-sub getsetup () { #{{{
+sub getsetup () {
return
plugin => {
safe => 0,
@@ -88,9 +88,9 @@ sub getsetup () { #{{{
safe => 1,
rebuild => 1,
},
-} #}}}
+}
-sub checkconfig { #{{{
+sub checkconfig {
foreach my $field (qw{amazon_s3_key_id amazon_s3_key_file
amazon_s3_bucket}) {
if (! exists $config{$field} || ! defined $config{$field}) {
@@ -101,11 +101,11 @@ sub checkconfig { #{{{
! defined $config{amazon_s3_prefix}) {
$config{amazon_s3_prefix}="wiki/";
}
-} #}}}
+}
{
my $bucket;
-sub getbucket { #{{{
+sub getbucket {
return $bucket if defined $bucket;
open(IN, "<", $config{amazon_s3_key_file}) || error($config{amazon_s3_key_file}.": ".$!);
@@ -138,11 +138,11 @@ sub getbucket { #{{{
}
return $bucket;
-} #}}}
+}
}
# Given a file, return any S3 keys associated with it.
-sub file2keys ($) { #{{{
+sub file2keys ($) {
my $file=shift;
my @keys;
@@ -162,14 +162,14 @@ sub file2keys ($) { #{{{
}
}
return @keys;
-} #}}}
+}
package IkiWiki;
use File::MimeInfo;
use Encode;
# This is a wrapper around the real writefile.
-sub writefile ($$$;$$) { #{{{
+sub writefile ($$$;$$) {
my $file=shift;
my $destdir=shift;
my $content=shift;
@@ -225,10 +225,10 @@ sub writefile ($$$;$$) { #{{{
}
return $ret;
-} #}}}
+}
# This is a wrapper around the real prune.
-sub prune ($) { #{{{
+sub prune ($) {
my $file=shift;
my @keys=IkiWiki::Plugin::amazon_s3::file2keys($file);
@@ -247,6 +247,6 @@ sub prune ($) { #{{{
}
return $IkiWiki::Plugin::amazon_s3::subs{'IkiWiki::prune'}->($file);
-} #}}}
+}
1
diff --git a/IkiWiki/Plugin/anonok.pm b/IkiWiki/Plugin/anonok.pm
index 2be983693..1cbdfe4e5 100644
--- a/IkiWiki/Plugin/anonok.pm
+++ b/IkiWiki/Plugin/anonok.pm
@@ -5,12 +5,12 @@ use warnings;
use strict;
use IkiWiki 2.00;
-sub import { #{{{
+sub import {
hook(type => "getsetup", id => "anonok", call => \&getsetup);
hook(type => "canedit", id => "anonok", call => \&canedit);
-} # }}}
+}
-sub getsetup () { #{{{
+sub getsetup () {
return
plugin => {
safe => 1,
@@ -24,9 +24,9 @@ sub getsetup () { #{{{
safe => 1,
rebuild => 0,
},
-} #}}}
+}
-sub canedit ($$$) { #{{{
+sub canedit ($$$) {
my $page=shift;
my $cgi=shift;
my $session=shift;
@@ -45,6 +45,6 @@ sub canedit ($$$) { #{{{
else {
return "";
}
-} #}}}
+}
1
diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm
index 44781165c..87da6cd4e 100644
--- a/IkiWiki/Plugin/attachment.pm
+++ b/IkiWiki/Plugin/attachment.pm
@@ -5,16 +5,16 @@ use warnings;
use strict;
use IkiWiki 2.00;
-sub import { #{{{
+sub import {
add_underlay("javascript");
hook(type => "getsetup", id => "attachment", call => \&getsetup);
hook(type => "checkconfig", id => "attachment", call => \&checkconfig);
hook(type => "formbuilder_setup", id => "attachment", call => \&formbuilder_setup);
hook(type => "formbuilder", id => "attachment", call => \&formbuilder);
IkiWiki::loadplugin("filecheck");
-} # }}}
+}
-sub getsetup () { #{{{
+sub getsetup () {
return
plugin => {
safe => 1,
@@ -35,9 +35,9 @@ sub getsetup () { #{{{
safe => 0, # executed
rebuild => 0,
},
-} #}}}
+}
-sub check_canattach ($$;$) { #{{{
+sub check_canattach ($$;$) {
my $session=shift;
my $dest=shift; # where it's going to be put, under the srcdir
my $file=shift; # the path to the attachment currently
@@ -84,13 +84,13 @@ sub check_canattach ($$;$) { #{{{
else {
return 1;
}
-} #}}}
+}
-sub checkconfig () { #{{{
+sub checkconfig () {
$config{cgi_disable_uploads}=0;
-} #}}}
+}
-sub formbuilder_setup (@) { #{{{
+sub formbuilder_setup (@) {
my %params=@_;
my $form=$params{form};
my $q=$params{cgi};
@@ -153,9 +153,9 @@ sub formbuilder_setup (@) { #{{{
}
}
}
-} #}}}
+}
-sub formbuilder (@) { #{{{
+sub formbuilder (@) {
my %params=@_;
my $form=$params{form};
my $q=$params{cgi};
@@ -253,9 +253,9 @@ sub formbuilder (@) { #{{{
# Generate the attachment list only after having added any new
# attachments.
$form->tmpl_param("attachment_list" => [attachment_list($form->field('page'))]);
-} # }}}
+}
-sub attachment_location ($) { #{{{
+sub attachment_location ($) {
my $page=shift;
# Put the attachment in a subdir of the page it's attached
@@ -264,9 +264,9 @@ sub attachment_location ($) { #{{{
$page.="/" if length $page;
return $page;
-} #}}}
+}
-sub attachment_list ($) { #{{{
+sub attachment_list ($) {
my $page=shift;
my $loc=attachment_location($page);
@@ -287,6 +287,6 @@ sub attachment_list ($) { #{{{
# Sort newer attachments to the top of the list, so a newly-added
# attachment appears just before the form used to add it.
return sort { $b->{mtime_raw} <=> $a->{mtime_raw} || $a->{link} cmp $b->{link} } @ret;
-} #}}}
+}
1
diff --git a/IkiWiki/Plugin/autoindex.pm b/IkiWiki/Plugin/autoindex.pm
index d1b3edb1f..bb08091ae 100644
--- a/IkiWiki/Plugin/autoindex.pm
+++ b/IkiWiki/Plugin/autoindex.pm
@@ -6,20 +6,20 @@ use strict;
use IkiWiki 2.00;
use Encode;
-sub import { #{{{
+sub import {
hook(type => "getsetup", id => "autoindex", call => \&getsetup);
hook(type => "refresh", id => "autoindex", call => \&refresh);
-} # }}}
+}
-sub getsetup () { #{{{
+sub getsetup () {
return
plugin => {
safe => 1,
rebuild => 0,
},
-} #}}}
+}
-sub genindex ($) { #{{{
+sub genindex ($) {
my $page=shift;
my $file=newpagefile($page, $config{default_pageext});
my $template=template("autoindex.tmpl");
@@ -28,9 +28,9 @@ sub genindex ($) { #{{{
if ($config{rcs}) {
IkiWiki::rcs_add($file);
}
-} #}}}
+}
-sub refresh () { #{{{
+sub refresh () {
eval q{use File::Find};
error($@) if $@;
@@ -107,6 +107,6 @@ sub refresh () { #{{{
IkiWiki::enable_commit_hook();
}
}
-} #}}}
+}
1
diff --git a/IkiWiki/Plugin/brokenlinks.pm b/IkiWiki/Plugin/brokenlinks.pm
index 37752dd3e..1c52099bf 100644
--- a/IkiWiki/Plugin/brokenlinks.pm
+++ b/IkiWiki/Plugin/brokenlinks.pm
@@ -6,20 +6,20 @@ use warnings;
use strict;
use IkiWiki 2.00;
-sub import { #{{{
+sub import {
hook(type => "getsetup", id => "brokenlinks", call => \&getsetup);
hook(type => "preprocess", id => "brokenlinks", call => \&preprocess);
-} # }}}
+}
-sub getsetup { #{{{
+sub getsetup {
return
plugin => {
safe => 1,
rebuild => undef,
},
-} #}}}
+}
-sub preprocess (@) { #{{{
+sub preprocess (@) {
my %params=@_;
$params{pages}="*" unless defined $params{pages};
@@ -61,6 +61,6 @@ sub preprocess (@) { #{{{
}
sort @broken)
."\n";
-} # }}}
+}
1
diff --git a/IkiWiki/Plugin/bzr.pm b/IkiWiki/Plugin/bzr.pm
index 1054f5b3e..16c959069 100644
--- a/IkiWiki/Plugin/bzr.pm
+++ b/IkiWiki/Plugin/bzr.pm
@@ -7,7 +7,7 @@ use IkiWiki;
use Encode;
use open qw{:utf8 :std};
-sub import { #{{{
+sub import {
hook(type => "checkconfig", id => "bzr", call => \&checkconfig);
hook(type => "getsetup", id => "bzr", call => \&getsetup);
hook(type => "rcs", id => "rcs_update", call => \&rcs_update);
@@ -20,18 +20,18 @@ sub import { #{{{
hook(type => "rcs", id => "rcs_recentchanges", call => \&rcs_recentchanges);
hook(type => "rcs", id => "rcs_diff", call => \&rcs_diff);
hook(type => "rcs", id => "rcs_getctime", call => \&rcs_getctime);
-} #}}}
+}
-sub checkconfig () { #{{{
+sub checkconfig () {
if (defined $config{bzr_wrapper} && length $config{bzr_wrapper}) {
push @{$config{wrappers}}, {
wrapper => $config{bzr_wrapper},
wrappermode => (defined $config{bzr_wrappermode} ? $config{bzr_wrappermode} : "06755"),
};
}
-} #}}}
+}
-sub getsetup () { #{{{
+sub getsetup () {
return
plugin => {
safe => 0, # rcs plugin
@@ -65,9 +65,9 @@ sub getsetup () { #{{{
safe => 1,
rebuild => 1,
},
-} #}}}
+}
-sub bzr_log ($) { #{{{
+sub bzr_log ($) {
my $out = shift;
my @infos = ();
my $key = undef;
@@ -99,20 +99,20 @@ sub bzr_log ($) { #{{{
close $out;
return @infos;
-} #}}}
+}
-sub rcs_update () { #{{{
+sub rcs_update () {
my @cmdline = ("bzr", "update", "--quiet", $config{srcdir});
if (system(@cmdline) != 0) {
warn "'@cmdline' failed: $!";
}
-} #}}}
+}
-sub rcs_prepedit ($) { #{{{
+sub rcs_prepedit ($) {
return "";
-} #}}}
+}
-sub bzr_author ($$) { #{{{
+sub bzr_author ($$) {
my ($user, $ipaddr) = @_;
if (defined $user) {
@@ -124,9 +124,9 @@ sub bzr_author ($$) { #{{{
else {
return "Anonymous";
}
-} #}}}
+}
-sub rcs_commit ($$$;$$) { #{{{
+sub rcs_commit ($$$;$$) {
my ($file, $message, $rcstoken, $user, $ipaddr) = @_;
$user = bzr_author($user, $ipaddr);
@@ -143,7 +143,7 @@ sub rcs_commit ($$$;$$) { #{{{
}
return undef; # success
-} #}}}
+}
sub rcs_commit_staged ($$$) {
# Commits all staged changes. Changes can be staged using rcs_add,
@@ -164,27 +164,27 @@ sub rcs_commit_staged ($$$) {
}
return undef; # success
-} #}}}
+}
-sub rcs_add ($) { # {{{
+sub rcs_add ($) {
my ($file) = @_;
my @cmdline = ("bzr", "add", "--quiet", "$config{srcdir}/$file");
if (system(@cmdline) != 0) {
warn "'@cmdline' failed: $!";
}
-} #}}}
+}
-sub rcs_remove ($) { # {{{
+sub rcs_remove ($) {
my ($file) = @_;
my @cmdline = ("bzr", "rm", "--force", "--quiet", "$config{srcdir}/$file");
if (system(@cmdline) != 0) {
warn "'@cmdline' failed: $!";
}
-} #}}}
+}
-sub rcs_rename ($$) { # {{{
+sub rcs_rename ($$) {
my ($src, $dest) = @_;
my $parent = IkiWiki::dirname($dest);
@@ -196,9 +196,9 @@ sub rcs_rename ($$) { # {{{
if (system(@cmdline) != 0) {
warn "'@cmdline' failed: $!";
}
-} #}}}
+}
-sub rcs_recentchanges ($) { #{{{
+sub rcs_recentchanges ($) {
my ($num) = @_;
my @cmdline = ("bzr", "log", "-v", "--show-ids", "--limit", $num,
@@ -253,9 +253,9 @@ sub rcs_recentchanges ($) { #{{{
}
return @ret;
-} #}}}
+}
-sub rcs_getctime ($) { #{{{
+sub rcs_getctime ($) {
my ($file) = @_;
# XXX filename passes through the shell here, should try to avoid
@@ -274,6 +274,6 @@ sub rcs_getctime ($) { #{{{
my $ctime = str2time($log[0]->{"timestamp"});
return $ctime;
-} #}}}
+}
1
diff --git a/IkiWiki/Plugin/calendar.pm b/IkiWiki/Plugin/calendar.pm
index 6d536a91b..88303fc44 100644
--- a/IkiWiki/Plugin/calendar.pm
+++ b/IkiWiki/Plugin/calendar.pm
@@ -29,13 +29,13 @@ my %linkcache;
my $time=time;
my @now=localtime($time);
-sub import { #{{{
+sub import {
hook(type => "getsetup", id => "calendar", call => \&getsetup);
hook(type => "needsbuild", id => "calendar", call => \&needsbuild);
hook(type => "preprocess", id => "calendar", call => \&preprocess);
-} #}}}
+}
-sub getsetup () { #{{{
+sub getsetup () {
return
plugin => {
safe => 1,
@@ -48,23 +48,23 @@ sub getsetup () { #{{{
safe => 1,
rebuild => 1,
},
-} #}}}
+}
-sub is_leap_year (@) { #{{{
+sub is_leap_year (@) {
my %params=@_;
return ($params{year} % 4 == 0 && (($params{year} % 100 != 0) || $params{year} % 400 == 0));
-} #}}}
+}
-sub month_days { #{{{
+sub month_days {
my %params=@_;
my $days_in_month = (31,28,31,30,31,30,31,31,30,31,30,31)[$params{month}-1];
if ($params{month} == 2 && is_leap_year(%params)) {
$days_in_month++;
}
return $days_in_month;
-} #}}}
+}
-sub format_month (@) { #{{{
+sub format_month (@) {
my %params=@_;
my $pagespec = $params{pages};
@@ -215,9 +215,9 @@ EOF
add_depends($params{page}, join(" or ", @list));
return $calendar;
-} #}}}
+}
-sub format_year (@) { #{{{
+sub format_year (@) {
my %params=@_;
my $pagespec = $params{pages};
@@ -318,9 +318,9 @@ EOF
EOF
return $calendar;
-} #}}}
+}
-sub preprocess (@) { #{{{
+sub preprocess (@) {
my %params=@_;
$params{pages} = "*" unless defined $params{pages};
$params{type} = "month" unless defined $params{type};
@@ -397,7 +397,7 @@ sub preprocess (@) { #{{{
return "\n
$calendar
\n";
} #}}
-sub needsbuild (@) { #{{{
+sub needsbuild (@) {
my $needsbuild=shift;
foreach my $page (keys %pagestate) {
if (exists $pagestate{$page}{calendar}{nextchange}) {
@@ -415,6 +415,6 @@ sub needsbuild (@) { #{{{
}
}
}
-} # }}}
+}
1
diff --git a/IkiWiki/Plugin/camelcase.pm b/IkiWiki/Plugin/camelcase.pm
index 7881becd5..6c1fafb7b 100644
--- a/IkiWiki/Plugin/camelcase.pm
+++ b/IkiWiki/Plugin/camelcase.pm
@@ -22,21 +22,21 @@ my $link_regexp=qr{
)
}x;
-sub import { #{{{
+sub import {
hook(type => "getsetup", id => "camelcase", call => \&getsetup);
hook(type => "linkify", id => "camelcase", call => \&linkify);
hook(type => "scan", id => "camelcase", call => \&scan);
-} # }}}
+}
-sub getsetup () { #{{{
+sub getsetup () {
return
plugin => {
safe => 1,
rebuild => undef,
};
-} #}}}
+}
-sub linkify (@) { #{{{
+sub linkify (@) {
my %params=@_;
my $page=$params{page};
my $destpage=$params{destpage};
@@ -46,9 +46,9 @@ sub linkify (@) { #{{{
}eg;
return $params{content};
-} #}}}
+}
-sub scan (@) { #{{{
+sub scan (@) {
my %params=@_;
my $page=$params{page};
my $content=$params{content};
diff --git a/IkiWiki/Plugin/color.pm b/IkiWiki/Plugin/color.pm
index ac702ff02..53d8389d2 100644
--- a/IkiWiki/Plugin/color.pm
+++ b/IkiWiki/Plugin/color.pm
@@ -7,12 +7,12 @@ use warnings;
use strict;
use IkiWiki 2.00;
-sub import { #{{{
+sub import {
hook(type => "preprocess", id => "color", call => \&preprocess);
hook(type => "format", id => "color", call => \&format);
-} #}}}
+}
-sub preserve_style ($$$) { #{{{
+sub preserve_style ($$$) {
my $foreground = shift;
my $background = shift;
my $text = shift;
@@ -37,18 +37,18 @@ sub preserve_style ($$$) { #{{{
return $preserved;
-} #}}}
+}
-sub replace_preserved_style ($) { #{{{
+sub replace_preserved_style ($) {
my $content = shift;
$content =~ s!((color: ([a-z]+|\#[0-9a-f]{3,6})?)?((; )?(background-color: ([a-z]+|\#[0-9a-f]{3,6})?)?)?)!!g;
$content =~ s!!!g;
return $content;
-} #}}}
+}
-sub preprocess (@) { #{{{
+sub preprocess (@) {
my %params = @_;
# Preprocess the text to expand any preprocessor directives
@@ -57,13 +57,13 @@ sub preprocess (@) { #{{{
IkiWiki::filter($params{page}, $params{destpage}, $params{text}));
return preserve_style($params{foreground}, $params{background}, $params{text});
-} #}}}
+}
-sub format (@) { #{{{
+sub format (@) {
my %params = @_;
$params{content} = replace_preserved_style($params{content});
return $params{content};
-} #}}}
+}
1
diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm
index b8748a1d6..6184c6031 100644
--- a/IkiWiki/Plugin/comments.pm
+++ b/IkiWiki/Plugin/comments.pm
@@ -17,7 +17,7 @@ use constant CANCEL => "Cancel";
my $postcomment;
-sub import { #{{{
+sub import {
hook(type => "checkconfig", id => 'comments', call => \&checkconfig);
hook(type => "getsetup", id => 'comments', call => \&getsetup);
hook(type => "preprocess", id => '_comment', call => \&preprocess);
@@ -26,9 +26,9 @@ sub import { #{{{
hook(type => "pagetemplate", id => "comments", call => \&pagetemplate);
hook(type => "cgi", id => "comments", call => \&linkcgi);
IkiWiki::loadplugin("inline");
-} # }}}
+}
-sub getsetup () { #{{{
+sub getsetup () {
return
plugin => {
safe => 1,
@@ -88,15 +88,15 @@ sub getsetup () { #{{{
safe => 0,
rebuild => 0,
},
-} #}}}
+}
-sub htmlize { # {{{
+sub htmlize {
my %params = @_;
return $params{content};
-} # }}}
+}
# FIXME: copied verbatim from meta
-sub safeurl ($) { #{{{
+sub safeurl ($) {
my $url=shift;
if (exists $IkiWiki::Plugin::htmlscrubber::{safe_url_regexp} &&
defined $IkiWiki::Plugin::htmlscrubber::safe_url_regexp) {
@@ -105,9 +105,9 @@ sub safeurl ($) { #{{{
else {
return 1;
}
-} #}}}
+}
-sub preprocess { # {{{
+sub preprocess {
my %params = @_;
my $page = $params{page};
@@ -206,16 +206,16 @@ sub preprocess { # {{{
# FIXME: hard-coded HTML (although it's just to set an ID)
return "
$content
" if $anchor;
return $content;
-} # }}}
+}
-sub checkconfig () { #{{{
+sub checkconfig () {
$config{comments_commit} = 1 unless defined $config{comments_commit};
$config{comments_pagename} = 'comment_'
unless defined $config{comments_pagename};
-} #}}}
+}
# This is exactly the same as recentchanges_link :-(
-sub linkcgi ($) { #{{{
+sub linkcgi ($) {
my $cgi=shift;
if (defined $cgi->param('do') && $cgi->param('do') eq "commenter") {
@@ -245,7 +245,7 @@ sub linkcgi ($) { #{{{
# FIXME: basically the same logic as recentchanges
# returns (author URL, pretty-printed version)
-sub linkuser ($) { # {{{
+sub linkuser ($) {
my $user = shift;
my $oiduser = eval { IkiWiki::openiduser($user) };
@@ -262,10 +262,10 @@ sub linkuser ($) { # {{{
: "$user")
), $user);
}
-} # }}}
+}
# Mostly cargo-culted from IkiWiki::plugin::editpage
-sub sessioncgi ($$) { #{{{
+sub sessioncgi ($$) {
my $cgi=shift;
my $session=shift;
@@ -512,9 +512,9 @@ sub sessioncgi ($$) { #{{{
}
exit;
-} #}}}
+}
-sub pagetemplate (@) { #{{{
+sub pagetemplate (@) {
my %params = @_;
my $page = $params{page};
@@ -583,7 +583,7 @@ sub pagetemplate (@) { #{{{
$template->param(commentauthorurl =>
$pagestate{$page}{comments}{commentauthorurl});
}
-} # }}}
+}
package IkiWiki::PageSpec;
diff --git a/IkiWiki/Plugin/conditional.pm b/IkiWiki/Plugin/conditional.pm
index e787424aa..66253e07d 100644
--- a/IkiWiki/Plugin/conditional.pm
+++ b/IkiWiki/Plugin/conditional.pm
@@ -6,20 +6,20 @@ use strict;
use IkiWiki 2.00;
use UNIVERSAL;
-sub import { #{{{
+sub import {
hook(type => "getsetup", id => "conditional", call => \&getsetup);
hook(type => "preprocess", id => "if", call => \&preprocess_if);
-} # }}}
+}
-sub getsetup { #{{{
+sub getsetup {
return
plugin => {
safe => 1,
rebuild => undef,
},
-} #}}}
+}
-sub preprocess_if (@) { #{{{
+sub preprocess_if (@) {
my %params=@_;
foreach my $param (qw{test then}) {
@@ -66,11 +66,11 @@ sub preprocess_if (@) { #{{{
}
return IkiWiki::preprocess($params{page}, $params{destpage},
IkiWiki::filter($params{page}, $params{destpage}, $ret));
-} # }}}
+}
package IkiWiki::PageSpec;
-sub match_enabled ($$;@) { #{{{
+sub match_enabled ($$;@) {
shift;
my $plugin=shift;
@@ -81,9 +81,9 @@ sub match_enabled ($$;@) { #{{{
else {
return IkiWiki::FailReason->new("$plugin is not enabled");
}
-} #}}}
+}
-sub match_sourcepage ($$;@) { #{{{
+sub match_sourcepage ($$;@) {
shift;
my $glob=shift;
my %params=@_;
@@ -95,9 +95,9 @@ sub match_sourcepage ($$;@) { #{{{
else {
return IkiWiki::FailReason->new("sourcepage does not match $glob");
}
-} #}}}
+}
-sub match_destpage ($$;@) { #{{{
+sub match_destpage ($$;@) {
shift;
my $glob=shift;
my %params=@_;
@@ -109,9 +109,9 @@ sub match_destpage ($$;@) { #{{{
else {
return IkiWiki::FailReason->new("destpage does not match $glob");
}
-} #}}}
+}
-sub match_included ($$;@) { #{{{
+sub match_included ($$;@) {
shift;
shift;
my %params=@_;
@@ -123,6 +123,6 @@ sub match_included ($$;@) { #{{{
else {
return IkiWiki::FailReason->new("page $params{sourcepage} is not included");
}
-} #}}}
+}
1
diff --git a/IkiWiki/Plugin/creole.pm b/IkiWiki/Plugin/creole.pm
index 7c729300d..3c46a48df 100644
--- a/IkiWiki/Plugin/creole.pm
+++ b/IkiWiki/Plugin/creole.pm
@@ -7,20 +7,20 @@ use warnings;
use strict;
use IkiWiki 2.00;
-sub import { #{{{
+sub import {
hook(type => "getsetup", id => "creole", call => \&getsetup);
hook(type => "htmlize", id => "creole", call => \&htmlize);
-} # }}}
+}
-sub getsetup { #{{{
+sub getsetup {
return
plugin => {
safe => 1,
rebuild => 1, # format plugin
},
-} #}}}
+}
-sub htmlize (@) { #{{{
+sub htmlize (@) {
my %params=@_;
my $content = $params{content};
@@ -32,6 +32,6 @@ sub htmlize (@) { #{{{
creole_custombarelinks();
return creole_parse($content);
-} # }}}
+}
1
diff --git a/IkiWiki/Plugin/cutpaste.pm b/IkiWiki/Plugin/cutpaste.pm
index 92667a1ef..e579c1ea2 100644
--- a/IkiWiki/Plugin/cutpaste.pm
+++ b/IkiWiki/Plugin/cutpaste.pm
@@ -7,22 +7,22 @@ use IkiWiki 2.00;
my %savedtext;
-sub import { #{{{
+sub import {
hook(type => "getsetup", id => "cutpaste", call => \&getsetup);
hook(type => "preprocess", id => "cut", call => \&preprocess_cut, scan => 1);
hook(type => "preprocess", id => "copy", call => \&preprocess_copy, scan => 1);
hook(type => "preprocess", id => "paste", call => \&preprocess_paste);
-} # }}}
+}
-sub getsetup () { #{{{
+sub getsetup () {
return
plugin => {
safe => 1,
rebuild => undef,
},
-} #}}}
+}
-sub preprocess_cut (@) { #{{{
+sub preprocess_cut (@) {
my %params=@_;
foreach my $param (qw{id text}) {
@@ -35,9 +35,9 @@ sub preprocess_cut (@) { #{{{
$savedtext{$params{page}}->{$params{id}} = $params{text};
return "" if defined wantarray;
-} # }}}
+}
-sub preprocess_copy (@) { #{{{
+sub preprocess_copy (@) {
my %params=@_;
foreach my $param (qw{id text}) {
@@ -51,9 +51,9 @@ sub preprocess_copy (@) { #{{{
return IkiWiki::preprocess($params{page}, $params{destpage},
IkiWiki::filter($params{page}, $params{destpage}, $params{text})) if defined wantarray;
-} # }}}
+}
-sub preprocess_paste (@) { #{{{
+sub preprocess_paste (@) {
my %params=@_;
foreach my $param (qw{id}) {
@@ -71,6 +71,6 @@ sub preprocess_paste (@) { #{{{
return IkiWiki::preprocess($params{page}, $params{destpage},
IkiWiki::filter($params{page}, $params{destpage}, $savedtext{$params{page}}->{$params{id}}));
-} # }}}
+}
1;
diff --git a/IkiWiki/Plugin/ddate.pm b/IkiWiki/Plugin/ddate.pm
index c73317b2f..3470640dc 100644
--- a/IkiWiki/Plugin/ddate.pm
+++ b/IkiWiki/Plugin/ddate.pm
@@ -5,19 +5,19 @@ package IkiWiki::Plugin::ddate;
use IkiWiki 2.00;
no warnings;
-sub import { #{{{
+sub import {
hook(type => "getsetup", id => "ddate", call => \&getsetup);
-} # }}}
+}
-sub getsetup { #{{{
+sub getsetup {
return
plugin => {
safe => 1,
rebuild => 1,
},
-} #}}}
+}
-sub IkiWiki::formattime ($;$) { #{{{
+sub IkiWiki::formattime ($;$) {
my $time=shift;
my $format=shift;
if (! defined $format) {
@@ -36,6 +36,6 @@ sub IkiWiki::formattime ($;$) { #{{{
my $dt = DateTime->from_epoch(epoch => $time);
my $dd = DateTime::Calendar::Discordian->from_object(object => $dt);
return $dd->strftime($format);
-} #}}}
+}
5
diff --git a/IkiWiki/Plugin/editdiff.pm b/IkiWiki/Plugin/editdiff.pm
index f5d7837fc..068b83b3c 100644
--- a/IkiWiki/Plugin/editdiff.pm
+++ b/IkiWiki/Plugin/editdiff.pm
@@ -8,21 +8,21 @@ use IkiWiki 2.00;
use HTML::Entities;
use IPC::Open2;
-sub import { #{{{
+sub import {
hook(type => "getsetup", id => "editdiff", call => \&getsetup);
hook(type => "formbuilder_setup", id => "editdiff",
call => \&formbuilder_setup);
-} #}}}
+}
-sub getsetup () { #{{{
+sub getsetup () {
return
plugin => {
safe => 1,
rebuild => 0,
},
-} #}}}
+}
-sub diff ($$) { #{{{
+sub diff ($$) {
my $orig=shift;
my $content=shift;
@@ -50,9 +50,9 @@ sub diff ($$) { #{{{
return "couldn't run diff\n" if $sigpipe;
return "
".encode_entities($ret)."
";
-} #}}}
+}
-sub formbuilder_setup { #{{{
+sub formbuilder_setup {
my %params=@_;
my $form=$params{form};
@@ -72,6 +72,6 @@ sub formbuilder_setup { #{{{
my $diff = diff(srcfile($pagesources{$page}), $content);
$form->tmpl_param("page_preview", $diff);
}
-} #}}}
+}
1
diff --git a/IkiWiki/Plugin/editpage.pm b/IkiWiki/Plugin/editpage.pm
index 242624d77..9210d6ff8 100644
--- a/IkiWiki/Plugin/editpage.pm
+++ b/IkiWiki/Plugin/editpage.pm
@@ -6,19 +6,19 @@ use strict;
use IkiWiki;
use open qw{:utf8 :std};
-sub import { #{{{
+sub import {
hook(type => "getsetup", id => "editpage", call => \&getsetup);
hook(type => "refresh", id => "editpage", call => \&refresh);
hook(type => "sessioncgi", id => "editpage", call => \&IkiWiki::cgi_editpage);
-} # }}}
+}
-sub getsetup () { #{{{
+sub getsetup () {
return
plugin => {
safe => 1,
rebuild => 1,
},
-} #}}}
+}
sub refresh () {
if (exists $wikistate{editpage} && exists $wikistate{editpage}{previews}) {
@@ -54,7 +54,7 @@ sub refresh () {
# and other plugins use the functions below.
package IkiWiki;
-sub check_canedit ($$$;$) { #{{{
+sub check_canedit ($$$;$) {
my $page=shift;
my $q=shift;
my $session=shift;
@@ -79,9 +79,9 @@ sub check_canedit ($$$;$) { #{{{
}
});
return $canedit;
-} #}}}
+}
-sub cgi_editpage ($$) { #{{{
+sub cgi_editpage ($$) {
my $q=shift;
my $session=shift;
@@ -453,6 +453,6 @@ sub cgi_editpage ($$) { #{{{
}
exit;
-} #}}}
+}
1
diff --git a/IkiWiki/Plugin/edittemplate.pm b/IkiWiki/Plugin/edittemplate.pm
index 846b4e7c8..7c0e7c2f8 100644
--- a/IkiWiki/Plugin/edittemplate.pm
+++ b/IkiWiki/Plugin/edittemplate.pm
@@ -7,7 +7,7 @@ use IkiWiki 2.00;
use HTML::Template;
use Encode;
-sub import { #{{{
+sub import {
hook(type => "getsetup", id => "edittemplate",
call => \&getsetup);
hook(type => "needsbuild", id => "edittemplate",
@@ -16,17 +16,17 @@ sub import { #{{{
call => \&preprocess);
hook(type => "formbuilder", id => "edittemplate",
call => \&formbuilder);
-} #}}}
+}
-sub getsetup () { #{{{
+sub getsetup () {
return
plugin => {
safe => 1,
rebuild => undef,
},
-} #}}}
+}
-sub needsbuild (@) { #{{{
+sub needsbuild (@) {
my $needsbuild=shift;
foreach my $page (keys %pagestate) {
@@ -40,9 +40,9 @@ sub needsbuild (@) { #{{{
}
}
}
-} #}}}
+}
-sub preprocess (@) { #{{{
+sub preprocess (@) {
my %params=@_;
return "" if $params{page} ne $params{destpage};
@@ -62,9 +62,9 @@ sub preprocess (@) { #{{{
return sprintf(gettext("edittemplate %s registered for %s"),
htmllink($params{page}, $params{destpage}, $link),
$params{match});
-} # }}}
+}
-sub formbuilder (@) { #{{{
+sub formbuilder (@) {
my %params=@_;
my $form=$params{form};
@@ -103,9 +103,9 @@ sub formbuilder (@) { #{{{
}
}
}
-} #}}}
+}
-sub filltemplate ($$) { #{{{
+sub filltemplate ($$) {
my $template_page=shift;
my $page=shift;
@@ -136,6 +136,6 @@ sub filltemplate ($$) { #{{{
$template->param(name => $page);
return $template->output;
-} #}}}
+}
1
diff --git a/IkiWiki/Plugin/embed.pm b/IkiWiki/Plugin/embed.pm
index 2a1637392..664c95763 100644
--- a/IkiWiki/Plugin/embed.pm
+++ b/IkiWiki/Plugin/embed.pm
@@ -43,35 +43,35 @@ my $safehtml=qr{(
my @embedded;
-sub import { #{{{
+sub import {
hook(type => "getsetup", id => "embed", call => \&getsetup);
hook(type => "filter", id => "embed", call => \&filter);
-} # }}}
+}
-sub getsetup () { #{{{
+sub getsetup () {
return
plugin => {
safe => 1,
rebuild => undef,
},
-} #}}}
+}
-sub embed ($) { #{{{
+sub embed ($) {
hook(type => "format", id => "embed", call => \&format) unless @embedded;
push @embedded, shift;
return "";
-} #}}}
+}
-sub filter (@) { #{{{
+sub filter (@) {
my %params=@_;
$params{content} =~ s/$safehtml/embed($1)/eg;
return $params{content};
-} # }}}
+}
-sub format (@) { #{{{
+sub format (@) {
my %params=@_;
$params{content} =~ s/
<\/div>/$embedded[$1]/eg;
return $params{content};
-} # }}}
+}
1
diff --git a/IkiWiki/Plugin/external.pm b/IkiWiki/Plugin/external.pm
index 4ce9c8bab..2d540143f 100644
--- a/IkiWiki/Plugin/external.pm
+++ b/IkiWiki/Plugin/external.pm
@@ -14,7 +14,7 @@ use IO::Handle;
my %plugins;
-sub import { #{{{
+sub import {
my $self=shift;
my $plugin=shift;
return unless defined $plugin;
@@ -32,17 +32,17 @@ sub import { #{{{
$RPC::XML::ENCODING="utf-8";
rpc_call($plugins{$plugin}, "import");
-} #}}}
+}
-sub rpc_write ($$) { #{{{
+sub rpc_write ($$) {
my $fh=shift;
my $string=shift;
$fh->print($string."\n");
$fh->flush;
-} #}}}
+}
-sub rpc_call ($$;@) { #{{{
+sub rpc_call ($$;@) {
my $plugin=shift;
my $command=shift;
@@ -131,12 +131,12 @@ sub rpc_call ($$;@) { #{{{
}
return undef;
-} #}}}
+}
package IkiWiki::RPC::XML;
use Memoize;
-sub getvar ($$$) { #{{{
+sub getvar ($$$) {
my $plugin=shift;
my $varname="IkiWiki::".shift;
my $key=shift;
@@ -145,9 +145,9 @@ sub getvar ($$$) { #{{{
my $ret=$varname->{$key};
use strict 'refs';
return $ret;
-} #}}}
+}
-sub setvar ($$$;@) { #{{{
+sub setvar ($$$;@) {
my $plugin=shift;
my $varname="IkiWiki::".shift;
my $key=shift;
@@ -157,18 +157,18 @@ sub setvar ($$$;@) { #{{{
my $ret=$varname->{$key}=$value;
use strict 'refs';
return $ret;
-} #}}}
+}
-sub getstate ($$$$) { #{{{
+sub getstate ($$$$) {
my $plugin=shift;
my $page=shift;
my $id=shift;
my $key=shift;
return $IkiWiki::pagestate{$page}{$id}{$key};
-} #}}}
+}
-sub setstate ($$$$;@) { #{{{
+sub setstate ($$$$;@) {
my $plugin=shift;
my $page=shift;
my $id=shift;
@@ -176,22 +176,22 @@ sub setstate ($$$$;@) { #{{{
my $value=shift;
return $IkiWiki::pagestate{$page}{$id}{$key}=$value;
-} #}}}
+}
-sub getargv ($) { #{{{
+sub getargv ($) {
my $plugin=shift;
return \@ARGV;
-} #}}}
+}
-sub setargv ($@) { #{{{
+sub setargv ($@) {
my $plugin=shift;
my $array=shift;
@ARGV=@$array;
-} #}}}
+}
-sub inject ($@) { #{{{
+sub inject ($@) {
# Bind a given perl function name to a particular RPC request.
my $plugin=shift;
my %params=@_;
@@ -213,9 +213,9 @@ sub inject ($@) { #{{{
# the injected version.
IkiWiki::inject(name => $params{name}, call => $sub);
return 1;
-} #}}}
+}
-sub hook ($@) { #{{{
+sub hook ($@) {
# the call parameter is a function name to call, since XML RPC
# cannot pass a function reference
my $plugin=shift;
@@ -227,13 +227,13 @@ sub hook ($@) { #{{{
IkiWiki::hook(%params, call => sub {
IkiWiki::Plugin::external::rpc_call($plugin, $callback, @_);
});
-} #}}}
+}
-sub pagespec_match ($@) { #{{{
+sub pagespec_match ($@) {
# convert pagespec_match's return object into a XML RPC boolean
my $plugin=shift;
return RPC::XML::boolean->new(0 + IkiWiki::pagespec_march(@_));
-} #}}}
+}
1
diff --git a/IkiWiki/Plugin/favicon.pm b/IkiWiki/Plugin/favicon.pm
index e9204dea9..68359a4aa 100644
--- a/IkiWiki/Plugin/favicon.pm
+++ b/IkiWiki/Plugin/favicon.pm
@@ -7,20 +7,20 @@ use warnings;
use strict;
use IkiWiki 2.00;
-sub import { #{{{
+sub import {
hook(type => "getsetup", id => "favicon", call => \&getsetup);
hook(type => "pagetemplate", id => "favicon", call => \&pagetemplate);
-} # }}}
+}
-sub getsetup () { #{{{
+sub getsetup () {
return
plugin => {
safe => 1,
rebuild => 1,
},
-} #}}}
+}
-sub pagetemplate (@) { #{{{
+sub pagetemplate (@) {
my %params=@_;
my $template=$params{template};
@@ -28,6 +28,6 @@ sub pagetemplate (@) { #{{{
if ($template->query(name => "favicon")) {
$template->param(favicon => "favicon.ico");
}
-} # }}}
+}
1
diff --git a/IkiWiki/Plugin/filecheck.pm b/IkiWiki/Plugin/filecheck.pm
index 27f764e3b..5040a185c 100644
--- a/IkiWiki/Plugin/filecheck.pm
+++ b/IkiWiki/Plugin/filecheck.pm
@@ -37,9 +37,9 @@ my %units=( #{{{ # size in bytes
# ikiwiki, if you find you need larger data quantities, either modify
# yourself to add them, or travel back in time to 2008 and kill me.
# -- Joey
-); #}}}
+);
-sub parsesize ($) { #{{{
+sub parsesize ($) {
my $size=shift;
no warnings;
@@ -51,10 +51,10 @@ sub parsesize ($) { #{{{
}
}
return $base;
-} #}}}
+}
# This is provided for other plugins that want to convert back the other way.
-sub humansize ($) { #{{{
+sub humansize ($) {
my $size=shift;
foreach my $unit (reverse sort { $units{$a} <=> $units{$b} || $b cmp $a } keys %units) {
@@ -63,11 +63,11 @@ sub humansize ($) { #{{{
}
}
return $size; # near zero, or negative
-} #}}}
+}
package IkiWiki::PageSpec;
-sub match_maxsize ($$;@) { #{{{
+sub match_maxsize ($$;@) {
my $page=shift;
my $maxsize=eval{IkiWiki::Plugin::filecheck::parsesize(shift)};
if ($@) {
@@ -86,9 +86,9 @@ sub match_maxsize ($$;@) { #{{{
else {
return IkiWiki::SuccessReason->new("file not too large");
}
-} #}}}
+}
-sub match_minsize ($$;@) { #{{{
+sub match_minsize ($$;@) {
my $page=shift;
my $minsize=eval{IkiWiki::Plugin::filecheck::parsesize(shift)};
if ($@) {
@@ -107,9 +107,9 @@ sub match_minsize ($$;@) { #{{{
else {
return IkiWiki::SuccessReason->new("file not too small");
}
-} #}}}
+}
-sub match_mimetype ($$;@) { #{{{
+sub match_mimetype ($$;@) {
my $page=shift;
my $wanted=shift;
@@ -140,9 +140,9 @@ sub match_mimetype ($$;@) { #{{{
else {
return IkiWiki::SuccessReason->new("file MIME type is $mimetype");
}
-} #}}}
+}
-sub match_virusfree ($$;@) { #{{{
+sub match_virusfree ($$;@) {
my $page=shift;
my $wanted=shift;
@@ -182,9 +182,9 @@ sub match_virusfree ($$;@) { #{{{
else {
return IkiWiki::SuccessReason->new("file seems virusfree ($reason)");
}
-} #}}}
+}
-sub match_ispage ($$;@) { #{{{
+sub match_ispage ($$;@) {
my $filename=shift;
if (defined IkiWiki::pagetype($filename)) {
@@ -193,4 +193,4 @@ sub match_ispage ($$;@) { #{{{
else {
return IkiWiki::FailReason->new("file is not a wiki page");
}
-} #}}}
+}
diff --git a/IkiWiki/Plugin/format.pm b/IkiWiki/Plugin/format.pm
index 1e21a0bdc..b4d3a3c5f 100644
--- a/IkiWiki/Plugin/format.pm
+++ b/IkiWiki/Plugin/format.pm
@@ -5,11 +5,11 @@ use warnings;
use strict;
use IkiWiki 2.00;
-sub import { #{{{
+sub import {
hook(type => "preprocess", id => "format", call => \&preprocess);
-} #}}}
+}
-sub preprocess (@) { #{{{
+sub preprocess (@) {
my $format=$_[0];
shift; shift;
my $text=$_[0];
@@ -25,6 +25,6 @@ sub preprocess (@) { #{{{
return IkiWiki::htmlize($params{page}, $params{destpage}, $format,
IkiWiki::preprocess($params{page}, $params{destpage}, $text));
-} #}}}
+}
1
diff --git a/IkiWiki/Plugin/fortune.pm b/IkiWiki/Plugin/fortune.pm
index 456b63e9f..6a12f28fd 100644
--- a/IkiWiki/Plugin/fortune.pm
+++ b/IkiWiki/Plugin/fortune.pm
@@ -6,20 +6,20 @@ use warnings;
use strict;
use IkiWiki 2.00;
-sub import { #{{{
+sub import {
hook(type => "getsetup", id => "fortune", call => \&getsetup);
hook(type => "preprocess", id => "fortune", call => \&preprocess);
-} # }}}
+}
-sub getsetup () { #{{{
+sub getsetup () {
return
plugin => {
safe => 1,
rebuild => undef,
},
-} #}}}
+}
-sub preprocess (@) { #{{{
+sub preprocess (@) {
$ENV{PATH}="$ENV{PATH}:/usr/games:/usr/local/games";
my $f = `fortune 2>/dev/null`;
@@ -29,6 +29,6 @@ sub preprocess (@) { #{{{
else {
return "
$f
\n";
}
-} # }}}
+}
1
diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm
index 1a39d87e5..6a7f6c3ae 100644
--- a/IkiWiki/Plugin/git.pm
+++ b/IkiWiki/Plugin/git.pm
@@ -11,7 +11,7 @@ my $sha1_pattern = qr/[0-9a-fA-F]{40}/; # pattern to validate Git sha1sums
my $dummy_commit_msg = 'dummy commit'; # message to skip in recent changes
my $no_chdir=0;
-sub import { #{{{
+sub import {
hook(type => "checkconfig", id => "git", call => \&checkconfig);
hook(type => "getsetup", id => "git", call => \&getsetup);
hook(type => "rcs", id => "rcs_update", call => \&rcs_update);
@@ -25,9 +25,9 @@ sub import { #{{{
hook(type => "rcs", id => "rcs_diff", call => \&rcs_diff);
hook(type => "rcs", id => "rcs_getctime", call => \&rcs_getctime);
hook(type => "rcs", id => "rcs_receive", call => \&rcs_receive);
-} #}}}
+}
-sub checkconfig () { #{{{
+sub checkconfig () {
if (! defined $config{gitorigin_branch}) {
$config{gitorigin_branch}="origin";
}
@@ -49,9 +49,9 @@ sub checkconfig () { #{{{
wrappermode => (defined $config{git_wrappermode} ? $config{git_wrappermode} : "06755"),
};
}
-} #}}}
+}
-sub getsetup () { #{{{
+sub getsetup () {
return
plugin => {
safe => 0, # rcs plugin
@@ -113,9 +113,9 @@ sub getsetup () { #{{{
safe => 0, # paranoia
rebuild => 0,
},
-} #}}}
+}
-sub safe_git (&@) { #{{{
+sub safe_git (&@) {
# Start a child process safely without resorting /bin/sh.
# Return command output or success state (in scalar context).
@@ -152,9 +152,9 @@ sub safe_git (&@) { #{{{
sub run_or_die ($@) { safe_git(\&error, @_) }
sub run_or_cry ($@) { safe_git(sub { warn @_ }, @_) }
sub run_or_non ($@) { safe_git(undef, @_) }
-#}}}
-sub merge_past ($$$) { #{{{
+
+sub merge_past ($$$) {
# Unlike with Subversion, Git cannot make a 'svn merge -rN:M file'.
# Git merge commands work with the committed changes, except in the
# implicit case of '-m' of git checkout(1). So we should invent a
@@ -246,9 +246,9 @@ sub merge_past ($$$) { #{{{
error("Git merge failed!\n$failure\n") if $failure;
return $conflict;
-} #}}}
+}
-sub parse_diff_tree ($@) { #{{{
+sub parse_diff_tree ($@) {
# Parse the raw diff tree chunk and return the info hash.
# See git-diff-tree(1) for the syntax.
@@ -358,9 +358,9 @@ sub parse_diff_tree ($@) { #{{{
}
return \%ci;
-} #}}}
+}
-sub git_commit_info ($;$) { #{{{
+sub git_commit_info ($;$) {
# Return an array of commit info hashes of num commits
# starting from the given sha1sum.
my ($sha1, $num) = @_;
@@ -381,9 +381,9 @@ sub git_commit_info ($;$) { #{{{
warn "Cannot parse commit info for '$sha1' commit" if !@ci;
return wantarray ? @ci : $ci[0];
-} #}}}
+}
-sub git_sha1 (;$) { #{{{
+sub git_sha1 (;$) {
# Return head sha1sum (of given file).
my $file = shift || q{--};
@@ -394,25 +394,25 @@ sub git_sha1 (;$) { #{{{
($sha1) = $sha1 =~ m/($sha1_pattern)/; # sha1 is untainted now
} else { debug("Empty sha1sum for '$file'.") }
return defined $sha1 ? $sha1 : q{};
-} #}}}
+}
-sub rcs_update () { #{{{
+sub rcs_update () {
# Update working directory.
if (length $config{gitorigin_branch}) {
run_or_cry('git', 'pull', $config{gitorigin_branch});
}
-} #}}}
+}
-sub rcs_prepedit ($) { #{{{
+sub rcs_prepedit ($) {
# Return the commit sha1sum of the file when editing begins.
# This will be later used in rcs_commit if a merge is required.
my ($file) = @_;
return git_sha1($file);
-} #}}}
+}
-sub rcs_commit ($$$;$$) { #{{{
+sub rcs_commit ($$$;$$) {
# Try to commit the page; returns undef on _success_ and
# a version of the page with the rcs's conflict markers on
# failure.
@@ -431,7 +431,7 @@ sub rcs_commit ($$$;$$) { #{{{
rcs_add($file);
return rcs_commit_staged($message, $user, $ipaddr);
-} #}}}
+}
sub rcs_commit_staged ($$$) {
# Commits all staged changes. Changes can be staged using rcs_add,
@@ -472,29 +472,29 @@ sub rcs_commit_staged ($$$) {
return undef; # success
}
-sub rcs_add ($) { # {{{
+sub rcs_add ($) {
# Add file to archive.
my ($file) = @_;
run_or_cry('git', 'add', $file);
-} #}}}
+}
-sub rcs_remove ($) { # {{{
+sub rcs_remove ($) {
# Remove file from archive.
my ($file) = @_;
run_or_cry('git', 'rm', '-f', $file);
-} #}}}
+}
-sub rcs_rename ($$) { # {{{
+sub rcs_rename ($$) {
my ($src, $dest) = @_;
run_or_cry('git', 'mv', '-f', $src, $dest);
-} #}}}
+}
-sub rcs_recentchanges ($) { #{{{
+sub rcs_recentchanges ($) {
# List of recent changes.
my ($num) = @_;
@@ -562,9 +562,9 @@ sub rcs_recentchanges ($) { #{{{
}
return @rets;
-} #}}}
+}
-sub rcs_diff ($) { #{{{
+sub rcs_diff ($) {
my $rev=shift;
my ($sha1) = $rev =~ /^($sha1_pattern)$/; # untaint
my @lines;
@@ -579,9 +579,9 @@ sub rcs_diff ($) { #{{{
else {
return join("", @lines);
}
-} #}}}
+}
-sub rcs_getctime ($) { #{{{
+sub rcs_getctime ($) {
my $file=shift;
# Remove srcdir prefix
$file =~ s/^\Q$config{srcdir}\E\/?//;
@@ -592,9 +592,9 @@ sub rcs_getctime ($) { #{{{
debug("ctime for '$file': ". localtime($ctime));
return $ctime;
-} #}}}
+}
-sub rcs_receive () { #{{{
+sub rcs_receive () {
# The wiki may not be the only thing in the git repo.
# Determine if it is in a subdirectory by examining the srcdir,
# and its parents, looking for the .git directory.
@@ -685,6 +685,6 @@ sub rcs_receive () { #{{{
}
return reverse @rets;
-} #}}}
+}
1
diff --git a/IkiWiki/Plugin/goodstuff.pm b/IkiWiki/Plugin/goodstuff.pm
index a18e626d4..92bc8200a 100644
--- a/IkiWiki/Plugin/goodstuff.pm
+++ b/IkiWiki/Plugin/goodstuff.pm
@@ -24,19 +24,19 @@ my @bundle=qw{
toggle
};
-sub import { #{{{
+sub import {
hook(type => "getsetup", id => "goodstuff", call => \&getsetup);
foreach my $plugin (@bundle) {
IkiWiki::loadplugin($plugin);
}
-} # }}}
+}
-sub getsetup { #{{{
+sub getsetup {
return
plugin => {
safe => 1,
rebuild => undef,
},
-} #}}}
+}
1
diff --git a/IkiWiki/Plugin/google.pm b/IkiWiki/Plugin/google.pm
index 92b9b29eb..5394c5a6f 100644
--- a/IkiWiki/Plugin/google.pm
+++ b/IkiWiki/Plugin/google.pm
@@ -8,21 +8,21 @@ use URI;
my $host;
-sub import { #{{{
+sub import {
hook(type => "getsetup", id => "google", call => \&getsetup);
hook(type => "checkconfig", id => "google", call => \&checkconfig);
hook(type => "pagetemplate", id => "google", call => \&pagetemplate);
-} # }}}
+}
-sub getsetup () { #{{{
+sub getsetup () {
return
plugin => {
safe => 1,
rebuild => 1,
},
-} #}}}
+}
-sub checkconfig () { #{{{
+sub checkconfig () {
if (! length $config{url}) {
error(sprintf(gettext("Must specify %s when using the google search plugin"), "url"));
}
@@ -31,10 +31,10 @@ sub checkconfig () { #{{{
error(gettext("Failed to parse url, cannot determine domain name"));
}
$host=$uri->host;
-} #}}}
+}
my $form;
-sub pagetemplate (@) { #{{{
+sub pagetemplate (@) {
my %params=@_;
my $page=$params{page};
my $template=$params{template};
@@ -49,6 +49,6 @@ sub pagetemplate (@) { #{{{
$template->param(searchform => $form);
}
-} #}}}
+}
1
diff --git a/IkiWiki/Plugin/googlecalendar.pm b/IkiWiki/Plugin/googlecalendar.pm
index 81a3ad677..9e09d7dbb 100644
--- a/IkiWiki/Plugin/googlecalendar.pm
+++ b/IkiWiki/Plugin/googlecalendar.pm
@@ -5,24 +5,24 @@ use warnings;
use strict;
use IkiWiki 2.00;
-sub import { #{{{
+sub import {
hook(type => "getsetup", id => "googlecalendar",
call => \&getsetup);
hook(type => "preprocess", id => "googlecalendar",
call => \&preprocess);
hook(type => "format", id => "googlecalendar",
call => \&format);
-} # }}}
+}
-sub getsetup () { #{{{
+sub getsetup () {
return
plugin => {
safe => 1,
rebuild => undef,
},
-} #}}}
+}
-sub preprocess (@) { #{{{
+sub preprocess (@) {
my %params=@_;
# Parse the html, looking for the url to embed for the calendar.
@@ -35,21 +35,21 @@ sub preprocess (@) { #{{{
my ($width)=$params{html}=~m#width="(\d+)"#;
return "";
-} # }}}
+}
-sub format (@) { #{{{
+sub format (@) {
my %params=@_;
$params{content}=~s/
> Old versions of perl are known to have bugs with taint checking.
diff --git a/doc/bugs/quieten_mercurial.mdwn b/doc/bugs/quieten_mercurial.mdwn
index 26f833e5f..3fd75ea1b 100644
--- a/doc/bugs/quieten_mercurial.mdwn
+++ b/doc/bugs/quieten_mercurial.mdwn
@@ -6,7 +6,7 @@ messages which are then taken for CGI output, causing errors and general trouble
@@ -55,7 +55,7 @@
}
- sub rcs_update () { #{{{
+ sub rcs_update () {
- my @cmdline = ("hg", "-R", "$config{srcdir}", "update");
+ my @cmdline = ("hg", "-q", "-R", "$config{srcdir}", "update");
if (system(@cmdline) != 0) {
@@ -22,7 +22,7 @@ messages which are then taken for CGI output, causing errors and general trouble
if (system(@cmdline) != 0) {
warn "'@cmdline' failed: $!";
@@ -92,7 +92,7 @@
- sub rcs_add ($) { # {{{
+ sub rcs_add ($) {
my ($file) = @_;
- my @cmdline = ("hg", "-R", "$config{srcdir}", "add", "$file");
diff --git a/doc/bugs/search_for_locale_data_in_the_installed_location.mdwn b/doc/bugs/search_for_locale_data_in_the_installed_location.mdwn
index 0a2b1efea..dace2ca19 100644
--- a/doc/bugs/search_for_locale_data_in_the_installed_location.mdwn
+++ b/doc/bugs/search_for_locale_data_in_the_installed_location.mdwn
@@ -2,7 +2,7 @@ It seems like gettext only searches for locale information in /usr/share/locale,
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
- @@ -1057,6 +1057,7 @@ sub gettext { #{{{
+ @@ -1057,6 +1057,7 @@ sub gettext {
$gettext_obj=undef;
return shift;
}
diff --git a/doc/bugs/tbasewiki__95__brokenlinks.t_broken.mdwn b/doc/bugs/tbasewiki__95__brokenlinks.t_broken.mdwn
index ac895896a..db3917d21 100644
--- a/doc/bugs/tbasewiki__95__brokenlinks.t_broken.mdwn
+++ b/doc/bugs/tbasewiki__95__brokenlinks.t_broken.mdwn
@@ -25,12 +25,12 @@ After some digging I found that HTML::Template is being required after the new s
filter => sub {
my $text_ref = shift;
@@ -857,6 +856,7 @@
- } #}}}
+ }
- sub template ($;@) { #{{{
+ sub template ($;@) {
+ require HTML::Template;
HTML::Template->new(template_params(@_));
- } #}}}
+ }
**That** gave me:
diff --git a/doc/plugins/contrib/headinganchors.mdwn b/doc/plugins/contrib/headinganchors.mdwn
index ef2fa122a..c80cc0b49 100644
--- a/doc/plugins/contrib/headinganchors.mdwn
+++ b/doc/plugins/contrib/headinganchors.mdwn
@@ -12,9 +12,9 @@ rst and any other format that produces html. The code is available here:
use strict;
use IkiWiki 2.00;
- sub import { #{{{
+ sub import {
hook(type => "sanitize", id => "headinganchors", call => \&headinganchors);
- } # }}}
+ }
sub text_to_anchor {
my $str = shift;
@@ -26,11 +26,11 @@ rst and any other format that produces html. The code is available here:
return $str;
}
- sub headinganchors (@) { #{{{
+ sub headinganchors (@) {
my %params=@_;
my $content=$params{content};
$content=~s{([^>]*)}{''.$2.''}gie;
return $content;
- } # }}}
+ }
1
diff --git a/doc/plugins/contrib/siterel2pagerel.mdwn b/doc/plugins/contrib/siterel2pagerel.mdwn
index 956b6728f..9b09657bf 100644
--- a/doc/plugins/contrib/siterel2pagerel.mdwn
+++ b/doc/plugins/contrib/siterel2pagerel.mdwn
@@ -13,11 +13,11 @@ other format that produces html. The code is available here:
use strict;
use IkiWiki 2.00;
- sub import { #{{{
+ sub import {
hook(type => "sanitize", id => "siterel2pagerel", call => \&siterel2pagerel);
- } # }}}
+ }
- sub siterel2pagerel (@) { #{{{
+ sub siterel2pagerel (@) {
my %params=@_;
my $baseurl=IkiWiki::baseurl($params{page});
my $content=$params{content};
@@ -25,6 +25,6 @@ other format that produces html. The code is available here:
$content=~s/( "getsetup", id => "unixauth", call => \&getsetup);
hook(type => "formbuilder_setup", id => "unixauth",
call => \&formbuilder_setup);
hook(type => "formbuilder", id => "unixauth",
call => \&formbuilder);
hook(type => "sessioncgi", id => "unixauth", call => \&sessioncgi);
- } # }}}
+ }
- sub getsetup () { #{{{
+ sub getsetup () {
return
unixauth_type => {
type => "string",
@@ -83,10 +83,10 @@ __Security__: [As with passwordauth](/security/#index14h2), be wary of sending u
safe => 0,
rebuild => 1,
},
- } #}}}
+ }
# Checks if a string matches a user's password, and returns true or false.
- sub checkpassword ($$;$) { #{{{
+ sub checkpassword ($$;$) {
my $user=shift;
my $password=shift;
my $field=shift || "password";
@@ -131,9 +131,9 @@ __Security__: [As with passwordauth](/security/#index14h2), be wary of sending u
}
return $ret;
- } #}}}
+ }
- sub formbuilder_setup (@) { #{{{
+ sub formbuilder_setup (@) {
my %params=@_;
my $form=$params{form};
@@ -204,7 +204,7 @@ __Security__: [As with passwordauth](/security/#index14h2), be wary of sending u
}
}
- sub formbuilder (@) { #{{{
+ sub formbuilder (@) {
my %params=@_;
my $form=$params{form};
@@ -225,12 +225,12 @@ __Security__: [As with passwordauth](/security/#index14h2), be wary of sending u
my $user_name=$form->field('name');
}
}
- } #}}}
+ }
- sub sessioncgi ($$) { #{{{
+ sub sessioncgi ($$) {
my $q=shift;
my $session=shift;
- } #}}}
+ }
1
diff --git a/doc/todo/Add_DATE_parameter_for_use_in_templates.mdwn b/doc/todo/Add_DATE_parameter_for_use_in_templates.mdwn
index c908f57c8..8ecdf36d0 100644
--- a/doc/todo/Add_DATE_parameter_for_use_in_templates.mdwn
+++ b/doc/todo/Add_DATE_parameter_for_use_in_templates.mdwn
@@ -44,7 +44,7 @@ regenerate this one against that).
%config %links %renderedfiles %pagesources %destsources);
our $VERSION = 2.00; # plugin interface version, next is ikiwiki version
our $version="2.1";my $installdir="/usr";
- @@ -70,6 +70,7 @@ sub defaultconfig () { #{{{
+ @@ -70,6 +70,7 @@ sub defaultconfig () {
plugin => [qw{mdwn inline htmlscrubber passwordauth openid signinedit
lockedit conditional}],
timeformat => '%c',
@@ -52,27 +52,27 @@ regenerate this one against that).
locale => undef,
sslcookie => 0,
httpauth => 0,
- @@ -447,6 +448,15 @@ sub displaytime ($) { #{{{
+ @@ -447,6 +448,15 @@ sub displaytime ($) {
$config{timeformat}, localtime($time)));
- } #}}}
+ }
- +sub displaydate ($) { #{{{
+ +sub displaydate ($) {
+ my $time=shift;
+
+ # strftime doesn't know about encodings, so make sure
+ # its output is properly treated as utf8
+ return decode_utf8(POSIX::strftime(
+ $config{dateformat}, localtime($time)));
- +} #}}}
+ +}
+
- sub beautify_url ($) { #{{{
+ sub beautify_url ($) {
my $url=shift;
diff --git a/Plugin/inline.pm b/Plugin/inline.pm
index 8f6ab51..7bd6147 100644
--- a/Plugin/inline.pm
+++ b/Plugin/inline.pm
- @@ -148,6 +148,7 @@ sub preprocess_inline (@) { #{{{
+ @@ -148,6 +148,7 @@ sub preprocess_inline (@) {
$template->param(pageurl => urlto(bestlink($params{page}, $page), $params{destpage}));
$template->param(title => pagetitle(basename($page)));
$template->param(ctime => displaytime($pagectime{$page}));
diff --git a/doc/todo/Add_support_for_latest_Text::Markdown_as_found_on_CPAN.mdwn b/doc/todo/Add_support_for_latest_Text::Markdown_as_found_on_CPAN.mdwn
index 222cd8c46..6b9fa0535 100644
--- a/doc/todo/Add_support_for_latest_Text::Markdown_as_found_on_CPAN.mdwn
+++ b/doc/todo/Add_support_for_latest_Text::Markdown_as_found_on_CPAN.mdwn
@@ -12,7 +12,7 @@ This patch allows IkiWiki to work with either of the two:
--- IkiWiki/Plugin/mdwn.pm.orig 2008-03-08 11:33:50.000000000 +0100
+++ IkiWiki/Plugin/mdwn.pm 2008-03-08 13:37:21.000000000 +0100
- @@ -28,14 +28,20 @@ sub htmlize (@) { #{{{
+ @@ -28,14 +28,20 @@ sub htmlize (@) {
$markdown_sub=\&Markdown::Markdown;
}
else {
diff --git a/doc/todo/Allow_change_of_wiki_file_types.mdwn b/doc/todo/Allow_change_of_wiki_file_types.mdwn
index 8a398f2e0..19574b175 100644
--- a/doc/todo/Allow_change_of_wiki_file_types.mdwn
+++ b/doc/todo/Allow_change_of_wiki_file_types.mdwn
@@ -12,7 +12,7 @@ I was hoping that the [[plugins/rename]] plugin would allow web uses to change t
index 527ee88..123b772 100644
--- a/IkiWiki/Plugin/rename.pm
+++ b/IkiWiki/Plugin/rename.pm
- @@ -43,7 +43,7 @@ sub check_canrename ($$$$$$$) { #{{{
+ @@ -43,7 +43,7 @@ sub check_canrename ($$$$$$$) {
# Dest checks can be omitted by passing undef.
if (defined $dest) {
@@ -21,7 +21,7 @@ I was hoping that the [[plugins/rename]] plugin would allow web uses to change t
error(gettext("no change to the file name was specified"));
}
- @@ -54,7 +54,7 @@ sub check_canrename ($$$$$$$) { #{{{
+ @@ -54,7 +54,7 @@ sub check_canrename ($$$$$$$) {
}
# Must not be a known source file.
@@ -30,7 +30,7 @@ I was hoping that the [[plugins/rename]] plugin would allow web uses to change t
error(sprintf(gettext("%s already exists"),
htmllink("", "", $dest, noimageinline => 1)));
}
- @@ -97,6 +97,24 @@ sub rename_form ($$$) { #{{{
+ @@ -97,6 +97,24 @@ sub rename_form ($$$) {
$f->field(name => "do", type => "hidden", value => "rename", force => 1);
$f->field(name => "page", type => "hidden", value => $page, force => 1);
$f->field(name => "new_name", value => IkiWiki::pagetitle($page), size => 60);
@@ -55,7 +55,7 @@ I was hoping that the [[plugins/rename]] plugin would allow web uses to change t
$f->field(name => "attachment", type => "hidden");
return $f, ["Rename", "Cancel"];
- @@ -223,12 +241,19 @@ sub sessioncgi ($$) { #{{{
+ @@ -223,12 +241,19 @@ sub sessioncgi ($$) {
my $dest=IkiWiki::possibly_foolish_untaint(IkiWiki::titlepage($q->param("new_name")));
# The extension of dest is the same as src if it's
diff --git a/doc/todo/Allow_edittemplate_to_set_file_type.mdwn b/doc/todo/Allow_edittemplate_to_set_file_type.mdwn
index b49968c18..1b99a4e05 100644
--- a/doc/todo/Allow_edittemplate_to_set_file_type.mdwn
+++ b/doc/todo/Allow_edittemplate_to_set_file_type.mdwn
@@ -14,7 +14,7 @@ edittemplate there. --[[Joey]]
index 98308de..c381940 100644
--- a/IkiWiki/Plugin/edittemplate.pm
+++ b/IkiWiki/Plugin/edittemplate.pm
- @@ -56,8 +56,14 @@ sub preprocess (@) { #{{{
+ @@ -56,8 +56,14 @@ sub preprocess (@) {
$pagestate{$params{page}}{edittemplate}{$params{match}}=$params{template};
@@ -28,10 +28,10 @@ edittemplate there. --[[Joey]]
+
+ return sprintf(gettext("edittemplate: %s registered for %s"),
+ $linkHTML, $params{match});
- } # }}}
+ }
- sub formbuilder (@) { #{{{
- @@ -89,6 +95,9 @@ sub formbuilder (@) { #{{{
+ sub formbuilder (@) {
+ @@ -89,6 +95,9 @@ sub formbuilder (@) {
if (pagespec_match($p, $pagespec, location => $registering_page)) {
$form->field(name => "editcontent",
value => filltemplate($pagestate{$registering_page}{edittemplate}{$pagespec}, $page));
diff --git a/doc/todo/Bestdir_along_with_bestlink_in_IkiWiki.pm.mdwn b/doc/todo/Bestdir_along_with_bestlink_in_IkiWiki.pm.mdwn
index 73157a326..95c38f794 100644
--- a/doc/todo/Bestdir_along_with_bestlink_in_IkiWiki.pm.mdwn
+++ b/doc/todo/Bestdir_along_with_bestlink_in_IkiWiki.pm.mdwn
@@ -8,9 +8,9 @@ This patch adds function bestdir() which returns best directory from the directo
+++ IkiWiki.pm (working copy)
@@ -391,6 +391,35 @@
return "";
- } #}}}
+ }
- +sub bestdir ($$) { #{{{
+ +sub bestdir ($$) {
+ my $page=shift;
+ my $link=shift;
+ my $cwd=$page;
@@ -37,9 +37,9 @@ This patch adds function bestdir() which returns best directory from the directo
+ }
+
+ return "";
- +} #}}}
+ +}
+
- sub isinlinableimage ($) { #{{{
+ sub isinlinableimage ($) {
my $file=shift;
----
diff --git a/doc/todo/Default_text_for_new_pages.mdwn b/doc/todo/Default_text_for_new_pages.mdwn
index 4a17bbf8b..a904f8287 100644
--- a/doc/todo/Default_text_for_new_pages.mdwn
+++ b/doc/todo/Default_text_for_new_pages.mdwn
@@ -15,7 +15,7 @@ Inline below is a [[patch]] that implements this:
index bb21ed2..10c985c 100644
--- a/IkiWiki/Plugin/editpage.pm
+++ b/IkiWiki/Plugin/editpage.pm
- @@ -60,7 +60,7 @@ sub cgi_editpage ($$) { #{{{
+ @@ -60,7 +60,7 @@ sub cgi_editpage ($$) {
decode_cgi_utf8($q);
@@ -24,7 +24,7 @@ Inline below is a [[patch]] that implements this:
my @buttons=("Save Page", "Preview", "Cancel");
eval q{use CGI::FormBuilder};
error($@) if $@;
- @@ -117,9 +117,20 @@ sub cgi_editpage ($$) { #{{{
+ @@ -117,9 +117,20 @@ sub cgi_editpage ($$) {
}
else {
$type=$form->param('type');
@@ -45,7 +45,7 @@ Inline below is a [[patch]] that implements this:
elsif (defined $from && exists $pagesources{$from}) {
# favor the type of linking page
$type=pagetype($pagesources{$from});
- @@ -129,7 +140,7 @@ sub cgi_editpage ($$) { #{{{
+ @@ -129,7 +140,7 @@ sub cgi_editpage ($$) {
if (! $form->submitted) {
$form->field(name => "rcsinfo", value => "", force => 1);
}
@@ -58,7 +58,7 @@ Inline below is a [[patch]] that implements this:
index 8efef3f..075d7d8 100644
--- a/IkiWiki/Plugin/inline.pm
+++ b/IkiWiki/Plugin/inline.pm
- @@ -271,6 +271,7 @@ sub preprocess_inline (@) { #{{{
+ @@ -271,6 +271,7 @@ sub preprocess_inline (@) {
$rootpage=$params{page};
}
$formtemplate->param(rootpage => $rootpage);
diff --git a/doc/todo/Give_access_to_more_TMPL__95__VAR_variables_in_templates_inserted_by_the_template_plugin.mdwn b/doc/todo/Give_access_to_more_TMPL__95__VAR_variables_in_templates_inserted_by_the_template_plugin.mdwn
index a644e236b..c71250b3a 100644
--- a/doc/todo/Give_access_to_more_TMPL__95__VAR_variables_in_templates_inserted_by_the_template_plugin.mdwn
+++ b/doc/todo/Give_access_to_more_TMPL__95__VAR_variables_in_templates_inserted_by_the_template_plugin.mdwn
@@ -94,7 +94,7 @@ most possible of these pages.
> index a6e34fc..bb9dd8d 100644
> --- a/IkiWiki/Plugin/template.pm
> +++ b/IkiWiki/Plugin/template.pm
-> @@ -57,6 +57,8 @@ sub preprocess (@) { #{{{
+> @@ -57,6 +57,8 @@ sub preprocess (@) {
> }
> }
>
diff --git a/doc/todo/Inline_plugin_option_to_show_full_page_path.mdwn b/doc/todo/Inline_plugin_option_to_show_full_page_path.mdwn
index 9f52a724a..691694009 100644
--- a/doc/todo/Inline_plugin_option_to_show_full_page_path.mdwn
+++ b/doc/todo/Inline_plugin_option_to_show_full_page_path.mdwn
@@ -19,7 +19,7 @@ Cheers,
index 59eabb6..82913ba 100644
--- a/IkiWiki/Plugin/inline.pm
+++ b/IkiWiki/Plugin/inline.pm
- @@ -229,6 +229,7 @@ sub preprocess_inline (@) { #{{{
+ @@ -229,6 +229,7 @@ sub preprocess_inline (@) {
$template->param(content => $content);
}
$template->param(pageurl => urlto(bestlink($params{page}, $page), $params{destpage}));
diff --git a/doc/todo/Move_teximg_latex_preamble_to_config_file.mdwn b/doc/todo/Move_teximg_latex_preamble_to_config_file.mdwn
index d94d24ee4..3cedd5ae3 100644
--- a/doc/todo/Move_teximg_latex_preamble_to_config_file.mdwn
+++ b/doc/todo/Move_teximg_latex_preamble_to_config_file.mdwn
@@ -71,10 +71,10 @@ Happy TeXing.
+
+my $default_postfix = '\\end{document}';
+
- sub import { #{{{
+ sub import {
hook(type => "getsetup", id => "teximg", call => \&getsetup);
hook(type => "preprocess", id => "teximg", call => \&preprocess);
- @@ -21,6 +33,26 @@ sub getsetup () { #{{{
+ @@ -21,6 +33,26 @@ sub getsetup () {
safe => 1,
rebuild => undef,
},
@@ -98,10 +98,10 @@ Happy TeXing.
+ safe => 0, # Not sure how secure LaTeX is...
+ rebuild => 1,
+ },
- } #}}}
+ }
- sub preprocess (@) { #{{{
- @@ -105,25 +137,35 @@ sub gen_image ($$$$) { #{{{
+ sub preprocess (@) {
+ @@ -105,25 +137,35 @@ sub gen_image ($$$$) {
my $digest = shift;
my $imagedir = shift;
diff --git a/doc/todo/Set_arbitrary_date_to_be_used_by_calendar_plugin.mdwn b/doc/todo/Set_arbitrary_date_to_be_used_by_calendar_plugin.mdwn
index a26433919..89167c084 100644
--- a/doc/todo/Set_arbitrary_date_to_be_used_by_calendar_plugin.mdwn
+++ b/doc/todo/Set_arbitrary_date_to_be_used_by_calendar_plugin.mdwn
@@ -42,13 +42,13 @@ Longer term plans:
my %cache;
my %linkcache;
@@ -32,6 +34,7 @@
- sub import { #{{{
+ sub import {
hook(type => "needsbuild", id => "version", call => \&needsbuild);
hook(type => "preprocess", id => "calendar", call => \&preprocess);
+ hook(type => "preprocess", id => "event", call => \&preprocess_event);
- } #}}}
+ }
- sub is_leap_year (@) { #{{{
+ sub is_leap_year (@) {
@@ -58,6 +61,7 @@
my $nmonth = $params{nmonth};
my $pyear = $params{pyear};
@@ -137,9 +137,9 @@ Longer term plans:
# finish off the week
@@ -304,6 +333,18 @@
return $calendar;
- } #}}}
+ }
- +sub preprocess_event (@) { #{{{
+ +sub preprocess_event (@) {
+ my %params=@_;
+ # if now time is given, use now
+ $params{begin} = localtime($time) unless defined $params{begin};
@@ -151,7 +151,7 @@ Longer term plans:
+ return "";
+} #}}
+
- sub preprocess (@) { #{{{
+ sub preprocess (@) {
my %params=@_;
$params{pages} = "*" unless defined $params{pages};
@@ -311,6 +352,8 @@
diff --git a/doc/todo/Silence_monotone_warning.mdwn b/doc/todo/Silence_monotone_warning.mdwn
index e3f0224c2..d875900c5 100644
--- a/doc/todo/Silence_monotone_warning.mdwn
+++ b/doc/todo/Silence_monotone_warning.mdwn
@@ -4,7 +4,7 @@ A quick [[patch]] to silence a [[rcs/monotone]] warning I started seeing:
index 4b9be31..9d4e280 100644
--- a/IkiWiki/Plugin/monotone.pm
+++ b/IkiWiki/Plugin/monotone.pm
- @@ -55,7 +55,7 @@ sub checkconfig () { #{{{
+ @@ -55,7 +55,7 @@ sub checkconfig () {
error("Monotone version too old, is $version but required 0.38");
}
diff --git a/doc/todo/Support_wildcard_inside_of_link__40____41___within_a_pagespec.mdwn b/doc/todo/Support_wildcard_inside_of_link__40____41___within_a_pagespec.mdwn
index 2837634d9..8320f72a6 100644
--- a/doc/todo/Support_wildcard_inside_of_link__40____41___within_a_pagespec.mdwn
+++ b/doc/todo/Support_wildcard_inside_of_link__40____41___within_a_pagespec.mdwn
@@ -20,7 +20,7 @@ That doesn't work in ikiwiki 2.1, but I have it
index 38aa46a..cd42e8d 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
- @@ -1082,10 +1082,15 @@ sub match_link ($$;@) { #{{{
+ @@ -1082,10 +1082,15 @@ sub match_link ($$;@) {
my $links = $IkiWiki::links{$page} or return undef;
return IkiWiki::FailReason->new("$page has no links") unless @$links;
my $bestlink = IkiWiki::bestlink($from, $link);
@@ -38,7 +38,7 @@ That doesn't work in ikiwiki 2.1, but I have it
+ }
}
return IkiWiki::FailReason->new("$page does not link to $link");
- } #}}}
+ }
--
1.5.1.1.g6aead
diff --git a/doc/todo/Wrapper_config_with_multiline_regexp.mdwn b/doc/todo/Wrapper_config_with_multiline_regexp.mdwn
index c0311bc92..7b4323de1 100644
--- a/doc/todo/Wrapper_config_with_multiline_regexp.mdwn
+++ b/doc/todo/Wrapper_config_with_multiline_regexp.mdwn
@@ -13,12 +13,12 @@ Second, the untainting of $configstring should allow newlines.
+++ wiki-meta/perl/IkiWiki.pm Mon Jun 11 10:52:07 2007
@@ -205,7 +205,7 @@
- sub possibly_foolish_untaint ($) { #{{{
+ sub possibly_foolish_untaint ($) {
my $tainted=shift;
- my ($untainted)=$tainted=~/(.*)/;
+ my ($untainted)=$tainted=~/(.*)/s;
return $untainted;
- } #}}}
+ }
Modified: wiki-meta/perl/IkiWiki/Wrapper.pm
diff --git a/doc/todo/add_forward_age_sorting_option_to_inline.mdwn b/doc/todo/add_forward_age_sorting_option_to_inline.mdwn
index 684419f90..e91c5a42f 100644
--- a/doc/todo/add_forward_age_sorting_option_to_inline.mdwn
+++ b/doc/todo/add_forward_age_sorting_option_to_inline.mdwn
@@ -19,7 +19,7 @@ diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm
index d2e5832..9e52712 100644
--- a/IkiWiki/Plugin/inline.pm
+++ b/IkiWiki/Plugin/inline.pm
-@@ -194,6 +194,9 @@ sub preprocess_inline (@) { #{{{
+@@ -194,6 +194,9 @@ sub preprocess_inline (@) {
elsif (! exists $params{sort} || $params{sort} eq 'age') {
@list=sort { $pagectime{$b} <=> $pagectime{$a} } @list;
}
diff --git a/doc/todo/automatic_use_of_syntax_plugin_on_source_code_files/discussion.mdwn b/doc/todo/automatic_use_of_syntax_plugin_on_source_code_files/discussion.mdwn
index 467ec350e..dc6c0001e 100644
--- a/doc/todo/automatic_use_of_syntax_plugin_on_source_code_files/discussion.mdwn
+++ b/doc/todo/automatic_use_of_syntax_plugin_on_source_code_files/discussion.mdwn
@@ -17,13 +17,13 @@ Updated to use fix noted in [[bugs/multiple_pages_with_same_name]].
my %metaheaders;
- sub import { #{{{
+ sub import {
hook(type => "getsetup", id => "sourcecode", call => \&getsetup);
hook(type => "checkconfig", id => "sourcecode", call => \&checkconfig);
hook(type => "pagetemplate", id => "sourcecode", call => \&pagetemplate);
- } # }}}
+ }
- sub getsetup () { #{{{
+ sub getsetup () {
return
plugin => {
safe => 1,
@@ -57,9 +57,9 @@ Updated to use fix noted in [[bugs/multiple_pages_with_same_name]].
safe => 1,
rebuild => 1,
},
- } #}}}
+ }
- sub checkconfig () { #{{{
+ sub checkconfig () {
if (! $config{sourcecode_lang}) {
error("The sourcecode plugin requires a list of suffixes in the 'sourcecode_lang' config option");
}
@@ -97,9 +97,9 @@ Updated to use fix noted in [[bugs/multiple_pages_with_same_name]].
error("Your installation of source-highlight cannot handle sourcecode language $lang!");
}
}
- } #}}}
+ }
- sub htmlize (@) { #{{{
+ sub htmlize (@) {
my %params=@_;
my $page = $params{page};
@@ -141,9 +141,9 @@ Updated to use fix noted in [[bugs/multiple_pages_with_same_name]].
}
return '
'."\r\n".join("\r\n",@html)."\r\n
\n";
- } # }}}
+ }
- sub pagetemplate (@) { #{{{
+ sub pagetemplate (@) {
my %params=@_;
my $page=$params{page};
@@ -154,6 +154,6 @@ Updated to use fix noted in [[bugs/multiple_pages_with_same_name]].
my %seen;
$template->param(meta => join("\n", grep { (! $seen{$_}) && ($seen{$_}=1) } @{$metaheaders{$page}}));
}
- } # }}}
+ }
1
diff --git a/doc/todo/blogpost_plugin.mdwn b/doc/todo/blogpost_plugin.mdwn
index 60b1e2515..bb91ffd02 100644
--- a/doc/todo/blogpost_plugin.mdwn
+++ b/doc/todo/blogpost_plugin.mdwn
@@ -51,13 +51,13 @@ Index: IkiWiki/Plugin/blogpost.pm
+use POSIX;
+use IkiWiki 2.00;
+
-+sub import { #{{{
++sub import {
+ hook(type => "checkconfig", id => "blogpost", call => \&checkconfig);
+ hook(type => "authcgi", id => "blogpost", call => \&authcgi);
+ hook(type => "canedit", id => "blogpost", call => \&canedit);
-+} # }}}
++}
+
-+sub checkconfig () { #{{{
++sub checkconfig () {
+ if (! defined $config{blogformat}){
+ $config{blogformat} = 'posts/%Y/%m/%d/$title';
+ }
@@ -72,9 +72,9 @@ Index: IkiWiki/Plugin/blogpost.pm
+ if (! defined $config{blogusers}) {
+ $config{blogusers} = (); # disallow all posting by default
+ }
-+} #}}}
++}
+
-+sub authcgi ($$) { #{{{
++sub authcgi ($$) {
+ my $cgi=shift;
+ my $session=shift;
+
@@ -115,16 +115,16 @@ Index: IkiWiki/Plugin/blogpost.pm
+ $cgi->param("page", $page);
+ }
+
-+} #}}}
++}
+
-+sub blogpage ($) { #{{{
++sub blogpage ($) {
+ my $title=shift;
+ my $page=POSIX::strftime $config{blogformat}, localtime;
+ $page =~ s/\$title/$title/;
+ return $page;
-+} #}}}
++}
+
-+sub canedit ($$$) { #{{{
++sub canedit ($$$) {
+ my $page=shift;
+ my $cgi=shift;
+ my $session=shift;
@@ -136,7 +136,7 @@ Index: IkiWiki/Plugin/blogpost.pm
+ return "" if ($config{blogusers} eq "*" ||
+ grep {$_ eq $user} $config{blogusers});
+ return ("not allowed to blog, $user");
-+} #}}}
++}
+
+1
Index: IkiWiki.pm
diff --git a/doc/todo/bzr.mdwn b/doc/todo/bzr.mdwn
index 179ea2f24..a50c58d26 100644
--- a/doc/todo/bzr.mdwn
+++ b/doc/todo/bzr.mdwn
@@ -56,15 +56,15 @@ and rcs_getctime and rcs_notify aren't written at all. --[[bma]]
return @ret;
}
- sub rcs_update () { #{{{
+ sub rcs_update () {
# Not needed.
- } #}}}
+ }
- sub rcs_prepedit ($) { #{{{
+ sub rcs_prepedit ($) {
return "";
- } #}}}
+ }
- sub rcs_commit ($$$;$$) { #{{{
+ sub rcs_commit ($$$;$$) {
my ($file, $message, $rcstoken, $user, $ipaddr) = @_;
if (defined $user) {
@@ -95,18 +95,18 @@ and rcs_getctime and rcs_notify aren't written at all. --[[bma]]
system("bzr","whoami",$olduser);
return undef; # success
- } #}}}
+ }
- sub rcs_add ($) { # {{{
+ sub rcs_add ($) {
my ($file) = @_;
my @cmdline = ("bzr", "add", "--quiet", "$config{srcdir}/$file");
if (system(@cmdline) != 0) {
warn "'@cmdline' failed: $!";
}
- } #}}}
+ }
- sub rcs_recentchanges ($) { #{{{
+ sub rcs_recentchanges ($) {
my ($num) = @_;
eval q{use CGI 'escapeHTML'};
@@ -153,15 +153,15 @@ and rcs_getctime and rcs_notify aren't written at all. --[[bma]]
}
return @ret;
- } #}}}
+ }
- sub rcs_notify () { #{{{
+ sub rcs_notify () {
# TODO
- } #}}}
+ }
- sub rcs_getctime ($) { #{{{
+ sub rcs_getctime ($) {
# TODO
- } #}}}
+ }
1
diff --git a/doc/todo/cas_authentication.mdwn b/doc/todo/cas_authentication.mdwn
index c8ffe7005..8bf7042df 100644
--- a/doc/todo/cas_authentication.mdwn
+++ b/doc/todo/cas_authentication.mdwn
@@ -43,11 +43,11 @@ follows) ?
> the use of it: `eval q{use AuthCAS}; error $@ if $@`
+
- +sub import { #{{{
+ +sub import {
+ hook(type => "getopt", id => "cas", call => \&getopt);
+ hook(type => "auth", id => "cas", call => \&auth);
+ hook(type => "formbuilder_setup", id => "cas", call => \&formbuilder_setup);
- +} # }}}
+ +}
> Could you please use tabs for indentation of program flow?
@@ -61,15 +61,15 @@ follows) ?
> Why would you want to make other auth plugins not work? Could a site not
> legitimatly chose to use this and another auth method?
- +sub getopt () { #{{{
+ +sub getopt () {
+ eval q{use Getopt::Long};
+ error($@) if $@;
+ Getopt::Long::Configure('pass_through');
+ GetOptions("cas_url=s" => \$config{cas_url});
+ GetOptions("ca_file=s" => \$config{ca_file});
- +} #}}}
+ +}
+
- +sub auth ($$) { #{{{
+ +sub auth ($$) {
+ my $q=shift;
+ my $session=shift;
+
@@ -98,11 +98,11 @@ follows) ?
+ error("CAS failure: ".&AuthCAS::get_errors());
+ }
+ }
- +} #}}}
+ +}
+
+# I use formbuilder_setup and not formbuilder type in order to bypass the
+# Logout processing done in IkiWiki::CGI::cgi_prefs()
- +sub formbuilder_setup (@) { #{{{
+ +sub formbuilder_setup (@) {
+ my %params=@_;
+
+ my $form=$params{form};
diff --git a/doc/todo/color_plugin.mdwn b/doc/todo/color_plugin.mdwn
index 69afe837d..19fba3b35 100644
--- a/doc/todo/color_plugin.mdwn
+++ b/doc/todo/color_plugin.mdwn
@@ -132,12 +132,12 @@ Of course, I'm open for discussion or exchange of ideas :) --[[Paweł|ptecza]]
+use strict;
+use IkiWiki 2.00;
+
- +sub import { #{{{
+ +sub import {
+ hook(type => "preprocess", id => "color", call => \&preprocess);
+ hook(type => "format", id => "color", call => \&format);
- +} #}}}
+ +}
+
- +sub preserve_style ($$$) { #{{{
+ +sub preserve_style ($$$) {
+ my $foreground = shift;
+ my $background = shift;
+ my $text = shift;
@@ -162,18 +162,18 @@ Of course, I'm open for discussion or exchange of ideas :) --[[Paweł|ptecza]]
+
+ return $preserved;
+
- +} #}}}
+ +}
+
- +sub replace_preserved_style ($) { #{{{
+ +sub replace_preserved_style ($) {
+ my $content = shift;
+
+ $content =~ s!((color: ([a-z]+|\#[0-9a-f]{3,6})?)?((; )?(background-color: ([a-z]+|\#[0-9a-f]{3,6})?)?)?)!!g;
+ $content =~ s!!!g;
+
+ return $content;
- +} #}}}
+ +}
+
- +sub preprocess (@) { #{{{
+ +sub preprocess (@) {
+ my %params = @_;
+
+ # Preprocess the text to expand any preprocessor directives
@@ -182,14 +182,14 @@ Of course, I'm open for discussion or exchange of ideas :) --[[Paweł|ptecza]]
+ IkiWiki::filter($params{page}, $params{destpage}, $params{text}));
+
+ return preserve_style($params{foreground}, $params{background}, $params{text});
- +} #}}}
+ +}
+
- +sub format (@) { #{{{
+ +sub format (@) {
+ my %params = @_;
+
+ $params{content} = replace_preserved_style($params{content});
+ return $params{content};
- +} #}}}
+ +}
+
+1
--- /dev/null 2008-06-21 02:02:15.000000000 +0200
diff --git a/doc/todo/darcs.mdwn b/doc/todo/darcs.mdwn
index e5bf5ee27..882a41379 100644
--- a/doc/todo/darcs.mdwn
+++ b/doc/todo/darcs.mdwn
@@ -219,14 +219,14 @@ This is my ([bma](bma@bmalee.eu)) darcs.pm - it's messy (my Perl isn't up to muc
package IkiWiki;
- sub rcs_update () { #{{{
+ sub rcs_update () {
# Do nothing - there's nowhere to update *from*.
- } #}}}
+ }
- sub rcs_prepedit ($) { #{{{
- } #}}}
+ sub rcs_prepedit ($) {
+ }
- sub rcs_commit ($$$;$$) { #{{{
+ sub rcs_commit ($$$;$$) {
my ($file, $message, $rcstoken, $user, $ipaddr) = @_;
# $user should probably be a name and an email address, by darcs
@@ -257,16 +257,16 @@ This is my ([bma](bma@bmalee.eu)) darcs.pm - it's messy (my Perl isn't up to muc
return undef; # success
- sub rcs_add ($) { # {{{
+ sub rcs_add ($) {
my ($file) = @_;
my @cmdline = ("darcs", "add", "--repodir", "$config{srcdir}", "-a", "-q", "$file");
if (system(@cmdline) != 0) {
warn "'@cmdline' failed: $!";
}
- } #}}}
+ }
- sub rcs_recentchanges ($) { #{{{
+ sub rcs_recentchanges ($) {
# TODO: This is horrible code. It doesn't work perfectly, and uses regexes
# rather than parsing Darcs' XML output.
my $num=shift;
@@ -314,15 +314,15 @@ This is my ([bma](bma@bmalee.eu)) darcs.pm - it's messy (my Perl isn't up to muc
}
}
return @ret;
- } #}}}
+ }
- sub rcs_notify () { #{{{
+ sub rcs_notify () {
# TODO
- } #}}}
+ }
- sub rcs_getctime ($) { #{{{
+ sub rcs_getctime ($) {
error gettext("getctime not implemented");
- } #}}}
+ }
1
diff --git a/doc/todo/datearchives-plugin.mdwn b/doc/todo/datearchives-plugin.mdwn
index 5a5560d6c..5f33cde4c 100644
--- a/doc/todo/datearchives-plugin.mdwn
+++ b/doc/todo/datearchives-plugin.mdwn
@@ -17,11 +17,11 @@ Index: IkiWiki/Plugin/datearchives.pm
+use strict;
+use IkiWiki;
+
-+sub import { #{{{
++sub import {
+ hook(type => "pagetemplate", id => "datearchives", call => \&pagetemplate, scan => 1);
-+} # }}}
++}
+
-+sub pagetemplate (@) { #{{{
++sub pagetemplate (@) {
+ my %args = @_;
+ my $dt;
+ eval {
@@ -37,7 +37,7 @@ Index: IkiWiki/Plugin/datearchives.pm
+ $template->param(ctime => htmllink( $args{page}, $args{destpage}, $link, 0, 0,
+ $template->param('ctime')));
+ }
-+} # }}}
++}
+
+1
diff --git a/doc/todo/different_search_engine.mdwn b/doc/todo/different_search_engine.mdwn
index 2f309dea5..9d0fc92c9 100644
--- a/doc/todo/different_search_engine.mdwn
+++ b/doc/todo/different_search_engine.mdwn
@@ -126,7 +126,7 @@ Index: IkiWiki/Plugin/search.pm
+ $PLUCENE_DIR = $config{wikistatedir}.'/plucene';
+}
+
- sub import { #{{{
+ sub import {
- hook(type => "getopt", id => "hyperestraier",
- call => \&getopt);
- hook(type => "checkconfig", id => "hyperestraier",
@@ -142,14 +142,14 @@ Index: IkiWiki/Plugin/search.pm
call => \&change);
- hook(type => "cgi", id => "hyperestraier",
- call => \&cgi);
- } # }}}
+ }
--sub getopt () { #{{{
+-sub getopt () {
- eval q{use Getopt::Long};
- error($@) if $@;
- Getopt::Long::Configure('pass_through');
- GetOptions("estseek=s" => \$config{estseek});
--} #}}}
+-}
+sub writer {
+ init();
@@ -165,20 +165,20 @@ Index: IkiWiki/Plugin/search.pm
+ grep { defined pagetype($_) } @_;
+}
+
- sub checkconfig () { #{{{
+ sub checkconfig () {
foreach my $required (qw(url cgiurl)) {
if (! length $config{$required}) {
@@ -36,112 +58,55 @@
}
- } #}}}
+ }
-my $form;
--sub pagetemplate (@) { #{{{
+-sub pagetemplate (@) {
- my %params=@_;
- my $page=$params{page};
- my $template=$params{template};
+#my $form;
-+#sub pagetemplate (@) { #{{{
++#sub pagetemplate (@) {
+# my %params=@_;
+# my $page=$params{page};
+# my $template=$params{template};
@@ -193,7 +193,7 @@ Index: IkiWiki/Plugin/search.pm
+#
+# $template->param(searchform => $form);
+# }
-+#} #}}}
++#}
- # Add search box to page header.
- if ($template->query(name => "searchform")) {
@@ -205,9 +205,9 @@ Index: IkiWiki/Plugin/search.pm
-
- $template->param(searchform => $form);
- }
--} #}}}
+-}
-
- sub delete (@) { #{{{
+ sub delete (@) {
- debug(gettext("cleaning hyperestraier search index"));
- estcmd("purge -cl");
- estcfg();
@@ -219,9 +219,9 @@ Index: IkiWiki/Plugin/search.pm
+ $reader->delete_term( Plucene::Index::Term->new({ field => "id", text => $_ }));
+ }
+ $reader->close;
- } #}}}
+ }
- sub change (@) { #{{{
+ sub change (@) {
- debug(gettext("updating hyperestraier search index"));
- estcmd("gather -cm -bc -cl -sd",
- map {
@@ -250,9 +250,9 @@ Index: IkiWiki/Plugin/search.pm
+ $doc->add(Plucene::Document::Field->UnStored('text' => $data));
+ $writer->add_document($doc);
+ }
- } #}}}
+ }
-
--sub cgi ($) { #{{{
+-sub cgi ($) {
- my $cgi=shift;
-
- if (defined $cgi->param('phrase') || defined $cgi->param("navi")) {
@@ -260,10 +260,10 @@ Index: IkiWiki/Plugin/search.pm
- chdir("$config{wikistatedir}/hyperestraier") || error("chdir: $!");
- exec("./".IkiWiki::basename($config{cgiurl})) || error("estseek.cgi failed");
- }
--} #}}}
+-}
-
-my $configured=0;
--sub estcfg () { #{{{
+-sub estcfg () {
- return if $configured;
- $configured=1;
-
@@ -301,9 +301,9 @@ Index: IkiWiki/Plugin/search.pm
- unlink($cgi);
- my $estseek = defined $config{estseek} ? $config{estseek} : '/usr/lib/estraier/estseek.cgi';
- symlink($estseek, $cgi) || error("symlink $estseek $cgi: $!");
--} # }}}
+-}
-
--sub estcmd ($;@) { #{{{
+-sub estcmd ($;@) {
- my @params=split(' ', shift);
- push @params, "-cl", "$config{wikistatedir}/hyperestraier";
- if (@_) {
@@ -323,7 +323,7 @@ Index: IkiWiki/Plugin/search.pm
- open(STDOUT, "/dev/null"); # shut it up (closing won't work)
- exec("estcmd", @params) || error("can't run estcmd");
- }
--} #}}}
+-}
-
-1
+1;
diff --git a/doc/todo/directive_docs.mdwn b/doc/todo/directive_docs.mdwn
index 1f6307381..2baa61b40 100644
--- a/doc/todo/directive_docs.mdwn
+++ b/doc/todo/directive_docs.mdwn
@@ -40,15 +40,15 @@ defined them: --[[Joey]]
index e476521..afe982a 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
- @@ -493,6 +493,7 @@ sub loadplugins () { #{{{
+ @@ -493,6 +493,7 @@ sub loadplugins () {
return 1;
- } #}}}
+ }
+my $loading_plugin;
- sub loadplugin ($) { #{{{
+ sub loadplugin ($) {
my $plugin=shift;
- @@ -502,14 +503,18 @@ sub loadplugin ($) { #{{{
+ @@ -502,14 +503,18 @@ sub loadplugin ($) {
"$installdir/lib/ikiwiki") {
if (defined $dir && -x "$dir/plugins/$plugin") {
require IkiWiki::Plugin::external;
@@ -67,7 +67,7 @@ defined them: --[[Joey]]
if ($@) {
error("Failed to load plugin $mod: $@");
}
- @@ -1429,6 +1434,9 @@ sub hook (@) { # {{{
+ @@ -1429,6 +1434,9 @@ sub hook (@) {
return if $param{no_override} && exists $hooks{$param{type}}{$param{id}};
@@ -76,4 +76,4 @@ defined them: --[[Joey]]
+
$hooks{$param{type}}{$param{id}}=\%param;
return 1;
- } # }}}
+ }
diff --git a/doc/todo/enable-htaccess-files.mdwn b/doc/todo/enable-htaccess-files.mdwn
index b3c174fba..e3b295123 100644
--- a/doc/todo/enable-htaccess-files.mdwn
+++ b/doc/todo/enable-htaccess-files.mdwn
@@ -5,7 +5,7 @@
@@ -26,7 +26,7 @@
memoize("file_pruned");
- sub defaultconfig () { #{{{
+ sub defaultconfig () {
- wiki_file_prune_regexps => [qr/\.\./, qr/^\./, qr/\/\./,
+ wiki_file_prune_regexps => [qr/\.\./, qr/^\.(?!htaccess)/, qr/\/\.(?!htaccess)/,
qr/\.x?html?$/, qr/\.ikiwiki-new$/,
diff --git a/doc/todo/format_escape.mdwn b/doc/todo/format_escape.mdwn
index 8dfe05581..574883d1b 100644
--- a/doc/todo/format_escape.mdwn
+++ b/doc/todo/format_escape.mdwn
@@ -141,13 +141,13 @@ Index: IkiWiki/Plugin/rst.pm
print html[html.find('')+6:html.find('')].strip();
";
- sub import { #{{{
+ sub import {
hook(type => "htmlize", id => "rst", call => \&htmlize);
+ hook(type => "htmlescape", id => "rst", call => \&htmlescape);
+ hook(type => "htmlescapelink", id => "rst", call => \&htmlescapelink);
- } # }}}
+ }
-+sub htmlescapelink ($$;@) { #{{{
++sub htmlescapelink ($$;@) {
+ my $url = shift;
+ my $text = shift;
+ my %params = @_;
@@ -158,15 +158,15 @@ Index: IkiWiki/Plugin/rst.pm
+ else {
+ return "`$text <$url>`_";
+ }
-+} # }}}
++}
+
-+sub htmlescape ($) { #{{{
++sub htmlescape ($) {
+ my $html=shift;
+ $html=~s/^/ /mg;
+ return ".. raw:: html\n\n".$html;
-+} # }}}
++}
+
- sub htmlize (@) { #{{{
+ sub htmlize (@) {
my %params=@_;
my $content=$params{content};
Index: doc/plugins/write.mdwn
@@ -272,7 +272,7 @@ Index: IkiWiki.pm
+ return $hooks{htmlescapelink}{$type}{call}->($bestlink, $linktext);
+ }
return "$linktext";
- } #}}}
+ }
@@ -628,6 +640,14 @@
preview => $preprocess_preview,
diff --git a/doc/todo/fortune:_select_options_via_environment.mdwn b/doc/todo/fortune:_select_options_via_environment.mdwn
index f906312fe..ddacd91b5 100644
--- a/doc/todo/fortune:_select_options_via_environment.mdwn
+++ b/doc/todo/fortune:_select_options_via_environment.mdwn
@@ -14,9 +14,9 @@
package IkiWiki::Plugin::fortune;
use warnings;
- @@ -12,7 +18,13 @@ sub import { #{{{
+ @@ -12,7 +18,13 @@ sub import {
- sub preprocess (@) { #{{{
+ sub preprocess (@) {
$ENV{PATH}="$ENV{PATH}:/usr/games:/usr/local/games";
- my $f = `fortune 2>/dev/null`;
+ my $f;
diff --git a/doc/todo/index.html_allowed.mdwn b/doc/todo/index.html_allowed.mdwn
index f030f9eea..f5e6f8cd7 100644
--- a/doc/todo/index.html_allowed.mdwn
+++ b/doc/todo/index.html_allowed.mdwn
@@ -91,15 +91,15 @@ page "A/B/index.html" is treated as "A/B".
+++ ikidev/IkiWiki.pm 2007-02-25 15:05:22.328852000 -0800
@@ -192,6 +192,12 @@
return $untainted;
- } #}}}
+ }
- +sub titlename($;@) { #{{{
+ +sub titlename($;@) {
+ my $page = shift;
+ $page =~ s!/index$!!;
+ return pagetitle(basename($page), @_);
- +} #}}}
+ +}
+
- sub basename ($) { #{{{
+ sub basename ($) {
my $file=shift;
@@ -117,7 +117,7 @@ diff -ru ikiwiki-2.4/IkiWiki.pm ikiwiki/IkiWiki.pm
$page=~s/\Q.$type\E*$// if defined $type;
+ $page=~s/\/index$// if $page =~ /\/index$/;
return $page;
- } #}}}
+ }
diff --git a/doc/todo/inline:_numerical_ordering_by_title.mdwn b/doc/todo/inline:_numerical_ordering_by_title.mdwn
index 95511d998..3f6c8b598 100644
--- a/doc/todo/inline:_numerical_ordering_by_title.mdwn
+++ b/doc/todo/inline:_numerical_ordering_by_title.mdwn
@@ -155,11 +155,11 @@ Joey, have you forgotten about that request? ;) --[[Paweł|ptecza]]
%config %links %pagestate %renderedfiles
%pagesources %destsources);
our $VERSION = 2.00; # plugin interface version, next is ikiwiki version
- @@ -835,6 +835,42 @@ sub titlepage ($) { #{{{
+ @@ -835,6 +835,42 @@ sub titlepage ($) {
return $title;
- } #}}}
+ }
- +sub titlecmp ($$) { #{{{
+ +sub titlecmp ($$) {
+ my $titleA=shift;
+ my $titleB=shift;
+
@@ -193,29 +193,29 @@ Joey, have you forgotten about that request? ;) --[[Paweł|ptecza]]
+ return -1 if (@listB);
+
+ return 0;
- +} #}}}
+ +}
+
- sub linkpage ($) { #{{{
+ sub linkpage ($) {
my $link=shift;
my $chars = defined $config{wiki_file_chars} ? $config{wiki_file_chars} : "-[:alnum:]+/.:_";
diff --git a/IkiWiki/Plugin/brokenlinks.pm b/IkiWiki/Plugin/brokenlinks.pm
index 37752dd..ccaa399 100644
--- a/IkiWiki/Plugin/brokenlinks.pm
+++ b/IkiWiki/Plugin/brokenlinks.pm
- @@ -59,7 +59,7 @@ sub preprocess (@) { #{{{
+ @@ -59,7 +59,7 @@ sub preprocess (@) {
map {
"
$_
"
}
- sort @broken)
+ sort titlecmp @broken)
."\n";
- } # }}}
+ }
diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm
index 8efef3f..263e7a6 100644
--- a/IkiWiki/Plugin/inline.pm
+++ b/IkiWiki/Plugin/inline.pm
- @@ -192,7 +192,7 @@ sub preprocess_inline (@) { #{{{
+ @@ -192,7 +192,7 @@ sub preprocess_inline (@) {
}
if (exists $params{sort} && $params{sort} eq 'title') {
@@ -228,20 +228,20 @@ Joey, have you forgotten about that request? ;) --[[Paweł|ptecza]]
index b910758..10a1d87 100644
--- a/IkiWiki/Plugin/orphans.pm
+++ b/IkiWiki/Plugin/orphans.pm
- @@ -56,7 +56,7 @@ sub preprocess (@) { #{{{
+ @@ -56,7 +56,7 @@ sub preprocess (@) {
htmllink($params{page}, $params{destpage}, $_,
noimageinline => 1).
""
- } sort @orphans).
+ } sort titlecmp @orphans).
"\n";
- } # }}}
+ }
diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm
index ceb7c84..00798e1 100644
--- a/IkiWiki/Render.pm
+++ b/IkiWiki/Render.pm
- @@ -89,7 +89,7 @@ sub genpage ($$) { #{{{
+ @@ -89,7 +89,7 @@ sub genpage ($$) {
$template->param(have_actions => 1);
}
diff --git a/doc/todo/language_definition_for_the_meta_plugin.mdwn b/doc/todo/language_definition_for_the_meta_plugin.mdwn
index 33098c601..4ac4e2e25 100644
--- a/doc/todo/language_definition_for_the_meta_plugin.mdwn
+++ b/doc/todo/language_definition_for_the_meta_plugin.mdwn
@@ -54,7 +54,7 @@ This may be useful for sites with a few pages in different languages, but no ful
my %authorurl;
+my %lang;
- sub import { #{{{
+ sub import {
hook(type => "preprocess", id => "meta", call => \&preprocess, scan => 1);
@@ -100,6 +101,11 @@
$meta{$page}.='
> Please resolve lang somewhere reusable rather than within meta plugin: It is certainly usable outside
diff --git a/doc/todo/meta_rcsid.mdwn b/doc/todo/meta_rcsid.mdwn
index 81a2c1328..158edea6e 100644
--- a/doc/todo/meta_rcsid.mdwn
+++ b/doc/todo/meta_rcsid.mdwn
@@ -26,7 +26,7 @@ of CVS/SVN-style keywords (like '$Id$', etc.) from the source file in the page t
my %copyright;
+my %rcsid;
- sub import { #{{{
+ sub import {
hook(type => "preprocess", id => "meta", call => \&preprocess, scan => 1);
@@ -110,6 +111,9 @@
$meta{$page}.="\n";
diff --git a/doc/todo/missingparents.pm.mdwn b/doc/todo/missingparents.pm.mdwn
index 0cc7137ba..c5f2ab535 100644
--- a/doc/todo/missingparents.pm.mdwn
+++ b/doc/todo/missingparents.pm.mdwn
@@ -82,15 +82,15 @@ Index: IkiWiki/Plugin/missingparents.pm
+my %ownfiles;
+my @pagespecs;
+
-+sub import { #{{{
++sub import {
+ hook(type => "checkconfig", id => "missingparents", call => \&checkconfig);
+ hook(type => "needsdelete", id => "missingparents", call => \&needsdelete);
+ hook(type => "needsbuild", id => "missingparents", call => \&needsbuild);
+ hook(type => "savestate", id => "missingparents", call => \&savestate);
+ hook(type => "preprocess", id => "missingparents", call => \&preprocess_missingparents);
-+} # }}}
++}
+
-+sub checkconfig () { #{{{
++sub checkconfig () {
+ IkiWiki::preprocess("missingparents", "missingparents",
+ readfile(srcfile("missingparents.mdwn")));
+ loadstate();
@@ -99,9 +99,9 @@ Index: IkiWiki/Plugin/missingparents.pm
+ unlink $config{srcdir}.'/'.$file;
+ }
+ }
-+} #}}}
++}
+
-+sub preprocess_missingparents (@) { #{{{
++sub preprocess_missingparents (@) {
+ my %params=@_;
+
+ if (! defined $params{pages} || ! defined $params{generate}) {
@@ -115,10 +115,10 @@ Index: IkiWiki/Plugin/missingparents.pm
+ #translators: is text for pages that match that pagespec.
+ return sprintf(gettext("missingparents in %s will be %s"),
+ '`'.$params{pages}.'`', '`\\'.$params{generate}.'`');
-+} # }}}
++}
+
+my $state_loaded=0;
-+sub loadstate() { #{{{
++sub loadstate() {
+ my $filename = "$config{wikistatedir}/missingparents";
+ if (-e $filename) {
+ open (IN, $filename) ||
@@ -132,9 +132,9 @@ Index: IkiWiki/Plugin/missingparents.pm
+
+ $state_loaded=1;
+ }
-+} #}}}
++}
+
-+sub savestate() { #{{{
++sub savestate() {
+ my $filename = "$config{wikistatedir}/missingparents.new";
+ my $cleanup = sub { unlink ($filename) };
+ open (OUT, ">$filename") || error("open $filename: $!", $cleanup);
@@ -143,9 +143,9 @@ Index: IkiWiki/Plugin/missingparents.pm
+ }
+ rename($filename, "$config{wikistatedir}/missingparents") ||
+ error("rename $filename: $!", $cleanup);
-+} #}}}
++}
+
-+sub needsdelete (@) { #{{{
++sub needsdelete (@) {
+ my $files=shift;
+
+ my @mydel;
@@ -167,9 +167,9 @@ Index: IkiWiki/Plugin/missingparents.pm
+ foreach my $page (@mydel){
+ push @{$files}, $page;
+ }
-+} #}}}
++}
+
-+sub check_matches($) { #{{{
++sub check_matches($) {
+ my $page = shift;
+ return if $IkiWiki::pagesources{$page};
+
@@ -183,9 +183,9 @@ Index: IkiWiki/Plugin/missingparents.pm
+ return $output;
+ }
+ return "";
-+} #}}}
++}
+
-+sub needsbuild ($) { #{{{
++sub needsbuild ($) {
+ my $files=shift;
+ my @new;
+
@@ -209,7 +209,7 @@ Index: IkiWiki/Plugin/missingparents.pm
+ $ownfiles{$file} = 1;
+ push @{$files}, $file;
+ }
-+} #}}}
++}
+
+1
Index: IkiWiki.pm
@@ -227,18 +227,18 @@ Index: IkiWiki.pm
our $version='unknown'; # VERSION_AUTOREPLACE done by Makefile, DNE
@@ -330,6 +336,30 @@
error("failed renaming $newfile to $destdir/$file: $!", $cleanup);
- } #}}}
+ }
-+sub newpage($$) { #{{{
++sub newpage($$) {
+ my $file=shift;
+ my $page=shift;
+
+ $pagemtime{$page} = $pagectime{$page} = time;
+ $pagesources{$page} = $file;
+ $pagecase{lc $page} = $page;
-+} #}}}
++}
+
-+sub delpage($) { #{{{
++sub delpage($) {
+ my $page=shift;
+ $links{$page}=[];
+ $renderedfiles{$page}=[];
@@ -251,10 +251,10 @@ Index: IkiWiki.pm
+ delete $destsources{$_};
+ }
+ }
-+} #}}}
++}
+
my %cleared;
- sub will_render ($$;$) { #{{{
+ sub will_render ($$;$) {
my $page=shift;
diff --git a/doc/todo/modify_page_filename_in_plugin.mdwn b/doc/todo/modify_page_filename_in_plugin.mdwn
index 7c0a909eb..4099487a1 100644
--- a/doc/todo/modify_page_filename_in_plugin.mdwn
+++ b/doc/todo/modify_page_filename_in_plugin.mdwn
@@ -10,7 +10,7 @@ My solution is to allow plugins to provide a hook that sets the pagename. --[[/u
+++ /usr/share/perl5/IkiWiki.pm 2008-10-07 11:57:26.000000000 -0400
@@ -196,11 +196,32 @@
- sub pagename ($) { #{{{
+ sub pagename ($) {
my $file=shift;
my $type=pagetype($file);
@@ -27,7 +27,7 @@ My solution is to allow plugins to provide a hook that sets the pagename. --[[/u
$page=~s/\Q.$type\E*$// if defined $type;
return $page;
+ }
- } #}}}
+ }
- sub htmlpage ($) { #{{{
+ sub htmlpage ($) {
diff --git a/doc/todo/pagespec_relative_to_a_target.mdwn b/doc/todo/pagespec_relative_to_a_target.mdwn
index f7b248670..4757988e0 100644
--- a/doc/todo/pagespec_relative_to_a_target.mdwn
+++ b/doc/todo/pagespec_relative_to_a_target.mdwn
@@ -57,7 +57,7 @@ diff -urNX ignorepats ikiwiki/IkiWiki/Plugin/relative.pm ikidev/IkiWiki/Plugin/r
+
+package IkiWiki::PageSpec;
+
-+sub match_relative($$;@) { #{{{
++sub match_relative($$;@) {
+ my $parent = shift;
+ my $spec = shift;
+ my %params = @_;
@@ -69,21 +69,21 @@ diff -urNX ignorepats ikiwiki/IkiWiki/Plugin/relative.pm ikidev/IkiWiki/Plugin/r
+ }
+ }
+ return IkiWiki::FailReason->new("$parent can't match $spec against anything");
-+} #}}}
++}
+
-+sub match_has_child($$;@) { #{{{
++sub match_has_child($$;@) {
+ my $page = shift;
+ my $childname = shift;
+ my $spec;
-+ if ($childname) { #{{{
++ if ($childname) {
+ $spec = "$page/$childname or $page/*/$childname";
-+ } #}}}
-+ else { #{{{
++ }
++ else {
+ $spec = "$page/*";
-+ } #}}}
++ }
+
+ return match_relative($page, $spec, @_);
-+} #}}}
++}
+
+1
diff --git a/doc/todo/provide_sha1_for_git_diffurl.mdwn b/doc/todo/provide_sha1_for_git_diffurl.mdwn
index 9c8b340de..01aa512f8 100644
--- a/doc/todo/provide_sha1_for_git_diffurl.mdwn
+++ b/doc/todo/provide_sha1_for_git_diffurl.mdwn
@@ -10,7 +10,7 @@ diffurls of the following form:
index 5bef928..164210d 100644
--- a/IkiWiki/Plugin/git.pm
+++ b/IkiWiki/Plugin/git.pm
- @@ -518,6 +518,7 @@ sub rcs_recentchanges ($) { #{{{
+ @@ -518,6 +518,7 @@ sub rcs_recentchanges ($) {
my $diffurl = defined $config{'diffurl'} ? $config{'diffurl'} : "";
$diffurl =~ s/\[\[file\]\]/$file/go;
diff --git a/doc/todo/require_CAPTCHA_to_edit.mdwn b/doc/todo/require_CAPTCHA_to_edit.mdwn
index 110b4167f..83ba07eb0 100644
--- a/doc/todo/require_CAPTCHA_to_edit.mdwn
+++ b/doc/todo/require_CAPTCHA_to_edit.mdwn
@@ -91,15 +91,15 @@ ignored.
--- a/IkiWiki/Plugin/openid.pm
+++ b/IkiWiki/Plugin/openid.pm
-@@ -18,6 +18,7 @@ sub getopt () { #{{{
+@@ -18,6 +18,7 @@ sub getopt () {
error($@) if $@;
Getopt::Long::Configure('pass_through');
GetOptions("openidsignup=s" => \$config{openidsignup});
+ GetOptions("openidneedscaptcha=s" => \$config{openidneedscaptcha});
- } #}}}
+ }
- sub formbuilder_setup (@) { #{{{
-@@ -61,6 +62,7 @@ sub formbuilder_setup (@) { #{{{
+ sub formbuilder_setup (@) {
+@@ -61,6 +62,7 @@ sub formbuilder_setup (@) {
# Skip all other required fields in this case.
foreach my $field ($form->field) {
next if $field eq "openid_url";
@@ -107,7 +107,7 @@ ignored.
$form->field(name => $field, required => 0,
validate => '/.*/');
}
-@@ -96,6 +98,18 @@ sub validate ($$$;$) { #{{{
+@@ -96,6 +98,18 @@ sub validate ($$$;$) {
}
}
@@ -152,19 +152,19 @@ use warnings;
use strict;
use IkiWiki 2.00;
-sub import { #{{{
+sub import {
hook(type => "formbuilder_setup", id => "recaptcha", call => \&formbuilder_setup);
-} # }}}
+}
-sub getopt () { #{{{
+sub getopt () {
eval q{use Getopt::Long};
error($@) if $@;
Getopt::Long::Configure('pass_through');
GetOptions("reCaptchaPubKey=s" => \$config{reCaptchaPubKey});
GetOptions("reCaptchaPrivKey=s" => \$config{reCaptchaPrivKey});
-} #}}}
+}
-sub formbuilder_setup (@) { #{{{
+sub formbuilder_setup (@) {
my %params=@_;
my $form=$params{form};
@@ -274,7 +274,7 @@ EOTAGS
});
}
}
-} # }}}
+}
# The following function is borrowed from
# Captcha::reCAPTCHA by Andy Armstrong and are under the PERL Artistic License
diff --git a/doc/todo/source_link.mdwn b/doc/todo/source_link.mdwn
index 5d6cb89e8..b051361a8 100644
--- a/doc/todo/source_link.mdwn
+++ b/doc/todo/source_link.mdwn
@@ -31,13 +31,13 @@ I just implemented this. There is one [[patch]] to the default page template, a
use IkiWiki;
use open qw{:utf8 :std};
- sub import { #{{{
+ sub import {
hook(type => "getsetup", id => "getsource", call => \&getsetup);
hook(type => "pagetemplate", id => "getsource", call => \&pagetemplate);
hook(type => "sessioncgi", id => "getsource", call => \&cgi_getsource);
- } # }}}
+ }
- sub getsetup () { #{{{
+ sub getsetup () {
return
plugin => {
safe => 1,
@@ -50,9 +50,9 @@ I just implemented this. There is one [[patch]] to the default page template, a
safe => 1,
rebuild => 0,
},
- } #}}}
+ }
- sub pagetemplate (@) { #{{{
+ sub pagetemplate (@) {
my %params=@_;
my $page=$params{page};
@@ -62,9 +62,9 @@ I just implemented this. There is one [[patch]] to the default page template, a
$template->param(getsourceurl => IkiWiki::cgiurl(do => "getsource", page => $page));
$template->param(have_actions => 1);
}
- } # }}}
+ }
- sub cgi_getsource ($$) { #{{{
+ sub cgi_getsource ($$) {
my $cgi=shift;
my $session=shift;
diff --git a/doc/todo/structured_page_data.mdwn b/doc/todo/structured_page_data.mdwn
index 2a196ed23..22f67cc0a 100644
--- a/doc/todo/structured_page_data.mdwn
+++ b/doc/todo/structured_page_data.mdwn
@@ -257,21 +257,21 @@ in a large number of other cases.
use CGI::FormBuilder;
use IkiWiki 2.00;
- sub import { #{{{
+ sub import {
hook(type => "getsetup", id => "form", call => \&getsetup);
hook(type => "htmlize", id => "form", call => \&htmlize);
hook(type => "sessioncgi", id => "form", call => \&cgi_submit);
- } # }}}
+ }
- sub getsetup () { #{{{
+ sub getsetup () {
return
plugin => {
safe => 1,
rebuild => 1, # format plugin
},
- } #}}}
+ }
- sub makeFormFromYAML ($$$) { #{{{
+ sub makeFormFromYAML ($$$) {
my $page = shift;
my $YAMLString = shift;
my $q = shift;
@@ -350,9 +350,9 @@ in a large number of other cases.
# IkiWiki::decode_form_utf8($form);
return $form;
- } #}}}
+ }
- sub htmlize (@) { #{{{
+ sub htmlize (@) {
my %params=@_;
my $content = $params{content};
my $page = $params{page};
@@ -360,9 +360,9 @@ in a large number of other cases.
my $form = makeFormFromYAML($page, $content, undef);
return $form->render(submit => 'Update Form');
- } # }}}
+ }
- sub cgi_submit ($$) { #{{{
+ sub cgi_submit ($$) {
my $q=shift;
my $session=shift;
@@ -425,11 +425,11 @@ in a large number of other cases.
}
exit;
- } #}}}
+ }
package IkiWiki::PageSpec;
- sub match_form_eq ($$;@) { #{{{
+ sub match_form_eq ($$;@) {
my $page=shift;
my $argSet=shift;
my @args=split(/,/, $argSet);
@@ -460,7 +460,7 @@ in a large number of other cases.
} else {
return IkiWiki::FailReason->new("field value does not match");
}
- } #}}}
+ }
1
@@ -476,22 +476,22 @@ in a large number of other cases.
my $inTable = 0;
- sub import { #{{{
+ sub import {
hook(type => "getsetup", id => "data", call => \&getsetup);
hook(type => "needsbuild", id => "data", call => \&needsbuild);
hook(type => "preprocess", id => "data", call => \&preprocess, scan => 1);
hook(type => "preprocess", id => "datatable", call => \&preprocess_table, scan => 1); # does this need scan?
- } # }}}
+ }
- sub getsetup () { #{{{
+ sub getsetup () {
return
plugin => {
safe => 1,
rebuild => 1, # format plugin
},
- } #}}}
+ }
- sub needsbuild (@) { #{{{
+ sub needsbuild (@) {
my $needsbuild=shift;
foreach my $page (keys %pagestate) {
if (exists $pagestate{$page}{data}) {
@@ -506,7 +506,7 @@ in a large number of other cases.
}
}
- sub preprocess (@) { #{{{
+ sub preprocess (@) {
my @argslist = @_;
my %params=@argslist;
@@ -546,9 +546,9 @@ in a large number of other cases.
}
return $html;
- } # }}}
+ }
- sub preprocess_table (@) { #{{{
+ sub preprocess_table (@) {
my %params=@_;
my @lines;
@@ -568,11 +568,11 @@ in a large number of other cases.
push @lines, '';
return join("\n", @lines);
- } #}}}
+ }
package IkiWiki::PageSpec;
- sub match_data_eq ($$;@) { #{{{
+ sub match_data_eq ($$;@) {
my $page=shift;
my $argSet=shift;
my @args=split(/,/, $argSet);
@@ -592,9 +592,9 @@ in a large number of other cases.
} else {
return IkiWiki::FailReason->new("value does not match");
}
- } #}}}
+ }
- sub match_data_link ($$;@) { #{{{
+ sub match_data_link ($$;@) {
my $page=shift;
my $argSet=shift;
my @params=@_;
@@ -618,6 +618,6 @@ in a large number of other cases.
}
return IkiWiki::FailReason->new("No data link on page $page with key $key matches glob $value");
- } #}}}
+ }
1
diff --git a/doc/todo/supporting_comments_via_disussion_pages.mdwn b/doc/todo/supporting_comments_via_disussion_pages.mdwn
index 892db18a9..aae0b3008 100644
--- a/doc/todo/supporting_comments_via_disussion_pages.mdwn
+++ b/doc/todo/supporting_comments_via_disussion_pages.mdwn
@@ -91,14 +91,14 @@ Each comment is processed to something like this:
use strict;
use IkiWiki '1.02';
- sub import { #{{{
+ sub import {
hook(type => "formbuilder_setup", id => "comments",
call => \&formbuilder_setup);
hook(type => "preprocess", id => "blogcomment",
call => \&preprocess);
- } # }}}
+ }
- sub formbuilder_setup (@) { #{{{
+ sub formbuilder_setup (@) {
my %params=@_;
my $cgi = $params{cgi};
my $form = $params{form};
@@ -138,9 +138,9 @@ Each comment is processed to something like this:
$content.=qq{[[!blogcomment from="""$name""" timestamp="""$timestamp""" subject="""$subject""" text="""$comment"""]]\n\n};
$content=~s/\n/\r\n/g;
$form->field(name => "editcontent", value => $content, force => 1);
- } # }}}
+ }
- sub preprocess (@) { #{{{
+ sub preprocess (@) {
my %params=@_;
my ($text, $date, $from, $subject, $r);
@@ -159,7 +159,7 @@ Each comment is processed to something like this:
$r .= "\n" . $text . "
\n";
return $r;
- } # }}}
+ }
1;
diff --git a/doc/todo/syntax_highlighting.mdwn b/doc/todo/syntax_highlighting.mdwn
index 2bdeb62be..3de3032b3 100644
--- a/doc/todo/syntax_highlighting.mdwn
+++ b/doc/todo/syntax_highlighting.mdwn
@@ -90,7 +90,7 @@ like this:
index 8d728c9..1bd46a9 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
- @@ -618,6 +618,8 @@ sub pagetype ($) { #{{{
+ @@ -618,6 +618,8 @@ sub pagetype ($) {
if ($page =~ /\.([^.]+)$/) {
return $1 if exists $hooks{htmlize}{$1};
@@ -98,7 +98,7 @@ like this:
+ return $page;
}
return;
- } #}}}
+ }
## format directive
diff --git a/doc/todo/tidy_git__39__s_ctime_debug_output.mdwn b/doc/todo/tidy_git__39__s_ctime_debug_output.mdwn
index aaa040ec7..bfc130d69 100644
--- a/doc/todo/tidy_git__39__s_ctime_debug_output.mdwn
+++ b/doc/todo/tidy_git__39__s_ctime_debug_output.mdwn
@@ -10,6 +10,6 @@
+ debug("ctime for '$file': ". localtime($ctime));
return $ctime;
- } #}}}
+ }
[[!tag patch done]]
diff --git a/doc/todo/tmplvars_plugin.mdwn b/doc/todo/tmplvars_plugin.mdwn
index f7d06a579..644cf23aa 100644
--- a/doc/todo/tmplvars_plugin.mdwn
+++ b/doc/todo/tmplvars_plugin.mdwn
@@ -11,12 +11,12 @@ A simple plugin to allow per-page customization of a template by passing paramat
my %tmplvars;
- sub import { #{{{
+ sub import {
hook(type => "preprocess", id => "tmplvars", call => \&preprocess);
hook(type => "pagetemplate", id => "tmplvars", call => \&pagetemplate);
- } # }}}
+ }
- sub preprocess (@) { #{{{
+ sub preprocess (@) {
my %params=@_;
if ($params{page} eq $params{destpage}) {
@@ -34,9 +34,9 @@ A simple plugin to allow per-page customization of a template by passing paramat
}
}
- } # }}}
+ }
- sub pagetemplate (@) { #{{{
+ sub pagetemplate (@) {
my %params=@_;
my $template = $params{template};
@@ -47,6 +47,6 @@ A simple plugin to allow per-page customization of a template by passing paramat
}
return undef;
- } # }}}
+ }
1
diff --git a/doc/todo/tracking_bugs_with_dependencies.mdwn b/doc/todo/tracking_bugs_with_dependencies.mdwn
index 3af0458bd..2832e37aa 100644
--- a/doc/todo/tracking_bugs_with_dependencies.mdwn
+++ b/doc/todo/tracking_bugs_with_dependencies.mdwn
@@ -194,9 +194,9 @@ account all comments above (which doesn't mean it is above reproach :) ). --[[W
index 4e4da11..8b3cdfe 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
- @@ -1550,7 +1550,16 @@ sub globlist_to_pagespec ($) { #{{{
+ @@ -1550,7 +1550,16 @@ sub globlist_to_pagespec ($) {
- sub is_globlist ($) { #{{{
+ sub is_globlist ($) {
my $s=shift;
- return ( $s =~ /[^\s]+\s+([^\s]+)/ && $1 ne "and" && $1 ne "or" );
+ return ! ($s =~ /
@@ -209,19 +209,19 @@ account all comments above (which doesn't mean it is above reproach :) ). --[[W
+ ) |
+ (\s and \s) | (\s or \s) # or we find 'and' or 'or' somewhere
+ /xs);
- } #}}}
+ }
- sub safequote ($) { #{{{
- @@ -1631,7 +1640,7 @@ sub pagespec_merge ($$) { #{{{
+ sub safequote ($) {
+ @@ -1631,7 +1640,7 @@ sub pagespec_merge ($$) {
return "($a) or ($b)";
- } #}}}
+ }
- -sub pagespec_translate ($) { #{{{
- +sub pagespec_makeperl ($) { #{{{
+ -sub pagespec_translate ($) {
+ +sub pagespec_makeperl ($) {
my $spec=shift;
# Support for old-style GlobLists.
- @@ -1650,12 +1659,14 @@ sub pagespec_translate ($) { #{{{
+ @@ -1650,12 +1659,14 @@ sub pagespec_translate ($) {
|
\) # )
|
@@ -238,7 +238,7 @@ account all comments above (which doesn't mean it is above reproach :) ). --[[W
my $word=$1;
if (lc $word eq 'and') {
$code.=' &&';
- @@ -1666,16 +1677,23 @@ sub pagespec_translate ($) { #{{{
+ @@ -1666,16 +1677,23 @@ sub pagespec_translate ($) {
elsif ($word eq "(" || $word eq ")" || $word eq "!") {
$code.=' '.$word;
}
@@ -265,14 +265,14 @@ account all comments above (which doesn't mean it is above reproach :) ). --[[W
}
}
- @@ -1683,8 +1701,18 @@ sub pagespec_translate ($) { #{{{
+ @@ -1683,8 +1701,18 @@ sub pagespec_translate ($) {
$code=0;
}
+ return 'sub { my $page=shift; my %params = @_; '.$code.' }';
- +} #}}}
+ +}
+
- +sub pagespec_translate ($) { #{{{
+ +sub pagespec_translate ($) {
+ my $spec=shift;
+
+ my $code = pagespec_makeperl($spec);
@@ -282,19 +282,19 @@ account all comments above (which doesn't mean it is above reproach :) ). --[[W
no warnings;
- return eval 'sub { my $page=shift; '.$code.' }';
+ return eval $code;
- } #}}}
+ }
- sub pagespec_match ($$;@) { #{{{
- @@ -1699,7 +1727,7 @@ sub pagespec_match ($$;@) { #{{{
+ sub pagespec_match ($$;@) {
+ @@ -1699,7 +1727,7 @@ sub pagespec_match ($$;@) {
my $sub=pagespec_translate($spec);
return IkiWiki::FailReason->new("syntax error in pagespec \"$spec\"") if $@;
- return $sub->($page, @params);
+ return $sub->($page, @params, specFuncs => {});
- } #}}}
+ }
- sub pagespec_valid ($) { #{{{
- @@ -1748,11 +1776,78 @@ sub new { #{{{
+ sub pagespec_valid ($) {
+ @@ -1748,11 +1776,78 @@ sub new {
package IkiWiki::PageSpec;
@@ -361,7 +361,7 @@ account all comments above (which doesn't mean it is above reproach :) ). --[[W
+ }
+}
+
- sub match_glob ($$;@) { #{{{
+ sub match_glob ($$;@) {
my $page=shift;
my $glob=shift;
my %params=@_;
@@ -373,9 +373,9 @@ account all comments above (which doesn't mean it is above reproach :) ). --[[W
my $from=exists $params{location} ? $params{location} : '';
# relative matching
- @@ -1782,11 +1877,12 @@ sub match_internal ($$;@) { #{{{
+ @@ -1782,11 +1877,12 @@ sub match_internal ($$;@) {
- sub match_link ($$;@) { #{{{
+ sub match_link ($$;@) {
my $page=shift;
- my $link=lc(shift);
+ my $fulllink=shift;
@@ -388,7 +388,7 @@ account all comments above (which doesn't mean it is above reproach :) ). --[[W
# relative matching
if ($link =~ m!^\.! && defined $from) {
$from=~s#/?[^/]+$##;
- @@ -1804,19 +1900,32 @@ sub match_link ($$;@) { #{{{
+ @@ -1804,19 +1900,32 @@ sub match_link ($$;@) {
}
else {
return IkiWiki::SuccessReason->new("$page links to page $p matching $link")
@@ -397,9 +397,9 @@ account all comments above (which doesn't mean it is above reproach :) ). --[[W
}
}
return IkiWiki::FailReason->new("$page does not link to $link");
- } #}}}
+ }
- sub match_backlink ($$;@) { #{{{
+ sub match_backlink ($$;@) {
- return match_link($_[1], $_[0], @_);
+ my $page=shift;
+ my $backlink=shift;
@@ -410,9 +410,9 @@ account all comments above (which doesn't mean it is above reproach :) ). --[[W
+ }
+
+ return match_link($backlink, $page, @params);
- } #}}}
+ }
- sub match_created_before ($$;@) { #{{{
+ sub match_created_before ($$;@) {
my $page=shift;
my $testpage=shift;
+ my @params=@_;
@@ -423,8 +423,8 @@ account all comments above (which doesn't mean it is above reproach :) ). --[[W
if (exists $IkiWiki::pagectime{$testpage}) {
if ($IkiWiki::pagectime{$page} < $IkiWiki::pagectime{$testpage}) {
- @@ -1834,6 +1943,11 @@ sub match_created_before ($$;@) { #{{{
- sub match_created_after ($$;@) { #{{{
+ @@ -1834,6 +1943,11 @@ sub match_created_before ($$;@) {
+ sub match_created_after ($$;@) {
my $page=shift;
my $testpage=shift;
+ my @params=@_;
diff --git a/doc/todo/turn_edittemplate_verbosity_off_by_default.mdwn b/doc/todo/turn_edittemplate_verbosity_off_by_default.mdwn
index 87e55685c..14bb43782 100644
--- a/doc/todo/turn_edittemplate_verbosity_off_by_default.mdwn
+++ b/doc/todo/turn_edittemplate_verbosity_off_by_default.mdwn
@@ -8,7 +8,7 @@ I think this (untested) patch might just do the trick:
--- a/IkiWiki/Plugin/edittemplate.pm
+++ b/IkiWiki/Plugin/edittemplate.pm
- @@ -46,8 +46,13 @@ sub preprocess (@) { #{{{
+ @@ -46,8 +46,13 @@ sub preprocess (@) {
$pagestate{$params{page}}{edittemplate}{$params{match}}=$params{template};
@@ -21,9 +21,9 @@ I think this (untested) patch might just do the trick:
+ else {
+ return '';
+ }
- } # }}}
+ }
- sub formbuilder (@) { #{{{
+ sub formbuilder (@) {
--[[madduck]]
diff --git a/doc/todo/using_meta_titles_for_parentlinks.html b/doc/todo/using_meta_titles_for_parentlinks.html
index d04e5a300..6da40a415 100644
--- a/doc/todo/using_meta_titles_for_parentlinks.html
+++ b/doc/todo/using_meta_titles_for_parentlinks.html
@@ -82,9 +82,9 @@ diff -c /usr/share/perl5/IkiWiki/Plugin/meta.pm.distrib /usr/share/perl5/IkiWiki
*** 289,294 ****
--- 290,319 ----
}
- } #}}}
+ }
-+ sub IkiWiki::pagetitle ($;$) { #{{{
++ sub IkiWiki::pagetitle ($;$) {
+ my $page=shift;
+ my $unescaped=shift;
+
@@ -106,11 +106,11 @@ diff -c /usr/share/perl5/IkiWiki/Plugin/meta.pm.distrib /usr/share/perl5/IkiWiki
+ }
+
+ return $page;
-+ } #}}}
++ }
+
package IkiWiki::PageSpec;
- sub match_title ($$;@) { #{{{
+ sub match_title ($$;@) {
diff --git a/doc/todo/varioki_--_add_template_variables___40__with_closures_for_values__41___in_ikiwiki.setup.mdwn b/doc/todo/varioki_--_add_template_variables___40__with_closures_for_values__41___in_ikiwiki.setup.mdwn
index 492a32b36..b28469993 100644
--- a/doc/todo/varioki_--_add_template_variables___40__with_closures_for_values__41___in_ikiwiki.setup.mdwn
+++ b/doc/todo/varioki_--_add_template_variables___40__with_closures_for_values__41___in_ikiwiki.setup.mdwn
@@ -157,9 +157,9 @@ ManojSrivastava
+=cut
+
+
-+sub import { #{{{
++sub import {
+ hook(type => "pagetemplate", id => "varioki", call => \&pagetemplate);
-+} # }}}
++}
+
+
+=pod
@@ -175,7 +175,7 @@ ManojSrivastava
+
+=cut
+
-+sub pagetemplate (@) { #{{{
++sub pagetemplate (@) {
+ my %params=@_;
+ my $page=$params{page};
+ my $template=$params{template};
@@ -207,7 +207,7 @@ ManojSrivastava
+ $template->param("$var" =>"$value");
+ }
+ }
-+} # }}}
++}
+
+1;
+
diff --git a/ikiwiki.in b/ikiwiki.in
index 473cbdbfd..32a24af84 100755
--- a/ikiwiki.in
+++ b/ikiwiki.in
@@ -9,12 +9,12 @@ use strict;
use lib '.'; # For use in nonstandard directory, munged by Makefile.
use IkiWiki;
-sub usage () { #{{{
+sub usage () {
die gettext("usage: ikiwiki [options] source dest"), "\n",
gettext(" ikiwiki --setup configfile"), "\n";
-} #}}}
+}
-sub getconfig () { #{{{
+sub getconfig () {
if (! exists $ENV{WRAPPED_OPTIONS}) {
%config=defaultconfig();
eval q{use Getopt::Long};
@@ -123,9 +123,9 @@ sub getconfig () { #{{{
loadplugins();
checkconfig();
}
-} #}}}
+}
-sub main () { #{{{
+sub main () {
getconfig();
if ($config{setup}) {
@@ -207,6 +207,6 @@ sub main () { #{{{
saveindex();
debug(gettext("done"));
}
-} #}}}
+}
main;
--
cgit v1.2.3
From 60142db48ebbd540e5310c5bcaa4762676c8ddce Mon Sep 17 00:00:00 2001
From: Joey Hess
Date: Wed, 17 Dec 2008 15:29:22 -0500
Subject: clarification
---
doc/plugins/comments.mdwn | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
(limited to 'doc/plugins')
diff --git a/doc/plugins/comments.mdwn b/doc/plugins/comments.mdwn
index aab75e9b7..a81cab127 100644
--- a/doc/plugins/comments.mdwn
+++ b/doc/plugins/comments.mdwn
@@ -23,10 +23,12 @@ Individual comments are stored as internal-use pages named something like
There are some global options for the setup file:
+* `comments_open_pagespec`: pages where new comments can be posted, e.g.
+ `blog/* and created_after(close_old_comments)` or `!*/discussion`.
+ You need to set this, since the default is to not add comments to any
+ pages.
* `comments_shown_pagespec`: pages where comments will be displayed inline,
e.g. `blog/*` or `!*/discussion`.
-* `comments_open_pagespec`: pages where new comments can be posted, e.g.
- `blog/* and created_after(close_old_comments)` or `!*/discussion`
* `comments_pagename`: if this is e.g. `comment_` (the default), then
comment pages will be named something like `page/comment_12`
* `comments_allowdirectives`: if true (default false), comments may
--
cgit v1.2.3
From 140c0bacbadc35de93cc685313123e9e51b45704 Mon Sep 17 00:00:00 2001
From: Joey Hess
Date: Wed, 17 Dec 2008 18:50:04 -0500
Subject: 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.
---
IkiWiki/Plugin/comments.pm | 43 ++++++++++++++++++++-----------------------
doc/plugins/comments.mdwn | 13 +++++++------
2 files changed, 27 insertions(+), 29 deletions(-)
(limited to 'doc/plugins')
diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm
index 83f67869c..6e257d1d9 100644
--- a/IkiWiki/Plugin/comments.pm
+++ b/IkiWiki/Plugin/comments.pm
@@ -34,20 +34,18 @@ sub getsetup () {
safe => 1,
rebuild => 1,
},
- # Pages where comments are shown, but new comments are not
- # allowed, will show "Comments are closed".
- comments_shown_pagespec => {
+ comments_pagespec => {
type => 'pagespec',
- example => 'blog/*',
- description => 'PageSpec for pages where comments will be shown inline',
+ example => 'blog/* and *!/Discussion',
+ description => 'PageSpec of pages where comments are allowed',
link => 'ikiwiki/PageSpec',
safe => 1,
rebuild => 1,
},
- comments_open_pagespec => {
+ comments_closed_pagespec => {
type => 'pagespec',
- example => 'blog/* and created_after(close_old_comments)',
- description => 'PageSpec for pages where new comments can be posted',
+ example => 'blog/controversial or blog/flamewar',
+ description => 'PageSpec of pages where posting new comments is not allowed',
link => 'ikiwiki/PageSpec',
safe => 1,
rebuild => 1,
@@ -87,10 +85,10 @@ sub getsetup () {
sub checkconfig () {
$config{comments_commit} = 1
unless defined $config{comments_commit};
- $config{comments_shown_pagespec} = ''
- unless defined $config{comments_shown_pagespec};
- $config{comments_open_pagespec} = ''
- unless defined $config{comments_open_pagespec};
+ $config{comments_pagespec} = ''
+ unless defined $config{comments_pagespec};
+ $config{comments_closed_pagespec} = ''
+ unless defined $config{comments_closed_pagespec};
$config{comments_pagename} = 'comment_'
unless defined $config{comments_pagename};
}
@@ -371,7 +369,7 @@ sub sessioncgi ($$) {
$page));
}
- if (not pagespec_match($page, $config{comments_open_pagespec},
+ if (pagespec_match($page, $config{comments_closed_pagespec},
location => $page)) {
error(sprintf(gettext(
"comments on page '%s' are closed"),
@@ -523,22 +521,21 @@ sub pagetemplate (@) {
my $comments = undef;
my $open = 0;
- my $shown = pagespec_match($page,
- $config{comments_shown_pagespec},
- location => $page);
+ my $shown = 0;
+ if (pagespec_match($page,
+ $config{comments_pagespec},
+ location => $page)) {
+ $shown = 1;
+ $open = length $config{cgiurl} > 0;
+ }
- if (pagespec_match($page, "*/$config{comments_pagename}*",
+ if (pagespec_match($page,
+ "$config{comments_closed_pagespec} or */$config{comments_pagename}*",
location => $page)) {
$shown = 0;
$open = 0;
}
- if (length $config{cgiurl}) {
- $open = pagespec_match($page,
- $config{comments_open_pagespec},
- location => $page);
- }
-
if ($shown) {
$comments = IkiWiki::preprocess_inline(
pages => "internal($page/$config{comments_pagename}*)",
diff --git a/doc/plugins/comments.mdwn b/doc/plugins/comments.mdwn
index a81cab127..afaf2c7ae 100644
--- a/doc/plugins/comments.mdwn
+++ b/doc/plugins/comments.mdwn
@@ -23,12 +23,13 @@ Individual comments are stored as internal-use pages named something like
There are some global options for the setup file:
-* `comments_open_pagespec`: pages where new comments can be posted, e.g.
- `blog/* and created_after(close_old_comments)` or `!*/discussion`.
- You need to set this, since the default is to not add comments to any
- pages.
-* `comments_shown_pagespec`: pages where comments will be displayed inline,
- e.g. `blog/*` or `!*/discussion`.
+* `comments_pagespec`: [[ikiwiki/PageSpec]] of pages where comments are
+ allowed. The default is not to allow comments on any pages. To allow
+ comments to all posts to a blog, you could use `blog/* and !*/Discussion`.
+* `comments_closed_pagespec`: [[ikiwiki/PageSpec]] of pages where
+ posting of new comments is closed, but any existing comments will still
+ be displayed. Often you will list a set of individual pages here.
+ For example: `blog/controversial or blog/flamewar`
* `comments_pagename`: if this is e.g. `comment_` (the default), then
comment pages will be named something like `page/comment_12`
* `comments_allowdirectives`: if true (default false), comments may
--
cgit v1.2.3
From d647ca286ad2f974343c73fbc631ed092c13c09a Mon Sep 17 00:00:00 2001
From: Joey Hess
Date: Wed, 17 Dec 2008 20:10:22 -0500
Subject: simplify pagespec
---
doc/plugins/pagecount.mdwn | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'doc/plugins')
diff --git a/doc/plugins/pagecount.mdwn b/doc/plugins/pagecount.mdwn
index 6235963d3..c1c15eafb 100644
--- a/doc/plugins/pagecount.mdwn
+++ b/doc/plugins/pagecount.mdwn
@@ -6,5 +6,5 @@ This plugin provides the [[ikiwiki/directive/pagecount]]
currently in the wiki.
If it is turned on it can tell us that this wiki includes
-[[!pagecount pages="* and !recentchanges"]]
-pages, of which [[!pagecount pages="*/Discussion"]] are discussion pages.
+[[!pagecount]] pages, of which
+[[!pagecount pages="*/Discussion"]] are discussion pages.
--
cgit v1.2.3
From 3e2f75af6b86ebc636abf409ac9ce98bed78f04a Mon Sep 17 00:00:00 2001
From: Joey Hess
Date: Wed, 17 Dec 2008 20:19:12 -0500
Subject: fix
---
doc/plugins/pagecount.mdwn | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'doc/plugins')
diff --git a/doc/plugins/pagecount.mdwn b/doc/plugins/pagecount.mdwn
index c1c15eafb..a56027e60 100644
--- a/doc/plugins/pagecount.mdwn
+++ b/doc/plugins/pagecount.mdwn
@@ -6,5 +6,5 @@ This plugin provides the [[ikiwiki/directive/pagecount]]
currently in the wiki.
If it is turned on it can tell us that this wiki includes
-[[!pagecount]] pages, of which
+[[!pagecount ]] pages, of which
[[!pagecount pages="*/Discussion"]] are discussion pages.
--
cgit v1.2.3
From d70f3d6271a28635942ed23f91ed7e144877e62e Mon Sep 17 00:00:00 2001
From: Joey Hess
Date: Sun, 21 Dec 2008 16:50:50 -0500
Subject: unify pagespecs
---
doc/examples/blog.mdwn | 2 +-
doc/plugins/comments.mdwn | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
(limited to 'doc/plugins')
diff --git a/doc/examples/blog.mdwn b/doc/examples/blog.mdwn
index 687f4afce..091e37431 100644
--- a/doc/examples/blog.mdwn
+++ b/doc/examples/blog.mdwn
@@ -21,4 +21,4 @@ Some additional configuration you might want to do:
* Enable the [[comments|plugins/comments]] plugin and configure it to
enable comments to posts to the blog:
- comments_pagespec => 'blog/posts/*',
+ comments_pagespec => 'blog/posts/* and !*/Discussion',
diff --git a/doc/plugins/comments.mdwn b/doc/plugins/comments.mdwn
index afaf2c7ae..72b11af64 100644
--- a/doc/plugins/comments.mdwn
+++ b/doc/plugins/comments.mdwn
@@ -25,7 +25,8 @@ There are some global options for the setup file:
* `comments_pagespec`: [[ikiwiki/PageSpec]] of pages where comments are
allowed. The default is not to allow comments on any pages. To allow
- comments to all posts to a blog, you could use `blog/* and !*/Discussion`.
+ comments to all posts to a blog, you could use
+ `blog/posts/* and !*/Discussion`.
* `comments_closed_pagespec`: [[ikiwiki/PageSpec]] of pages where
posting of new comments is closed, but any existing comments will still
be displayed. Often you will list a set of individual pages here.
--
cgit v1.2.3
From 298c16eda952e77627723ea5adb57a5c03d7ce71 Mon Sep 17 00:00:00 2001
From: intrigeri
Date: Tue, 23 Dec 2008 00:24:48 +0100
Subject: po: make the dev timing clearer
---
doc/plugins/contrib/po.mdwn | 3 +++
1 file changed, 3 insertions(+)
(limited to 'doc/plugins')
diff --git a/doc/plugins/contrib/po.mdwn b/doc/plugins/contrib/po.mdwn
index 0fd06cb81..f90ffeed2 100644
--- a/doc/plugins/contrib/po.mdwn
+++ b/doc/plugins/contrib/po.mdwn
@@ -160,3 +160,6 @@ Any thoughts on this?
>>>>> I am able to do myself in this area. --[[intrigeri]]
>>>>>>
>>>>>> I came up with a patch for the WrapI18N issue --[[Joey]]
+
+I've set this plugin development aside for a while. I will be back and
+finish it at some point in the first quarter of 2009. --[[intrigeri]]
--
cgit v1.2.3
From ecf2408bf64de1aee3bb8b79f6e28c14b52cf1c4 Mon Sep 17 00:00:00 2001
From: Joey Hess
Date: Tue, 23 Dec 2008 16:25:52 -0500
Subject: fix a few directives using the old syntax
I'm turning on prefix_directives for the live wiki now.
---
doc/plugins/aggregate/discussion.mdwn | 2 +-
doc/tips/inside_dot_ikiwiki.mdwn | 2 +-
doc/todo/support_creole_markup.mdwn | 2 +-
doc/todo/syntax_highlighting.mdwn | 8 ++++----
doc/users/xma.mdwn | 2 +-
5 files changed, 8 insertions(+), 8 deletions(-)
(limited to 'doc/plugins')
diff --git a/doc/plugins/aggregate/discussion.mdwn b/doc/plugins/aggregate/discussion.mdwn
index 1db6240d5..1a9844577 100644
--- a/doc/plugins/aggregate/discussion.mdwn
+++ b/doc/plugins/aggregate/discussion.mdwn
@@ -35,7 +35,7 @@ Two things aren't working as I'd expect:
> problem. You can see the feed validator complain about it here:
>
>
-> It's sorta unfortunate that [[cpan XML::Feed]] doesn't just assume the
+> It's sorta unfortunate that [[!cpan XML::Feed]] doesn't just assume the
> un-esxaped html is part of the description field. Probably other feed
> parsers are more lenient. --[[Joey]]
diff --git a/doc/tips/inside_dot_ikiwiki.mdwn b/doc/tips/inside_dot_ikiwiki.mdwn
index 1f76ce4bd..b81ffae8d 100644
--- a/doc/tips/inside_dot_ikiwiki.mdwn
+++ b/doc/tips/inside_dot_ikiwiki.mdwn
@@ -66,7 +66,7 @@ to do it rarely, and the data I've wanted has been different each time.
## the session database
-`.ikiwiki/sessions.db` is the session database. See the [[cpan CGI::Session]]
+`.ikiwiki/sessions.db` is the session database. See the [[!cpan CGI::Session]]
documentation for more details.
## lockfiles
diff --git a/doc/todo/support_creole_markup.mdwn b/doc/todo/support_creole_markup.mdwn
index b0ebf5b9e..5a1e1286d 100644
--- a/doc/todo/support_creole_markup.mdwn
+++ b/doc/todo/support_creole_markup.mdwn
@@ -12,7 +12,7 @@ And there is a perl module: Text::WikiCreole
Syntax file for vim: http://www.peter-hoffmann.com/code/vim/ (Since a typical ikiwiki user usually use external editors. :))
-> Should be pretty easy to add a plugin to do it using [[cpan
+> Should be pretty easy to add a plugin to do it using [[!cpan
> Text::WikiCreole]]. --[[Joey]]
[[done]]
diff --git a/doc/todo/syntax_highlighting.mdwn b/doc/todo/syntax_highlighting.mdwn
index 3de3032b3..d9a791c6f 100644
--- a/doc/todo/syntax_highlighting.mdwn
+++ b/doc/todo/syntax_highlighting.mdwn
@@ -7,16 +7,16 @@ pages, as well as doing syntax highlighting as a preprocessor directive
## The big list of possibilities
-* [[plugins/contrib/highlightcode]] uses [[cpan Syntax::Highlight::Engine::Kate]],
+* [[plugins/contrib/highlightcode]] uses [[!cpan Syntax::Highlight::Engine::Kate]],
operates on whole source files only, has a few bugs (see
[here](http://u32.net/Highlight_Code_Plugin/), and needs to be updated to
support [[bugs/multiple_pages_with_same_name]].
-* [[cpan IkiWiki-Plugin-syntax]] only operates as a directive.
+* [[!cpan IkiWiki-Plugin-syntax]] only operates as a directive.
Interestingly, it supports multiple highlighting backends, including Kate
and Vim.
* [[plugins/contrib/syntax]] only operates as a directive
([[not_on_source_code_files|automatic_use_of_syntax_plugin_on_source_code_files]]),
- and uses [[cpan Text::VimColor]].
+ and uses [[!cpan Text::VimColor]].
* [[plugins/contrib/sourcehighlight]] uses src-highlight, and operates on
whole source files only. Needs to be updated to
support [[bugs/multiple_pages_with_same_name]].
@@ -43,7 +43,7 @@ pages, as well as doing syntax highlighting as a preprocessor directive
inside source files. Doing this probably means post-processing the
results of the highlighting engine, to find places where it's highlighted
comments, and then running them through the ikiwiki rendering pipeline.
- This seems fairly doable with [[cpan Syntax::Highlight::Engine::Kate]],
+ This seems fairly doable with [[!cpan Syntax::Highlight::Engine::Kate]],
at least.
* The whole-file plugins tend to have a problem that things that look like
wikilinks in the source code get munged into links by ikiwiki, which can
diff --git a/doc/users/xma.mdwn b/doc/users/xma.mdwn
index 97a8ef869..89f2ff74c 100644
--- a/doc/users/xma.mdwn
+++ b/doc/users/xma.mdwn
@@ -9,7 +9,7 @@ Anyway, [[ikiwiki]] is really *awesome* !
## More about me
-I am CLI user living in the linux console. More precisely, I live in an [[GNU Emacs]] frame all day long. My main computer is an EeePC 901 running Slackware GNU/Linux 12.1. I do not have X installed (too lazy) but when in X, I am running an instance of [[CLFSWM]].
+I am CLI user living in the linux console. More precisely, I live in an [[GNU_Emacs]] frame all day long. My main computer is an EeePC 901 running Slackware GNU/Linux 12.1. I do not have X installed (too lazy) but when in X, I am running an instance of [[CLFSWM]].
## Contacting me
--
cgit v1.2.3
From 7da319efc69089662f9635216bbcc48ca53fe606 Mon Sep 17 00:00:00 2001
From: Joey Hess
Date: Fri, 26 Dec 2008 16:08:33 -0500
Subject: 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.)
---
IkiWiki.pm | 16 ++++++++++------
IkiWiki/Plugin/inline.pm | 4 ++--
debian/changelog | 2 ++
doc/plugins/write.mdwn | 4 ++--
4 files changed, 16 insertions(+), 10 deletions(-)
(limited to 'doc/plugins')
diff --git a/IkiWiki.pm b/IkiWiki.pm
index cc1e89acc..54e00ec7b 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -1536,15 +1536,19 @@ sub run_hooks ($$) {
my $sub=shift;
if (exists $hooks{$type}) {
- my @deferred;
+ my (@first, @middle, @last);
foreach my $id (keys %{$hooks{$type}}) {
- if ($hooks{$type}{$id}{last}) {
- push @deferred, $id;
- next;
+ if ($hooks{$type}{$id}{first}) {
+ push @first, $id;
+ }
+ elsif ($hooks{$type}{$id}{last}) {
+ push @last, $id;
+ }
+ else {
+ push @middle, $id;
}
- $sub->($hooks{$type}{$id}{call});
}
- foreach my $id (@deferred) {
+ foreach my $id (@first, @middle, @last) {
$sub->($hooks{$type}{$id}{call});
}
}
diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm
index 8490b455f..58da0beb8 100644
--- a/IkiWiki/Plugin/inline.pm
+++ b/IkiWiki/Plugin/inline.pm
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+!/usr/bin/perl
# Page inlining and blogging.
package IkiWiki::Plugin::inline;
@@ -22,7 +22,7 @@ sub import {
call => \&IkiWiki::preprocess_inline);
hook(type => "pagetemplate", id => "inline",
call => \&IkiWiki::pagetemplate_inline);
- hook(type => "format", id => "inline", call => \&format);
+ hook(type => "format", id => "inline", call => \&format, first => 1);
# Hook to change to do pinging since it's called late.
# This ensures each page only pings once and prevents slow
# pings interrupting page builds.
diff --git a/debian/changelog b/debian/changelog
index 96a70fcc9..0fa6590f0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,8 @@ ikiwiki (2.72) UNRELEASED; urgency=low
* camelcase: Add camelcase_ignore setting.
* googlecalendar: Add runtime deprecation warning.
* comments: Deal with users entering unqualified or partial urls.
+ * inline: Run format hook first, to ensure other format hooks can affect
+ inlined content. Closes: #509710
-- Joey Hess Mon, 22 Dec 2008 19:02:16 -0500
diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn
index b6fa96f91..9b5cf27f7 100644
--- a/doc/plugins/write.mdwn
+++ b/doc/plugins/write.mdwn
@@ -55,8 +55,8 @@ plugin, and a "call" parameter, which tells what function to call for the
hook.
An optional "last" parameter, if set to a true value, makes the hook run
-after all other hooks of its type. Useful if the hook depends on some other
-hook being run first.
+after all other hooks of its type, and an optional "first" parameter makes
+it run first. Useful if the hook depends on some other hook being run first.
## Types of hooks
--
cgit v1.2.3