summaryrefslogtreecommitdiff
path: root/doc/plugins
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2009-05-19 13:07:47 -0400
committerJoey Hess <joey@gnu.kitenet.net>2009-05-19 13:07:47 -0400
commitef003f48f4a3fe8fb67fda62c70a299b07d75976 (patch)
treecb5972026e6beed91b5eca2fa4962790244062bd /doc/plugins
parent53b1c6f559c1d09fbdbc28c8e4d5090dd455cd26 (diff)
parent4c5987d150b26f638494638f7861fb7646542a37 (diff)
Merge branch 'master' into po
Conflicts: debian/changelog
Diffstat (limited to 'doc/plugins')
-rw-r--r--doc/plugins/blogspam.mdwn8
-rw-r--r--doc/plugins/contrib/default_content_for___42__copyright__42___and___42__license__42__.mdwn12
-rw-r--r--doc/plugins/contrib/po.mdwn20
-rw-r--r--doc/plugins/openid/discussion.mdwn14
-rw-r--r--doc/plugins/passwordauth/discussion.mdwn72
-rw-r--r--doc/plugins/toggle/discussion.mdwn28
-rw-r--r--doc/plugins/write.mdwn49
7 files changed, 186 insertions, 17 deletions
diff --git a/doc/plugins/blogspam.mdwn b/doc/plugins/blogspam.mdwn
index 1d152faac..a13b6e8f4 100644
--- a/doc/plugins/blogspam.mdwn
+++ b/doc/plugins/blogspam.mdwn
@@ -7,12 +7,18 @@ This plugin adds antispam support to ikiwiki, using the
appear to contain spam will be rejected; comments that look spammy will be
stored in a queue for moderation by an admin.
+To check for and moderate comments, log in to the wiki as an admin,
+go to your Preferences page, and click the "Comment Moderation" button.
+
The plugin requires the [[!cpan RPC::XML]] perl module.
You can control how content is tested via the `blogspam_options` setting.
The list of options is [here](http://blogspam.net/api/testComment.html#options).
By default, the options are configured in a way that is appropriate for
-wiki content. This includes turning off some of the more problimatic tests.
+wiki content. This includes turning off some of the more problematic tests.
+An interesting option for testing is `fail`, by setting it (e.g.,
+`blogspam_options => 'fail'`), *all* comments will be marked as SPAM, so that
+you can check whether the interaction with blogspam.net works.
The `blogspam_pagespec` setting is a [[ikiwiki/PageSpec]] that can be
used to configure which pages are checked for spam. The default is to check
diff --git a/doc/plugins/contrib/default_content_for___42__copyright__42___and___42__license__42__.mdwn b/doc/plugins/contrib/default_content_for___42__copyright__42___and___42__license__42__.mdwn
index adb414ffb..5e3db3d7c 100644
--- a/doc/plugins/contrib/default_content_for___42__copyright__42___and___42__license__42__.mdwn
+++ b/doc/plugins/contrib/default_content_for___42__copyright__42___and___42__license__42__.mdwn
@@ -6,8 +6,11 @@
Someone was just asking for it and I had written these two plugins already some months ago,
so I'm now publishing them here.
-<http://www.schwinge.homeip.net/~thomas/tmp/copyright.pm>
-<http://www.schwinge.homeip.net/~thomas/tmp/license.pm>
+[`copyright.pm`](http://www.schwinge.homeip.net/~thomas/tmp/copyright.pm)
+and
+[`license.pm`](http://www.schwinge.homeip.net/~thomas/tmp/license.pm)
+
+Usage instructions are found inside the two plugin files.
--[[tschwinge]]
@@ -28,6 +31,11 @@ those plugins with a current ikiwiki release, i.e. 2.61, but they appeared to do
nothing, really. Also, those example pages don't seem to use those plugins, even;
they set "copyright" and "license" properties using ordinary [[meta]] tags. Maybe
I'm missing something terribly obvious? --Peter
+
> Only obvious if you read the source :-). You need to put a file named "copyright.html"
>(respectively "license.html") in your wiki. Everything underneath that (in the wikilink sense) will use that
>content for the license or copyright. Saves putting \[[meta license="foo"]] in every page [[DavidBremner]]
+
+By the way: these need not be *HTML* files; `copyright.mdwn`,
+respectively `license.mdwn`, or every other format supported
+by ikiwiki are likewise fine. --[[tschwinge]]
diff --git a/doc/plugins/contrib/po.mdwn b/doc/plugins/contrib/po.mdwn
index 61ec53ea8..13176aac4 100644
--- a/doc/plugins/contrib/po.mdwn
+++ b/doc/plugins/contrib/po.mdwn
@@ -360,12 +360,30 @@ daring a timid "please pull"... or rather, please review again :)
> * What's the reasoning behind checking that the link plugin
> is enabled? AFAICS, the same code in the scan hook should
> also work when other link plugins like camelcase are used.
+>>
+>> That's right, fixed.
+>>
> * In `pagetemplate` there is a comment that claims the code
> relies on `genpage`, but I don't see how it does; it seems
> to always add a discussion link?
+>>
+>> It relies on IkiWiki::Render's `genpage` as this function sets the
+>> `discussionlink` template param iff it considers a discussion link
+>> should appear on the current page. That's why I'm testing
+>> `$template->param('discussionlink')`.
+>>
> * Is there any real reason not to allow removing a translation?
> I'm imagining a spammy translation, which an admin might not
> be able to fix, but could remove.
+>>
+>> On the other hand, allowing one to "remove" a translation would
+>> probably lead to misunderstandings, as such a "removed" translation
+>> page would appear back as soon as it is "removed" (with no strings
+>> translated, though). I think an admin would be in a position to
+>> delete the spammy `.po` file by hand using whatever VCS is in use.
+>> Not that I'd really care, but I am slightly in favour of the way
+>> it currently works.
+>>
> * Re the meta title escaping issue worked around by `change`.
> I suppose this does not only affect meta, but other things
> at scan time too. Also, handling it only on rebuild feels
@@ -383,4 +401,6 @@ daring a timid "please pull"... or rather, please review again :)
>
> --[[Joey]]
>>
+>> I'll think about it soon.
+>>
>> --[[intrigeri]]
diff --git a/doc/plugins/openid/discussion.mdwn b/doc/plugins/openid/discussion.mdwn
index 66c431868..39e947b82 100644
--- a/doc/plugins/openid/discussion.mdwn
+++ b/doc/plugins/openid/discussion.mdwn
@@ -6,4 +6,16 @@ It is scheduled for 2007-12-20 18:00 UTC.
See <http://umeet.uninet.edu/umeet2007/english/prog.html> for the complete program
and for information about how to join.
---[[tschwinge]] \ No newline at end of file
+--[[tschwinge]]
+
+----
+<a id="Yahoo_unsupported" />
+[[!tag bugs]]
+
+It looks like OpenID 2.0 (the only supported by Yahoo) is not supported in ikiwiki. :( I signed up at http://openid.yahoo.com/ , and tried to login to my ikiwiki with the new ID (of the form: https://me.yahoo.com/a-username), but Yahoo told me:
+
+> Sorry! You will not be able to login to this website as it is using an older version of the the OpenID technology. Yahoo! only supports OpenID 2.0 because it is more secure. For more information, check out the OpenID documentation at [Yahoo! Developer Network](http://developer.yahoo.com/openid/).
+
+-- Ivan Z.
+
+They have more on OpenID 2.0 in [their FAQ](http://developer.yahoo.com/openid/faq.html). --Ivan Z.
diff --git a/doc/plugins/passwordauth/discussion.mdwn b/doc/plugins/passwordauth/discussion.mdwn
index 672970c21..50e21062e 100644
--- a/doc/plugins/passwordauth/discussion.mdwn
+++ b/doc/plugins/passwordauth/discussion.mdwn
@@ -77,3 +77,75 @@ as the script handler, or only on `mod_perl` to be installed and loaded.
* [http://www.openfusion.com.au/labs/mod_auth_tkt/](mod_auth_tkt) along with CPAN's
`Apache::AuthTkt`
--[[intrigeri]]
+
+I've more or less managed to implement something based on `mod_perl` and
+`Apache::AuthenHook`, respectively in Debian packages `libapache2-mod-perl2`
+and `libapache-authenhook-perl`.
+
+In the Apache VirtualHost configuration, I have added the following:
+
+ PerlLoadModule Apache::AuthenHook
+ PerlModule My::IkiWikiBasicProvider
+
+ <Location /test/>
+ AuthType Basic
+ AuthName "wiki"
+ AuthBasicProvider My::IkiWikiBasicProvider
+ Require valid-user
+ ErrorDocument 401 /test/ikiwiki.cgi?do=signin
+ </Location>
+ <LocationMatch "^/test/(ikiwiki\.cgi$|.*\.css$|wikiicons/)">
+ Satisfy any
+ </LocationMatch>
+
+The perl module lies in `/etc/apache2/My/IkiWikiBasicProvider.pm`:
+
+ package My::IkiWikiBasicProvider;
+
+ use warnings;
+ use strict;
+ use Apache2::Const -compile => qw(OK DECLINED HTTP_UNAUTHORIZED);
+ use Storable;
+ use Authen::Passphrase;
+
+ sub userinfo_retrieve () {
+ my $userinfo=eval{ Storable::lock_retrieve("/var/lib/ikiwiki/test/.ikiwiki/userdb") };
+ return $userinfo;
+ }
+
+ sub handler {
+ my ($r, $user, $password) = @_;
+ my $field = "password";
+
+ if (! defined $password || ! length $password) {
+ return Apache2::Const::DECLINED;
+ }
+ my $userinfo = userinfo_retrieve();
+ if (! length $user || ! defined $userinfo ||
+ ! exists $userinfo->{$user} || ! ref $userinfo->{$user}) {
+ return Apache2::Const::DECLINED;
+ }
+ my $ret=0;
+ if (exists $userinfo->{$user}->{"crypt".$field}) {
+ error $@ if $@;
+ my $p = Authen::Passphrase->from_crypt($userinfo->{$user}->{"crypt".$field});
+ $ret=$p->match($password);
+ }
+ elsif (exists $userinfo->{$user}->{$field}) {
+ $ret=$password eq $userinfo->{$user}->{$field};
+ }
+ if ($ret) {
+ return Apache2::Const::OK;
+ }
+ return Apache2::Const::DECLINED;
+ }
+
+ 1;
+
+This setup also allows people with the master password to create their own
+account.
+
+I'm not really fluent in Perl, and all this can probably be improved (*or
+might destroy your computer as it is* and YMMV).
+
+-- [[Lunar]]
diff --git a/doc/plugins/toggle/discussion.mdwn b/doc/plugins/toggle/discussion.mdwn
index 5426a62fc..e48eef5ba 100644
--- a/doc/plugins/toggle/discussion.mdwn
+++ b/doc/plugins/toggle/discussion.mdwn
@@ -1,7 +1,7 @@
## Nested plugins
Is it possible to use another plugin into your toggle plugin? For example,
-I want to have toggleable table and try to use Victor Moral's table plugin,
+I want to have toggleable table and try to use [[Victor Moral|users/victormoral]]'s [[table plugin|plugins/table]],
but no success. How can I do it?
--PTecza
@@ -15,3 +15,29 @@ but no success. How can I do it?
## [[bugs/Bug_when_toggling_in_a_preview_page]]
+
+----
+
+## Using toggle directives in a list item##
+Take this code snippet.
+
+ * [[!toggle id="test" text="test"]]
+ [[!toggleable id="test text="""toggle"""]]
+
+In the HTML-output the `ul` and `div` overlap.
+
+ <div id="content">
+ <ul>
+ <li><a class="toggle" href="#test.test">test</a>
+ <div class="toggleable" id="test.-test"></li>
+ </ul>
+
+ <p>toggle</p>
+
+ </div>
+
+ </div>
+
+Fixing this manually the Javascript seems not to be working and `toggle` is shown unconditionally.
+
+I do not know if this is due to [[shortcomming with nested preprocessor directives|todo/nested_preprocessor_directives]] you mentioned in the beginning of this page. Maybe a note could be added to the main page of the plugin. --Paul
diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn
index cccfb9bba..ac0935773 100644
--- a/doc/plugins/write.mdwn
+++ b/doc/plugins/write.mdwn
@@ -98,7 +98,7 @@ function is passed no values.
This allows a plugin to manipulate the list of files that need to be
built when the wiki is refreshed. The function is passed a reference to an
-array of pages that will be rebuilt, and can modify the array, either
+array of files that will be rebuilt, and can modify the array, either
adding or removing files from it.
### scan
@@ -107,8 +107,8 @@ adding or removing files from it.
This hook is called early in the process of building the wiki, and is used
as a first pass scan of the page, to collect metadata about the page. It's
-mostly used to scan the page for [[WikiLinks|ikiwiki/WikiLink]], and add them to `%links`.
-Present in IkiWiki 2.40 and later.
+mostly used to scan the page for [[WikiLinks|ikiwiki/WikiLink]], and add
+them to `%links`. Present in IkiWiki 2.40 and later.
The function is passed named parameters "page" and "content". Its return
value is ignored.
@@ -151,11 +151,11 @@ parameter is set to a true value if the page is being previewed.
If `hook` is passed an optional "scan" parameter, set to a true value, this
makes the hook be called during the preliminary scan that ikiwiki makes of
updated pages, before begining to render pages. This should be done if the
-hook modifies data in `%links`. Note that doing so will make the hook be
-run twice per page build, so avoid doing it for expensive hooks. (As an
-optimisation, if your preprocessor hook is called in a void context, you
-can assume it's being run in scan mode, and avoid doing expensive things at
-that point.)
+hook modifies data in `%links` (typically by calling `add_link`). Note that
+doing so will make the hook be run twice per page build, so avoid doing it
+for expensive hooks. (As an optimisation, if your preprocessor hook is
+called in a void context, you can assume it's being run in scan mode, and
+avoid doing expensive things at that point.)
Note that if the [[htmlscrubber]] is enabled, html in
preprocessor [[ikiwiki/directive]] output is sanitised, which may limit what
@@ -174,7 +174,8 @@ links. The function is passed named parameters "page", "destpage", and
and later.
Plugins that implement linkify must also implement a scan hook, that scans
-for the links on the page and adds them to `%links`.
+for the links on the page and adds them to `%links` (typically by calling
+`add_link`).
### htmlize
@@ -197,6 +198,9 @@ value, then the id parameter specifies not a filename extension, but
a whole filename that can be htmlized. This is useful for files
like `Makefile` that have no extension.
+If `hook` is passed an optional "longname" parameter, this value is used
+when prompting a user to choose a page type on the edit page form.
+
### pagetemplate
hook(type => "pagetemplate", id => "foo", call => \&pagetemplate);
@@ -612,6 +616,19 @@ The most often used is "location", which specifies the location the
PageSpec should match against. If not passed, relative PageSpecs will match
relative to the top of the wiki.
+#### `pagespec_match_list($$;@)`
+
+Passed a reference to a list of page names, and [[ikiwiki/PageSpec]],
+returns the set of pages that match the [[ikiwiki/PageSpec]].
+
+Additional named parameters can be passed, to further limit the match.
+The most often used is "location", which specifies the location the
+PageSpec should match against. If not passed, relative PageSpecs will match
+relative to the top of the wiki.
+
+Unlike pagespec_match, this may throw an error if there is an error in
+the pagespec.
+
#### `bestlink($$)`
Given a page and the text of a link on the page, determine which
@@ -780,6 +797,11 @@ Optionally, a third parameter can be passed, to specify the preferred
filename of the page. For example, `targetpage("foo", "rss", "feed")`
will yield something like `foo/feed.rss`.
+#### `add_link($$)`
+
+This adds a link to `%links`, ensuring that duplicate links are not
+added. Pass it the page that contains the link, and the link text.
+
## Miscellaneous
### Internal use pages
@@ -930,9 +952,12 @@ It's also possible to write plugins that add new functions to
IkiWiki::PageSpec package, that is named `match_foo`, where "foo()" is
how it will be accessed in a [[ikiwiki/PageSpec]]. The function will be passed
two parameters: The name of the page being matched, and the thing to match
-against. It may also be passed additional, named parameters. It should return
-a IkiWiki::SuccessReason object if the match succeeds, or an
-IkiWiki::FailReason object if the match fails.
+against. It may also be passed additional, named parameters.
+
+It should return a IkiWiki::SuccessReason object if the match succeeds, or
+an IkiWiki::FailReason object if the match fails. If the match cannot be
+attempted at all, for any page, it can instead return an
+IkiWiki::ErrorReason object explaining why.
### Setup plugins