X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/21add7ffa87a5e622d18bdbb24c638c15bdb3800..11b9eb0c19cfb2e9b49b7a6f460381ce6fe52896:/IkiWiki/Plugin/polygen.pm

diff --git a/IkiWiki/Plugin/polygen.pm b/IkiWiki/Plugin/polygen.pm
index a32003778..8ce62b754 100644
--- a/IkiWiki/Plugin/polygen.pm
+++ b/IkiWiki/Plugin/polygen.pm
@@ -7,7 +7,7 @@ package IkiWiki::Plugin::polygen;
 
 use warnings;
 use strict;
-use IkiWiki 2.00;
+use IkiWiki 3.00;
 use File::Find;
 
 sub import {
@@ -20,6 +20,7 @@ sub getsetup () {
 		plugin => {
 			safe => 1,
 			rebuild => undef,
+			section => "widget",
 		},
 }
 
@@ -27,6 +28,7 @@ sub preprocess (@) {
 	my %params=@_;
 	my $grammar = ($params{grammar} or 'polygen');
 	my $symbol = ($params{symbol} or undef);
+	my $options = ($config{deterministic} ? '-seed 42' : '');
 
 	# Sanitize parameters
 	$grammar =~ IkiWiki::basename($grammar);
@@ -50,10 +52,10 @@ sub preprocess (@) {
 	
 	my $res;
 	if (defined $symbol) {
-		$res = `polygen -S $symbol $grmfile 2>/dev/null`;
+		$res = `polygen -S $symbol $options $grmfile 2>/dev/null`;
 	}
 	else {
-		$res = `polygen $grmfile 2>/dev/null`;
+		$res = `polygen $options $grmfile 2>/dev/null`;
 	}
 
 	if ($?) {