2 package IkiWiki::Plugin::wmd;
12 hook(type => "getsetup", id => "wmd", call => \&getsetup);
13 hook(type => "formbuilder_setup", id => "wmd", call => \&formbuilder_setup);
24 sub formbuilder_setup (@) {
26 my $form=$params{form};
28 return if ! defined $form->field("do");
30 return unless (($form->field("do") eq "edit") ||
31 ($form->field("do") eq "create"));
33 $form->tmpl_param("wmd_preview", "<div class=\"wmd-preview\"></div>\n".include_javascript(undef, 1));
36 sub include_javascript ($;$) {
40 return '<script src="'.urlto("wmd.js", $page, $absolute).
41 '" type="text/javascript"></script>'."\n";