These plugins are provided by third parties and are not currently included in ikiwiki. See install for installation help.
- addtag
- album
- asciidoc
- asymptote
- attach
- bibtex
- compile
- cowsay
- created in future
- datetime cmp
- default content for *copyright* and *license*
- field
- flattr
- ftemplate
- gallery
- getfield
- googlemaps
- groupfile
- highlightcode
- imailhide
- img
- irclog
- jscalendar
- jssearchfield
- justlogin
- linguas
- livefyre
- localfavicon
- mailbox
- mandoc
- mathjax
- mediawiki
- monthcalendar
- mscgen
- navbar
- newpage
- nimble
- opengraph
- opml
- org mode
- pagespec alias
- pandoc
- parenttag
- plusone
- pod
- poetry
- postal
- purge
- report
- sar
- screenplay.pm
- sidebar2
- signinview
- siterel2pagerel
- sourcehighlight
- sqlite_search
- syntax
- taskreport
- tex4ht
- texinfo
- tracking
- unixauth
- unixrelpagespec
- video
- wordcount
- xslt
- ymlfront
I don't find org.pm in git branch. The steps are:
- git clone git://github.com/wking/ikiwiki.git
- cd ikiwiki
- find . | grep org.pm
I've taken the name from http://www.golden-gryphon.com/software/misc/org.pm.html
Plugin: addtag
Author: Louis
Included in ikiwiki: no
Enabled by default: no
Included in goodstuff: no
Currently enabled: no
Addtag
This plugin adds links in the edit page to tag pages by clicking on tag links (instead of manually typing the tag directive).
Template
The editpage template has to be modified to enable this: the following code has to be inserted where you want this feature to appear (right after the attachment link seems a good place).
<TMPL_IF NAME="ADDTAG">
<a class="toggle" href="#addtag">Tags</a>
<TMPL_VAR ADDTAG>
<span class="addtag">
<div class="toggleable" id="addtag">
<em>
Enable Javascript to add tags by simply clicking on them.
</em>
</div>
</span>
</TMPL_IF>
CSS
I think that in this case, the tag list looks nicer as columns. To do so, add the following code to your CSS.
.addtag:after {
clear: both;
content:".";
display:block;
height:0;
visibility:hidden;
}
.addtag ul{
margin: auto;
padding: 0;
}
.addtag ul li {
list-style: none;
float: left;
margin-left: 1.5em;
}
.addtag ul ul{
margin: 0;
padding: 0;
}
.addtag ul ul li {
clear: left;
list-style-type: disc;
}
.addtag ul ul ul li {
list-style-type: circle;
}
Code
Code and documentation can be found here : https://atelier.gresille.org/projects/gresille-ikiwiki/wiki/Addtag.
The album
directive is supplied by the album plugin.
Each page containing an album
directive is treated as a photo album
or image gallery. Example usage is as simple as:
[[!album ]]
Every image attached to an album or its subpages is
considered to be part of the album. A "viewer" page, with the wiki's default
page extension, will be generated in the
transient underlay to display the
image, if there isn't already a page of the same name as the image: for
instance, if debconf
is an album and debconf/tuesday/p100.jpg
exists,
then debconf/tuesday/p100.mdwn
might be created.
The album is treated as a trail, which gives each viewer page a link back to the album, and a link to the previous and next viewer in the album.
The album
directive also produces an inline which
automatically includes all the viewers for this album, except those that
will appear in an albumsection. If every image in the album is in a
section, then the album
directive is still required, but won't produce
any output in the page.
The inline
can include some extra information about the images, including
file size and a thumbnail made using img). The
default template is albumitem.tmpl
, which takes advantage of these things.
Options
The directive can have some options for the entire album. The defaults are:
[[!album
sort="-age"
size="full"
thumbnailsize="96x96"
viewertemplate="albumviewer"
prevtemplate="albumprev"
nexttemplate="albumnext"
sort
- sets the order in which images appear, defaulting to earliest creation date firstsize
- if notfull
, the img in the viewer page will be resized to be no larger than thisthumbnailsize
- the img in the album page, which can also be used in the previous/next links, will be no larger than thisviewertemplate
- the template used for the albumimage in each viewer pageprevtemplate
- the template used to replace<TMPL_VAR PREV>
if used in the viewer pagenexttemplate
- the template used to replace<TMPL_VAR NEXT>
if used in the viewer page
Plugin: album
Author: Simon McVittie
Included in ikiwiki: no
Enabled by default: no
Included in goodstuff: no
Currently enabled: no
This plugin provides the album directive, which turns a page into a photo album or image gallery, containing all images attached to the album or its subpages. It also provides the albumsection and albumimage directives.
This plugin automatically enables the filecheck, img, inline, trail and transient plugins. The meta plugin is also recommended.
Demo
- HTML page of thumbnails as an entry point to the album
- Each thumbnail links to a "viewer" HTML page with a full size image, optional next/previous thumbnail links, and optional comments
Altered Demo
This uses the album plugin, with some altered css, and with the css applied to all of the themes.
- Simple album, rendered using mutiple themes using the ikiwiki logo.
Installation
Available from smcv's git repository, in the album5
branch.
I've called it album
to distinguish it from
contrib/gallery, although gallery
might well be
a better name for this functionality.
(The Summer of Code gallery plugin does the next/previous UI in Javascript using Lightbox, which means that individual photos can't be bookmarked in a meaningful way, and the best it can do as a fallback for non-Javascript browsers is to provide a direct link to the image.)
Updated, June 2014: integrated changes from KathrynAndersen, Lukas Lipavsky and kjs
An album6
branch is also available, but is less suitable
for manual installation since it needs core IkiWiki changes
(until trails depend on everything is fixed).
Manual installation
First, you need a version of ikiwiki with the trail plugin merged in (version 3.20120203 or later).
Manual installation requires these files (use the "raw" link in gitweb to download):
- album.pm
in an
IkiWiki/Plugin
subdirectory of your configuredplugindir
- albumviewer.tmpl,
albumitem.tmpl,
albumnext.tmpl and
albumprev.tmpl,
in your configured
templatedir
, or atemplates
subdirectory of your wiki repository - the album-related bits from the end of the stylesheet (put them in your local.css)
Changing the templates
When a viewer page is generated or inlined into an album, the template can contain these extra variables:
<TMPL_VAR ALBUM>
- page name of the album<TMPL_VAR ALBUMURL>
- relative URL to the album<TMPL_VAR ALBUMTITLE>
- title of the album, usually taken from a meta directive<TMPL_VAR CAPTION>
- caption for the image<TMPL_VAR THUMBNAIL>
- a small img for the image<TMPL_VAR IMAGEWIDTH>
- width of the full-size image in pixels<TMPL_VAR IMAGEHEIGHT>
- height of the full-size image in pixels<TMPL_VAR IMAGEFILESIZE>
- size of the image, e.g.1.2 MiB
<TMPL_VAR IMAGEFORMAT>
- format of the image, typicallyJPEG
The template for the viewer page can also contain:
<TMPL_VAR IMG>
- a large img to display the image<TMPL_VAR PREV>
- a link to the previous viewer, typically with a thumbnail<TMPL_VAR NEXT>
- a link to the next viewer, typically with a thumbnail
Including album entries elsewhere
To display images from elsewhere in the wiki with the same appearance as
an album or albumsection,
you can use an inline with the albumitem
template:
[[!inline pages="..." sort="-age" template="albumitem"]]
Bugs
There's currently a hard-coded list of extensions that are treated as images:
png
,gif
,jpg
,jpeg
ormov
files. More image and video types could be added in future.Videos aren't currently handled very well; ideally, something like totem-video-thumbnailer would be used.
The plugin doesn't do anything special to handle albums that are subpages of each other. If, say,
debconf
anddebconf/monday
are both albums, thendebconf/monday/p100.jpg
will currently be assigned to one or the other, arbitrarily. It should probably pick the closest (longest) album name. (I'm not sure that it can do this reliably, though, since the scan stage runs in an undefined order.)The plugin doesn't do anything special to handle photos with similar names. If you have
p100.jpg
andp100.png
, one will get a viewer page calledp100
and the other will be ignored. (I'm not sure what we could do better, though.)If there's no
albumimage
in a viewer page, one should probably be appended automatically.
TODO
The generated viewer page should extract as much metadata as possible from the photo's EXIF tags (creation/modification dates, author, title, caption, copyright). smcv once had a half-written implementation which runs
scanimage
hooks, and anexiftool
plugin using Image::ExifTool as a reference implementation of that hook, but has lost that code somewhereThere should be an option to reduce the size of photos and write them into an underlay (perhaps just the transient underlay), for this workflow:
- your laptop's local ikiwiki has two underlays,
photos
andwebphotos
photos
contains full resolution photos with EXIF tags- for each photo that exists in
photos
but not inwebphotos
, the album plugin automatically resamples it down to a web-compatible resolution (smcv uses up to 640x640), optimizes it withjpegoptim
, strips out all EXIF tags, and and writes it into the corresponding location inwebphotos
webphotos
is what you rsync to the web server- the web server's ikiwiki only has
webphotos
as an underlay
- your laptop's local ikiwiki has two underlays,
Eventually, there could be a specialized CGI user interface to batch-edit all the photos of an album (so for each photo, you get an edit box each for title, author, copyright etc.) - this would work by making programmatic edits to all the
albumimage
directives.
The albumimage
directive is supplied by the album plugin.
Each viewer page produced by the album directive
contains an albumimage
directive, which is replaced by an
img, wrapped in some formatting using a
template (by default it's albumviewer.tmpl
). That template can also include
links to the next and previous photos, in addition to those provided by the
trail plugin.
The next/previous links are themselves implemented by evaluating a template,
either albumnext.tmpl
or albumprev.tmpl
by default.
The directive can also have parameters:
title
,date
,updated
,author
,authorurl
,copyright
,license
anddescription
are short-cuts for the corresponding meta directivescaption
sets a caption which is displayed near this image in the album and viewer pages
The viewer page can also contain any text and markup before or after the
albumimage
directive, which will appear before or after the image in the
viewer page.
The albumsection
directive is supplied by the album plugin.
The albumsection
directive is used to split an album into sections. It can
only appear on a page that also has the album directive.
The filter
parameter is a PageSpec against which viewer pages
are matched. The albumsection
directive displays all the images that match
the filter, and the album
directive displays any leftover images, like
this:
# Holiday photos
[[!album ]]
<!-- replaced with a list of any uncategorized photos; it will be
empty if they're all tagged as 'people' and/or 'landscapes' -->
## People
[[!albumsection filter="tagged(people)"]]
<!-- replaced with a list of photos tagged 'people', including
any that are also tagged 'landscapes' -->
## Landscapes
[[!albumsection filter="tagged(landscapes)"]]
<!-- replaced with a list of photos tagged 'landscapes', including
any that are also tagged 'people' -->
Plugin: asciidoc
Author: Karl Mowson, GEychaner
Included in ikiwiki: no
Enabled by default: no
Included in goodstuff: no
Currently enabled: no
I have completely overhauled the Asciidoc plugin for ikiwiki that was created by Karl Mowson. The source can be downloaded from my Dropbox.
Features
- Uses a filter hook to escape WikiLinks and Directives using Asciidoc
+++
passthrough macros, to avoid them being processed by Asciidoc. This behavior is configurable in the wiki setup file. - Adds a preprocessor directive 'asciidoc' which allows extra Asciidoc command-line options to be passed on a per-page basis. Each parameter name is the option name (the leading
--
will be inserted automatically), and the parameter value is the option value. Currently, only 'conf-file' and 'doctype' are allowed (or even useful). - Sets the page title from the first line in the Asciidoc file using a meta directive. This behavior is configurable in the wiki setup file.
- Searches for an Asciidoc configuration file named the same as the wiki if none is specified in the setup file.
- Asciidoc configuration files are stored in the wiki. They should be named
._conf
to avoid publishing them.
Problems
- Escaping Directives is not optimal. It prevents markup from being used in Directives, and the passthrough macros have to include extra spaces to avoid having directives that return an empty string collapse to
++++++
. In addition, I had to borrow the regexps from the Ikiwiki source code; it would be nice if this were available as part of the API. - Handling of Asciidoc errors is suboptimal; they are simply inserted into the returned page. This could be fixed in Perl 5.12 by using the run_forked() in IPC::Cmd.
The asymptote
directive is supplied by the asymptote plugin.
This directive allows embedding asymptote diagrams in a page. Example usage:
[[!asymptote src="""
import geometry;
unitsize(1cm);
triangle t = triangle((0,0), (4,0), (0.5,2));
show(La="$D$", Lb="$E$", Lc="", t);
dot(t.A^^t.B^^t.C);
point pD = midpoint(t.BC); dot(pD);
point pE = midpoint(t.AC); dot(pE);
draw(pD--pE);
point A_ = (pD-t.A)*2+t.A; dot("$A'$", A_, NE);
draw(t.B--A_--t.C, dashed);
draw(t.A--A_, dashed);
point E_ = midpoint(line(t.B,A_)); dot(Label("$E'$", E_, E));
draw(E_--pD, dashed);
"""]]
The asymptote
directive supports the following parameters:
src
- The asymptote source code to render.
Plugin: asymptote
Author: Peter Simons
Included in ikiwiki: no
Enabled by default: no
Included in goodstuff: no
Currently enabled: no
This plugin provides the asymptote directive which allows embedding asymptote diagrams in a page.
Security implications: asymptote has functions for reading files and other dangerous stuff, so enabling this plugin means that everyone who can edit your Wiki can also read any file from your hard drive thats accessible to the user running Ikiwiki.
This plugin uses the Digest::SHA perl module.
The full source code is:
#! /usr/bin/perl
package IkiWiki::Plugin::asymptote;
use warnings;
use strict;
use Digest::MD5 qw(md5_hex);
use File::Temp qw(tempdir);
use HTML::Entities;
use Encode;
use IkiWiki 3.00;
sub import {
hook(type => "getsetup", id => "asymptote", call => \&getsetup);
hook(type => "preprocess", id => "asymptote", call => \&preprocess);
}
sub getsetup () {
return
plugin => {
safe => 1,
rebuild => undef,
section => "widget",
},
}
sub preprocess (@) {
my %params = @_;
my $code = $params{src};
if (! defined $code && ! length $code) {
error gettext("missing src attribute");
}
return create($code, \%params);
}
sub create ($$$) {
# This function calls the image generating function and returns
# the <img .. /> for the generated image.
my $code = shift;
my $params = shift;
my $digest = md5_hex(Encode::encode_utf8($code));
my $imglink= $params->{page} . "/$digest.png";
my $imglog = $params->{page} . "/$digest.log";
will_render($params->{page}, $imglink);
will_render($params->{page}, $imglog);
my $imgurl=urlto($imglink, $params->{destpage});
my $logurl=urlto($imglog, $params->{destpage});
if (-e "$config{destdir}/$imglink" ||
gen_image($code, $digest, $params->{page})) {
return qq{<img src="$imgurl}
.(exists $params->{alt} ? qq{" alt="} . $params->{alt} : qq{})
.qq{" class="asymptote" />};
}
else {
error qq{<a href="$logurl">}.gettext("failed to generate image from code")."</a>";
}
}
sub gen_image ($$$$) {
# Actually creates the image.
my $code = shift;
my $digest = shift;
my $imagedir = shift;
my $tmp = eval { create_tmp_dir($digest) };
if (! $@ &&
writefile("$digest.asy", $tmp, $code) &&
writefile("$imagedir/$digest.png", $config{destdir}, "") &&
system("asy -render=2 -offscreen -f png -o $config{destdir}/$imagedir/$digest.png $tmp/$digest.asy &>$tmp/$digest.log") == 0
) {
return 1;
}
else {
# store failure log
my $log="";
{
if (open(my $f, '<', "$tmp/$digest.log")) {
local $/=undef;
$log = <$f>;
close($f);
}
}
writefile("$digest.log", "$config{destdir}/$imagedir", $log);
return 0;
}
}
sub create_tmp_dir ($) {
# Create a temp directory, it will be removed when ikiwiki exits.
my $base = shift;
my $template = $base.".XXXXXXXXXX";
my $tmpdir = tempdir($template, TMPDIR => 1, CLEANUP => 1);
return $tmpdir;
}
1
Plugin: attach
Author: Ben
Included in ikiwiki: no
Enabled by default: no
Included in goodstuff: no
Currently enabled: no
Note: This plugin is currently pending upload. It is also most assuredly beta.
Most of this plugin's functionality is configured in the IkiWiki setup file (ìkiwiki.setup
, by default), in an attach
block. A minimum configuration looks something like this:
attach => {
enabled => 1, #If false, no new attachments are allowed via the web interface
every_page => 1, #Toggles whether attachments are allowed on every page of the IkiWiki
},
This configuration allows any user of the IkiWiki to attach any file to any page of the IkiWiki. By default, each file must be no bigger than 1MB.
Configuration Options
Each option is specified in the same format as above: the name is a hash key inside of an attach block, and the value is the hash key.
- ban_ips - A space separated list of regular expressions corresponding to IP addresses which are prohibited from attaching files. IP address filtering is described in further detail below.
- enabled -Toggles whether attachments are allowed. If false, the attachment form will not appear on any pages, nor will the CGI accept any new uploads. Details of existing attachments will continue to be displayed on the appropriate pages, however.
- max_kbs - The maximum size in kilobytes an attachment can be. If an upload's size exceeds this value, it will be prohibited. By default, this value is 1024. If set to 0, attachments of any size are permitted.
- dir - The name of the temporary directory, relative to the source directory, in which attachments are stored pending validation. The value is prefixed with a period so that it is hidden on *nix systems. The default value is attachments, and there shouldn't be any need to change this.
- mime_strategy - The method of filtering attachments on their MIME type. Permissible values are allow,deny and deny,allow. MIME filtering is described in further detail below.
- mime_allow - A space-separated list of MIME types, used in conjunction with mime_strategy and mime_deny. MIME filtering is described in further detail below.
- mime_deny - A space-separated list of MIME types, used in conjunction with mime_strategy and mime_allow. MIME filtering is described in further detail below.
MIME Filtering
Attachments may be filtered on the basis of their MIME type. For instance, an administrator may wish to prohibit video files from being uploaded to his IkiWiki. This is achieved by a "MIME strategy", a list of MIME types to allow, and a list of MIME types to deny.
With an allow,deny strategy: "First, all Allow directives are evaluated; at least one must match, or the [attachment] is rejected. Next, all Deny directives are evaluated. If any matches, the [attachment] is rejected. Last, any requests which do not match an Allow or a Deny directive are denied by default." (Excerpt from Apache Module: mod_access on which this feature is based).
With a deny,allow strategy: "First, all Deny directives are evaluated; if any match, the request is denied unless it also matches an Allow directive. Any requests which do not match any Allow or Deny directives are permitted." (Excerpt from Apache Module: mod_access on which this feature is based).
IP Address Filtering
Attachments added via the web can be denied on the basis of their uploader's IP address matching a blacklist.
The blacklist is defined as a space-separated list of regular expressions as a value of the ban_ips setting. For example, a value of '3 127. ^2[45]' blocks all addresses containing the number 3, containing the octet 127, and starting with a 2 followed by a 4 or 5.
Allowing Attachments Only on Specific Pages
An administrator may wish to only allow users to attach files to pages which he has chosen. To do so, he must set the every_page option to 0, then an attach preprocessor directive ("[[attach ]] to the pages on which attachments should be allowed.
Attaching Files from the Command Line
An attachment is simply a non-source file located in the source directory of the IkiWiki. The directory in which the file is located determines which page it is attached to. For example, to attach song.ogg to the music page, an administrator would simply create a music sub-directory of the source directory, if it doesn't already exist, and move song.ogg inside of it.
Files attached in this manner are not subject to any of the validation procedures. They can be of arbitrary size and type.