These plugins are provided by third parties and are not currently included in ikiwiki. See install for installation help.

I don't find org.pm in git branch. The steps are:

  1. git clone git://github.com/wking/ikiwiki.git
  2. cd ikiwiki
  3. find . | grep org.pm

I've taken the name from http://www.golden-gryphon.com/software/misc/org.pm.html

Posted Fri 06 May 2016 07:59:44 AM UTC

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).

Template

<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.

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.

Posted Fri 06 May 2016 07:59:44 AM UTC Tags:

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

Available in a git repository branch.
Branch: anarcat/admonitions
Author: anarcat

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.

Posted Fri 06 May 2016 07:59:44 AM UTC Tags:

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 first
  • size - if not full, the img in the viewer page will be resized to be no larger than this
  • thumbnailsize - the img in the album page, which can also be used in the previous/next links, will be no larger than this
  • viewertemplate - the template used for the albumimage in each viewer page
  • prevtemplate - the template used to replace <TMPL_VAR PREV> if used in the viewer page
  • nexttemplate - the template used to replace <TMPL_VAR NEXT> if used in the viewer page
Posted Fri 06 May 2016 07:59:44 AM UTC

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

Altered Demo

Available in a git repository branch.
Branch: cbaines/album

This uses the album plugin, with some altered css, and with the css applied to all of the themes.

Installation

Available in a git repository branch.
Branch: smcv/album5
Author: Simon McVittie

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):

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, typically JPEG

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 or mov 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 and debconf/monday are both albums, then debconf/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 and p100.png, one will get a viewer page called p100 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 an exiftool plugin using Image::ExifTool as a reference implementation of that hook, but has lost that code somewhere :-(

  • There 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 and webphotos
    • photos contains full resolution photos with EXIF tags
    • for each photo that exists in photos but not in webphotos, the album plugin automatically resamples it down to a web-compatible resolution (smcv uses up to 640x640), optimizes it with jpegoptim, strips out all EXIF tags, and and writes it into the corresponding location in webphotos
    • webphotos is what you rsync to the web server
    • the web server's ikiwiki only has webphotos as an underlay
  • 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.

Posted Fri 06 May 2016 07:59:44 AM UTC Tags:

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 and description are short-cuts for the corresponding meta directives

  • caption 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.

Posted Fri 06 May 2016 07:59:44 AM UTC

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' -->
Posted Fri 06 May 2016 07:59:44 AM UTC

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.
Posted Fri 06 May 2016 07:59:44 AM UTC Tags:

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.
Posted Fri 06 May 2016 07:59:44 AM UTC

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
Posted Fri 06 May 2016 07:59:44 AM UTC Tags: