summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhttp://smcv.pseudorandom.co.uk/ <http://smcv.pseudorandom.co.uk/@web>2009-01-18 09:52:51 -0500
committerJoey Hess <joey@kitenet.net>2009-01-18 09:52:51 -0500
commit5f80ac3202e61440d3a0fbcc486e13c16309d5ad (patch)
tree998d01b8a3e4f17b4a2f0e3ae9c1ee4a85cd833b
parentaecc45bd20d19f6870ffb4b0ebcf33fe8afc5685 (diff)
underlay plugin, a command-line interface for add_underlay()
-rw-r--r--doc/plugins/contrib/underlay.mdwn55
1 files changed, 55 insertions, 0 deletions
diff --git a/doc/plugins/contrib/underlay.mdwn b/doc/plugins/contrib/underlay.mdwn
new file mode 100644
index 000000000..94651f1d3
--- /dev/null
+++ b/doc/plugins/contrib/underlay.mdwn
@@ -0,0 +1,55 @@
+[[!template id=plugin name=underlay author="[[Simon_McVittie|smcv]]"]]
+[[!tag type/useful]]
+
+This plugin adds an `add_underlays` option to the `.setup` file.
+Its value is a list of underlay directories whose content is added to the wiki.
+
+Multiple underlays are normally set up automatically by other plugins (for
+instance, the smiley images used by [[plugins/smileys]]), but they can also be
+used as a way to pull in external files that you don't want in revision control,
+like photos or software releases.
+
+Directories in `add_underlays` should usually be absolute. If relative, they're
+interpreted as relative to the parent directory of the basewiki underlay, which
+is probably not particularly useful in this context.
+
+ #!/usr/bin/perl
+ package IkiWiki::Plugin::underlay;
+ # Copyright © 2008 Simon McVittie <http://smcv.pseudorandom.co.uk/>
+ # Licensed under the GNU GPL, version 2, or any later version published by the
+ # Free Software Foundation
+
+ use warnings;
+ use strict;
+ use IkiWiki 2.00;
+
+ sub import {
+ hook(type => "getsetup", id => "underlay", call => \&getsetup);
+ hook(type => "checkconfig", id => "underlay", call => \&checkconfig);
+ }
+
+ sub getsetup () {
+ return
+ plugin => {
+ safe => 0,
+ rebuild => undef,
+ },
+ add_underlays => {
+ type => "string",
+ default => [],
+ description => "extra underlay directories to add",
+ advanced => 1,
+ safe => 0,
+ rebuild => 1,
+ },
+ }
+
+ sub checkconfig () {
+ return unless exists $config{add_underlays};
+
+ foreach my $dir (@{$config{add_underlays}}) {
+ add_underlay($dir);
+ }
+ }
+
+ 1;