]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
initial stab at getting wmd-new working
authorJoey Hess <joey@kitenet.net>
Wed, 7 Jul 2010 19:42:41 +0000 (15:42 -0400)
committerJoey Hess <joey@kitenet.net>
Wed, 7 Jul 2010 19:42:41 +0000 (15:42 -0400)
http://github.com/derobins/wmd

Not sure I like it as much as old wmd, but it is at least maintained and
at least has a license.

IkiWiki/Plugin/wmd.pm
templates/editpage.tmpl

index 71d7c9d17f51e49ec17aee087e984f3e8a7b9b79..30fe5b813aa4abae9d68263350cbd6b72e83cf91 100644 (file)
@@ -29,9 +29,14 @@ sub formbuilder_setup (@) {
        return unless $form->field("do") eq "edit" ||
                        $form->field("do") eq "create" ||
                        $form->field("do") eq "comment";
+       
+       $form->tmpl_param("wmd_button_bar", "<div id=\"wmd-button-bar\" class=\"wmd-panel\"></div>\n");
 
-       $form->tmpl_param("wmd_preview", "<div class=\"wmd-preview\"></div>\n".
+       $form->tmpl_param("wmd_preview", "<div id=\"wmd-preview\" class=\"wmd-panel\"></div>\n".
                include_javascript(undef, 1));
+
+       $form->field(name => "editcontent", class => "wmd-panel", id =>
+               "wmd-input");
 }
 
 sub include_javascript ($;$) {
@@ -39,12 +44,15 @@ sub include_javascript ($;$) {
        my $absolute=shift;
 
        my $wmdjs=urlto("wmd/wmd.js", $page, $absolute);
+       my $showdownjs=urlto("wmd/showdown.js", $page, $absolute);
+
        return <<"EOF"
 <script type="text/javascript">
 wmd_options = {
        output: "Markdown"
 };
 </script>
+<script src="$showdownjs" type="text/javascript"></script>
 <script src="$wmdjs" type="text/javascript"></script>
 EOF
 }
index d6ad8061420f2c8056b6c1d12f3da6223ba0582f..edce136e9d1db110c363cd6a378d1d3715361ee4 100644 (file)
@@ -15,6 +15,7 @@
 <TMPL_VAR FIELD-TYPE>
 </TMPL_IF>
 <div class="editcontentdiv">
+<TMPL_VAR WMD_BUTTON_BAR>
 <TMPL_VAR FIELD-EDITCONTENT><br />
 </div>
 <TMPL_IF NAME="CAN_COMMIT">