From 329f0991ef71635c6390126ca1d99a187254de18 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 7 Mar 2009 18:45:55 -0500 Subject: wmd copyright? --- doc/todo/mdwn_preview.mdwn | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'doc/todo') diff --git a/doc/todo/mdwn_preview.mdwn b/doc/todo/mdwn_preview.mdwn index 16d7409a0..df1eac2d8 100644 --- a/doc/todo/mdwn_preview.mdwn +++ b/doc/todo/mdwn_preview.mdwn @@ -43,7 +43,8 @@ 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. --[[Joey]] +> for Debian yet. Hmm, I also can't find any copyright or license info in +> the zip file. --[[Joey]] Note that the WMD plugin does **not** handle directives. For this reason the normal `preview` button remains. Some CSS to clean up the display of the live WMD preview would be good. -- cgit v1.2.3 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/todo') 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 From 45129917b2ac6ea54ef630608c293803076a63fa Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 7 Mar 2009 19:26:46 -0500 Subject: another thought --- doc/todo/mdwn_preview.mdwn | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'doc/todo') diff --git a/doc/todo/mdwn_preview.mdwn b/doc/todo/mdwn_preview.mdwn index 73028be19..f71c944bb 100644 --- a/doc/todo/mdwn_preview.mdwn +++ b/doc/todo/mdwn_preview.mdwn @@ -50,3 +50,9 @@ remains. Some CSS to clean up the display of the live WMD preview would be good > 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]] + +> I wonder how annoying it would be to add some kind of simplistic wikilink +> support to wmd's preview? And/or a wikilink button? While not supporting +> directies is fine, not supporting wikilinks in a wiki seems a bit +> lacking. It may also entice novide users to not use wikilinks and instead +> use the hyperlinks that wmd does support. --[[Joey]] -- cgit v1.2.3 From 1dba400c2ce92af646bcf4b0ae1085857d912cc8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 7 Mar 2009 19:30:01 -0500 Subject: bug --- doc/todo/mdwn_preview.mdwn | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'doc/todo') diff --git a/doc/todo/mdwn_preview.mdwn b/doc/todo/mdwn_preview.mdwn index f71c944bb..3414603ad 100644 --- a/doc/todo/mdwn_preview.mdwn +++ b/doc/todo/mdwn_preview.mdwn @@ -56,3 +56,9 @@ remains. Some CSS to clean up the display of the live WMD preview would be good > directies is fine, not supporting wikilinks in a wiki seems a bit > lacking. It may also entice novide users to not use wikilinks and instead > use the hyperlinks that wmd does support. --[[Joey]] + +> Bug: When I preview, all the text in the edit field seems to be +> converted from mdwn to html. I think that wmd is converting the mdwn +> into html when the form is posted, so it would also save like that. +> I assume that is designed for websites that do not use markdown +> internally. Doesn't it have a setting to leave it as markdown? --[[Joey]] -- cgit v1.2.3 From ff0ae86945f8a68d5bc51fa9f9cc89754cd209b5 Mon Sep 17 00:00:00 2001 From: "http://www.cse.unsw.edu.au/~willu/" Date: Sun, 8 Mar 2009 10:39:07 -0400 Subject: License grant for my code. And note that I'll look at a more advanced version when I get time. --- doc/todo/mdwn_preview.mdwn | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) (limited to 'doc/todo') diff --git a/doc/todo/mdwn_preview.mdwn b/doc/todo/mdwn_preview.mdwn index 16d7409a0..6ab8d604b 100644 --- a/doc/todo/mdwn_preview.mdwn +++ b/doc/todo/mdwn_preview.mdwn @@ -23,13 +23,26 @@ add to ikiwiki. >>> editing something other than Markdown source). I've >>> removed the done tag so this is visible as a patch. -- [[Will]] ->>> Hmm, it would be good if it turned off for !mdwn. Although this could ->>> be difficult for a new page, since there is a dropdown selector to ->>> choose the markup language then. But it should be doable for editing an ->>> existing page. ->>> ->>> Can I get a license statement (ie, GPL-2+) ffrom you for the plugin? ->>> --[[Joey]] +>>>> Hmm, it would be good if it turned off for !mdwn. Although this could +>>>> be difficult for a new page, since there is a dropdown selector to +>>>> choose the markup language then. But it should be doable for editing an +>>>> existing page. + +>>>>> I agree. I'm working on this for for both new pages and existing pages. +>>>>> It shouldn't be hard once I get WMD going through the javascript API. +>>>>> At the moment that is inexplicably failing, and I haven't had time to have a good look at why. +>>>>> I may not get a chance to look at this again for a few weeks. + +>>>> Can I get a license statement (ie, GPL-2+) ffrom you for the plugin? +>>>> --[[Joey]] + +>>>>> Certainly. You're free to use the code I posted below under the GPL-2+ license. You'll note +>>>>> however that I haven't said anything about the WMD code itself. The WMD web page says: + +>>>>>> "I'm refactoring the code, and will be releasing WMD under the MIT license soon. For now you can download the most recent release (wmd-1.0.1.zip) and use it freely." + +>>>>> It might be best to contact to for an explicit license on that if you want to include it. +>>>>> -- [[Will]] ------ @@ -45,12 +58,23 @@ some other javascript files and an images directory in the same place. > on the user or distribution providing it. It does not seem to be packaged > for Debian yet. --[[Joey]] +>> This is a good question. My thought is that it will probably not be packaged any time soon, +>> so you're better off adding it to IkiWiki. I'd contact the author of WMD and ask them. They +>> may have more insight. -- [[Will]] + Note that the WMD plugin does **not** handle directives. For this reason the normal `preview` button 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]] +>> In the version of the plugin below, a new `div` is added just below the form. WMD +>> populates this div with the HTML it generates from the Markdown source. This is not very +>> pretty at the moment - it appears in the same place as the preview used to, but with no +>> header or anything. Any standard IkiWiki preview will appear below the WMD live preview. +>> I recommend having a look at +>> for what a little CSS could achieve. -- [[Will]] + Install the following patch and plugin file. Then enable the 'wmd' plugin. -- cgit v1.2.3 From f4ae4c0b091d51842db2a97f09d1d1d64cf1f2ce Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sun, 8 Mar 2009 15:50:48 +0100 Subject: implemented Joey's solution --- doc/todo/need_global_renamepage_hook.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/todo') diff --git a/doc/todo/need_global_renamepage_hook.mdwn b/doc/todo/need_global_renamepage_hook.mdwn index 9c987aac4..6c79fa321 100644 --- a/doc/todo/need_global_renamepage_hook.mdwn +++ b/doc/todo/need_global_renamepage_hook.mdwn @@ -103,3 +103,5 @@ hashes is desired, it could return the full set of hashes. >> plugins use the hook; plugin A would see when plugin B adds a new file >> to be renamed. And the subpage renaming stuff could probably be moved >> into the rename hook too. --[[Joey]] +>>> +>>> I've implemented this nice solution in my po branch. --[[intrigeri]] -- cgit v1.2.3 From 5e60e13a2070cce4f7feae59164a6cb3460d46b7 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sun, 8 Mar 2009 11:05:47 -0400 Subject: details --- doc/todo/need_global_renamepage_hook.mdwn | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'doc/todo') diff --git a/doc/todo/need_global_renamepage_hook.mdwn b/doc/todo/need_global_renamepage_hook.mdwn index 6c79fa321..69655f2e9 100644 --- a/doc/todo/need_global_renamepage_hook.mdwn +++ b/doc/todo/need_global_renamepage_hook.mdwn @@ -104,4 +104,6 @@ hashes is desired, it could return the full set of hashes. >> to be renamed. And the subpage renaming stuff could probably be moved >> into the rename hook too. --[[Joey]] >>> ->>> I've implemented this nice solution in my po branch. --[[intrigeri]] +>>> I've implemented this nice solution in my po branch, please review. +>>> I'm slowly coming back to do the last bits needed to get my po and +>>> meta branch merged. --[[intrigeri]] -- cgit v1.2.3 From 1bf100cfdebee69fc53d2cdf77d626b9fe8be987 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 8 Mar 2009 13:11:26 -0400 Subject: configure wmd to leave text in markdown --- IkiWiki/Plugin/wmd.pm | 13 ++++++++++--- doc/todo/mdwn_preview.mdwn | 3 ++- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'doc/todo') diff --git a/IkiWiki/Plugin/wmd.pm b/IkiWiki/Plugin/wmd.pm index bdbcecc06..9ddd237ab 100644 --- a/IkiWiki/Plugin/wmd.pm +++ b/IkiWiki/Plugin/wmd.pm @@ -37,9 +37,16 @@ sub formbuilder_setup (@) { sub include_javascript ($;$) { my $page=shift; my $absolute=shift; - - return ''."\n"; + + my $wmdjs=urlto("wmd/wmd.js", $page, $absolute); + return <<"EOF" + + +EOF } 1 diff --git a/doc/todo/mdwn_preview.mdwn b/doc/todo/mdwn_preview.mdwn index 2fa460336..3008eb529 100644 --- a/doc/todo/mdwn_preview.mdwn +++ b/doc/todo/mdwn_preview.mdwn @@ -85,4 +85,5 @@ remains. Some CSS to clean up the display of the live WMD preview would be good > converted from mdwn to html. I think that wmd is converting the mdwn > into html when the form is posted, so it would also save like that. > I assume that is designed for websites that do not use markdown -> internally. Doesn't it have a setting to leave it as markdown? --[[Joey]] +> internally. Doesn't it have a setting to leave it as markdown? +>> Found setting, fixed. --[[Joey]] -- cgit v1.2.3