These plugins are provided by third parties and are not currently included in ikiwiki. See install for installation help.
- addtag
- admonition
- 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
- listsubscribe
- livefyre
- localfavicon
- mailbox
- mandoc
- mathjax
- mediawiki
- monthcalendar
- mscgen
- navbar
- newpage
- nimble
- opengraph
- opml
- org mode
- pagespec alias
- pandoc
- parenttag
- plusone
- pod
- poetry
- postal
- purge
- remark
- 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.
Plugin: admonition
Author: anarcat
Included in ikiwiki: no
Enabled by default: no
Included in goodstuff: no
Currently enabled: no
Admonitions
This plugin adds directives that allow users to outline certain sections of text using a custom style sheet and bright icons.
5 directives are available:
- tip
- note
- important
- caution
- warning
Or, in Ikiwiki markup:
[[!tip "Lorem ipsum dolor sit amet, consectetuer adipiscing elit."]]
[[!note "Vivamus id enim."]]
[[!important "In id erat non orci commodo lobortis."]]
[[!caution "In id erat non orci commodo lobortis."]]
[[!warning "Phasellus neque orci, porta a, aliquet quis, semper a, massa."]]
Those directives simply create a <div>
elements in the right
style. So the above can also be simply written as:
<div class="tip">Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</div>
<div class="note">Vivamus id enim.</div>
<div class="important">In id erat non orci commodo lobortis.</div>
<div class="caution">In id erat non orci commodo lobortis.</div>
<div class="warning">Phasellus neque orci, porta a, aliquet quis, semper a, massa.</div>
Rationale
The idea behind the directives is to make the the CSS elements easier to discover through the builtin documentation. Obviously, more admonitions can be created simply by adding similar icons and CSS elements. Of course, you will not get the above directives expanded automatically unless you patch the admonition plugin, unfortunately.
Code
The patch is available from anarcat's "admonition" branch and is designed to be merged in Ikiwiki directly:
git clone -b admonitions git://src.anarc.at/ikiwiki.git
See also admonitions for the discussion leading to the creation of this plugin.
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