* fortune plugin (trivial)
parent
ee3e0e3c50
commit
d9633de2ce
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/perl
|
||||
# Include a fortune in a page
|
||||
package IkiWiki::Plugin::fortune;
|
||||
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
sub import { #{{{
|
||||
IkiWiki::hook(type => "preprocess", id => "fortune",
|
||||
call => \&preprocess);
|
||||
} # }}}
|
||||
|
||||
sub preprocess (@) { #{{{
|
||||
$ENV{PATH}="$ENV{PATH}:/usr/games:/usr/local/games";
|
||||
my $f = `fortune`;
|
||||
|
||||
if ($?) {
|
||||
return "[[fortune failed]]";
|
||||
}
|
||||
else {
|
||||
return "<pre>$f</pre>\n";
|
||||
}
|
||||
} # }}}
|
||||
|
||||
1
|
|
@ -17,7 +17,8 @@ extra_build:
|
|||
--exclude=/discussion --no-discussion \
|
||||
--plugin=brokenlinks --plugin=pagecount \
|
||||
--plugin=orphans --plugin=haiku --plugin=meta \
|
||||
--plugin=tag --plugin=polygen --plugin=pagestats
|
||||
--plugin=tag --plugin=polygen --plugin=pagestats \
|
||||
--plugin=fortune
|
||||
./mdwn2man ikiwiki 1 doc/usage.mdwn > ikiwiki.man
|
||||
./mdwn2man ikiwiki-mass-rebuild 8 doc/ikiwiki-mass-rebuild.mdwn > ikiwiki-mass-rebuild.man
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ ikiwiki (1.12) unstable; urgency=low
|
|||
* Allow preprocessor directives to be expanded in inlined blog pages.
|
||||
However, to avoid inlining loops etc, don't expand inline directives in
|
||||
inlined pages.
|
||||
* fortune plugin (trivial)
|
||||
|
||||
-- Joey Hess <joeyh@debian.org> Sat, 29 Jul 2006 17:12:56 -0400
|
||||
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
This just uses the `fortune` program to insert a fortune into the page.
|
||||
Usage:
|
||||
|
||||
\[[fortune ]]
|
||||
|
||||
This plugin is included in ikiwiki, but not enabled by default.
|
||||
|
||||
If this plugin is enabled, here's a fortune for you:
|
||||
|
||||
----
|
||||
|
||||
[[fortune ]]
|
Loading…
Reference in New Issue