<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#!/usr/bin/perl
package IkiWiki::Plugin::more;

use warnings;
use strict;
use IkiWiki 3.00;

my $linktext = gettext("more");

sub import {
	hook(type =&gt; "getsetup", id =&gt; "more", call =&gt; \&amp;getsetup);
	hook(type =&gt; "preprocess", id =&gt; "more", call =&gt; \&amp;preprocess);
}

sub getsetup () {
	return
		plugin =&gt; {
			safe =&gt; 1,
			rebuild =&gt; undef,
			section =&gt; "widget",
		},
}

sub preprocess (@) {
	my %params=@_;

	$params{linktext} = $linktext unless defined $params{linktext};

	if ($params{page} ne $params{destpage}) {
		return "\n".
			htmllink($params{page}, $params{destpage}, $params{page},
				linktext =&gt; $params{linktext},
				anchor =&gt; "more");
	}
	else {
		return "&lt;a name=\"more\"&gt;&lt;/a&gt;\n\n".
			IkiWiki::preprocess($params{page}, $params{destpage},
				$params{text});
	}
}

1
</pre></body></html>