1 (This conversation was moved from [[plugins/wmd/discussion]]. --[[anarcat]])
3 I've tried to retrieve the wmd-editor source tarball lately, but the site seems offline.
5 From what I've read on the Internet, wmd-editor is not (yet?) free software by itself, and its author has gone MIA.
6 But it looks like somebody recently took the step to rewrite a wmd-clone under a saner license, see [[pagedown|http://code.google.com/p/pagedown/source/browse/]].
8 Given all the above, what about upgrading this plugin to use pagedown instead of wmd? It seem a clear win to me...
10 > AFAICS, pagedown is a modified version of WMD. Let's
11 > look at its license file: --[[Joey]]
13 > A javascript port of Markdown, as used on Stack Overflow
14 > and the rest of Stack Exchange network.
16 > Largely based on showdown.js by John Fraser (Attacklab).
18 > Original Markdown Copyright (c) 2004-2005 John Gruber
19 > <http://daringfireball.net/projects/markdown/>
22 > Original Showdown code copyright (c) 2007 John Fraser
24 > Modifications and bugfixes (c) 2009 Dana Robinson
25 > Modifications and bugfixes (c) 2009-2011 Stack Exchange Inc.
27 > Permission is hereby granted, free of charge, to any person obtaining a
30 > Ok, so it says it's based on showdown. John Fraser wrote showdown and also
31 > WMD, which IIRC was built on top of showdown. (Showdown converts the
32 > markdown to html, and WMD adds the editor UI.)
34 > I can nowhere find a actual statement of the copyright of showdown or
35 > WMD. <http://code.google.com/p/wmd/> has a "MIT License" notice on it,
36 > but this is clearly just the license chosen when signing up at google
37 > code for the repo that would be used for a rewrite of the code, and the only thing
38 > said about the previous 1.0 release of WMD is "use it freely", which is not
39 > specific enough to be a grant of license, and is moreover not a free
40 > software license, as it does not cover distribution or modification.
42 > Which was all covered in the thread here,
43 > when StackOverflow decided to start working on pagedown.
44 > <http://blog.stackoverflow.com/2008/12/reverse-engineering-the-wmd-editor/>
45 > This thread does not give any indication that they ever managed to get
46 > a license grant for WMD/showdown. It frankly, does not inspire confidence
47 > that the people working on this care about the license.
49 > It would probably be pretty easy to adapt the ikiwiki wmd plugin
50 > to use pagedown. But without a clear and credible license, why?
52 > (Note that I have a wmd-new branch in my ikiwiki git repo that
53 > uses <https://github.com/derobins/wmd>, which was an earlier
54 > version of pagedown (probably, not entirely clear).)
56 > An alternate alternative is markitup: <http://markitup.jaysalvat.com/>
57 > It has a clear history and a credible license (MIT or GPL dual license).
58 > It's also easily extensible to other formats so could handle rst etc.
59 > It does not, however, have a markdown to html converter -- for
60 > previewing it has to talk to the server with AJAX.
64 >> Showdown has a pretty explicit [license.txt file](https://github.com/coreyti/showdown/blob/master/license.txt)
65 >> and it basically looks like a BSD license. That license.txt file was imported into
66 >> github directly from the upstream showdown source, so it seems credible. That zip file
67 >> is still available [on archive.org](http://wayback.archive.org/web/20100612163302/http://attacklab.net/showdown/showdown-v0.9.zip),
68 >> and does mention a BSD copyright.
70 >> So Showdown itself is clean: it's free. Nowhere does it say it derives from WMD, or
71 >> if it does, it doesn't matter *because* it was made by the same author **and then**
72 >> released under that free license. But even then, it does *not* mention being a
75 >> I agree the license behind WMD is murky. One the one hand, the [google code page](https://code.google.com/p/wmd/)
76 >> mentions the code will be relicensed under MIT but "for now" we can "use it freely":
78 >> > *I'm refactoring the code, and will be releasing WMD under the MIT license soon. For
79 >> now you can download the most recent release (wmd-1.0.1.zip) and use it freely.*
81 >> That zip file is again offline, but it's also [on archive.org](http://web.archive.org/web/20101226145228/http://wmd-editor.com/downloads/wmd-1.0.1.zip).
82 >> Things get a little more murky there: the file doesn't actually mention any copyright
83 >> statement, and the code is actually obfuscated, something that is mentionned on the aforementionned
84 >> Stack Exchange thread. The [terms and conditions of WMD](http://web.archive.org/web/20100323043113/http://wmd-editor.com/terms)
85 >> are pretty hostile however:
87 >>> *All rights reserved. You may not duplicate, copy, or reuse any portion of the HTML/CSS, JavaScript, or visual design elements or concepts without express written permission from AttackLab.*
89 >> But one could argue they apply only to WMD, and *not* showdown, which has been
90 >> explicitely published under a different license. And maybe that was the whole
91 >> point here: the stack exchange people were trying to negociate having the
92 >> clear and free version of WMD for their own use, maybe showdown is actually
93 >> what came out of this and what allows Stack exchange to do their thing...
95 >> And besides: the point here is that we *can't actually use WMD safely*, but
96 >> we **can use pagedown safely!**.
98 >> I tried the plugin: it works, and it works well. It's also fairly trivial to
99 >> install the upstream showdown library, which is not shipped with the plugin
100 >> (which alleviates all possible copyright problems). You can take test the
101 >> plugin at <http://testwiki.anarc.at/>
103 >> There are only three issues I could find during testing:
105 >> 1. two previews are showed (the showdown one and the regular ikiwiki one),
106 >> which can be confusing, but is still necessary because the showdown one
107 >> doesn't parse ikiwiki directives.
108 >> 2. the wiki needs to be rebuilt when the plugin is first activated for the
109 >> stylesheets to regenerate. new wikis are not affected, and this can be
110 >> deployed massively on farms without user intervention.
111 >> 3. on large pages, the edit screen isn't in the first screen, so it's not
112 >> obvious we're editing the page, which is also a little confusing - we
113 >> would need an anchor in there... Update: a simple patch fixes that...
114 >> but in a rather crude way:
116 >> [[!format diff """
117 --- a/IkiWiki/Render.pm
118 +++ b/IkiWiki/Render.pm
119 @@ -87,7 +87,7 @@ sub genpage ($$) {
121 if (length $config{cgiurl}) {
122 if (IkiWiki->can("cgi_editpage")) {
123 - $template->param(editurl => cgiurl(do => "edit", page => $page));
124 + $template->param(editurl => cgiurl(do => "edit", page => $page) . '#editcontent');
129 >> ideally, we would show the edit box next to the page preview... And there's a way to do that too! But it requires some more CSS hackery, like [this](http://css-tricks.com/scrollfollow-sidebar/), for example:
132 >> position: relative;
133 >> margin: 15px auto;
142 >> But this is getting a little crazy and I need to sleep now.
144 >> [[!template id=gitbranch branch=anarcat/pagedown author="[[anarcat]]"]]
146 >> Anyways, let's work on merging that pretty branch already shall we? :) --[[anarcat]]