From 43ebfc342cd5b0059dcf9543802eebfa990dd9af Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 7 Mar 2009 19:23:46 -0500 Subject: remove patch, and more comments --- doc/todo/mdwn_preview.mdwn | 83 +++++----------------------------------------- 1 file changed, 9 insertions(+), 74 deletions(-) (limited to 'doc') diff --git a/doc/todo/mdwn_preview.mdwn b/doc/todo/mdwn_preview.mdwn index df1eac2d8..73028be19 100644 --- a/doc/todo/mdwn_preview.mdwn +++ b/doc/todo/mdwn_preview.mdwn @@ -18,7 +18,11 @@ add to ikiwiki. [[!tag wishlist]] ->>> Below is a simple plugin/[[patch]] to make use of the WMD editor. Turns out it isn't hard at all to +>>> Below is a simple plugin/[[patch]] to make use of the WMD editor. + +>>>> Now added to ikiwiki, thanks! --[[Joey]] + +>>> Turns out it isn't hard at all to >>> get a basic version going (which doesn't handle directives at all, nor does it swtich itself off when you're >>> editing something other than Markdown source). I've >>> removed the done tag so this is visible as a patch. -- [[Will]] @@ -31,16 +35,6 @@ add to ikiwiki. >>> Can I get a license statement (ie, GPL-2+) ffrom you for the plugin? >>> --[[Joey]] ------- - -### Instructions: - - -Download the [WMD source](http://wmd-editor.com/downloads/wmd-1.0.1.zip). In that zip file you'll -find a few example html files, a readme and `wmd` directory. Move the `wmd` directory into the -ikiwiki `underlays` directory. You should now have an `underlays/wmd/wmd.js` file as well as -some other javascript files and an images directory in the same place. - > So, I wonder if I should add a copy of the WMD source to ikiwiki, or rely > on the user or distribution providing it. It does not seem to be packaged > for Debian yet. Hmm, I also can't find any copyright or license info in @@ -52,66 +46,7 @@ remains. Some CSS to clean up the display of the live WMD preview would be good > Can you elucidate the CSS comment -- or will it be obvious what you mean > when I try it? Is it what's needed for the live preview? --[[Joey]] -Install the following patch and plugin file. Then enable the 'wmd' plugin. - - - diff --git a/templates/editpage.tmpl b/templates/editpage.tmpl - index 4b54db2..b1cf015 100644 - --- a/templates/editpage.tmpl - +++ b/templates/editpage.tmpl - @@ -37,6 +37,7 @@ Optional comment about this change:
- - - - + - - -
- ------ - - #!/usr/bin/perl - package IkiWiki::Plugin::wmd; - - use warnings; - use strict; - use IkiWiki 3.00; - use POSIX; - use Encode; - - sub import { - add_underlay("wmd"); - hook(type => "getsetup", id => "wmd", call => \&getsetup); - hook(type => "formbuilder_setup", id => "wmd", call => \&formbuilder_setup); - } - - sub getsetup () { - return - plugin => { - safe => 1, - rebuild => 1, - }, - } - - sub formbuilder_setup (@) { - my %params=@_; - my $form=$params{form}; - - return if ! defined $form->field("do"); - - return unless (($form->field("do") eq "edit") || - ($form->field("do") eq "create")); - - $form->tmpl_param("wmd_preview", "
\n".include_javascript(undef, 1)); - } - - sub include_javascript ($;$) { - my $page=shift; - my $absolute=shift; - - return ''."\n"; - } - - 1 - +> Hmm, now that I've tried it, I notice that it does live preview by +> default, below the edit window. Which is nice, but then if I hit the +> preview button, I get two previews.. which is confusing. (Also, minor, +> but: the live preview is missing the >Page Preview:" header.) --[[Joey]] -- cgit v1.2.3