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(-) 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 7ca39f49db67de756795ad419791082e115fbd98 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 7 Mar 2009 18:52:14 -0500 Subject: forgot to add wmd tag here --- templates/editpage.tmpl | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/editpage.tmpl b/templates/editpage.tmpl index 4b54db2d1..b1cf015a2 100644 --- a/templates/editpage.tmpl +++ b/templates/editpage.tmpl @@ -37,6 +37,7 @@ Optional comment about this change:
+
-- cgit v1.2.3 From 72dd9a9a0434e1682d7e27b935500c010a03dddc Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 7 Mar 2009 18:54:26 -0500 Subject: make wmd comment support comment editing (I think) --- IkiWiki/Plugin/wmd.pm | 5 +++-- templates/editcomment.tmpl | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/IkiWiki/Plugin/wmd.pm b/IkiWiki/Plugin/wmd.pm index 3372ffe38..9e9f17f7f 100644 --- a/IkiWiki/Plugin/wmd.pm +++ b/IkiWiki/Plugin/wmd.pm @@ -26,8 +26,9 @@ sub formbuilder_setup (@) { return if ! defined $form->field("do"); - return unless (($form->field("do") eq "edit") || - ($form->field("do") eq "create")); + return unless $form->field("do") eq "edit" || + $form->field("do") eq "create" || + $form->field("do") eq "comment"; $form->tmpl_param("wmd_preview", "
\n". include_javascript(undef, 1)); diff --git a/templates/editcomment.tmpl b/templates/editcomment.tmpl index 891bcae65..7590cdfd7 100644 --- a/templates/editcomment.tmpl +++ b/templates/editcomment.tmpl @@ -15,6 +15,7 @@ Subject:

IkiWiki directives ([[!directive]]) are not allowed in comments on this wiki.
+
-- cgit v1.2.3 From 29d387d2bacfdf10cc8712af1250e5655967f1b9 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 7 Mar 2009 18:57:06 -0500 Subject: wmd stuff --- debian/changelog | 2 ++ debian/copyright | 4 ++++ doc/plugins/wmd.mdwn | 15 +++++++++++++++ 3 files changed, 21 insertions(+) create mode 100644 doc/plugins/wmd.mdwn diff --git a/debian/changelog b/debian/changelog index 801dc154f..d6ee6fd8a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,8 @@ ikiwiki (3.07) UNRELEASED; urgency=low * Updated German translation (Kai Wasserbäch). Closes: #518377 * Updated French translation (Jean-Luc Coulon). Closes: #518510 + * wmd: New plugin contributed by William Uther to support the WMD + Wysiwym markdown editor. -- Joey Hess Thu, 05 Mar 2009 15:43:02 -0500 diff --git a/debian/copyright b/debian/copyright index f589b4a8f..67f0ac540 100644 --- a/debian/copyright +++ b/debian/copyright @@ -122,6 +122,10 @@ Files: 404.pm Copyright: © 2009 Simon McVittie License: GPL-2+ +Files: wmd.pm +Copyright: © 2009 William Uther +License: GPL-2+ + Files: doc/logo/* Copyright: © 2006 Recai Oktaş License: GPL-2+ diff --git a/doc/plugins/wmd.mdwn b/doc/plugins/wmd.mdwn new file mode 100644 index 000000000..31a508cdb --- /dev/null +++ b/doc/plugins/wmd.mdwn @@ -0,0 +1,15 @@ +[[!template id=plugin name=wmd author="[[Will]]"]] +[[!tag type/chrome]] + +[WMD](http://wmd-editor.com/) is a What You See Is What You Mean editor for +[[mdwn]]. This plugin makes WMD be used for editing pages in the wiki. + +To use the plugin, you will need to install WMD. 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 `underlaydir` directory (ie +`/usr/share/ikiwiki/`). You should now have a `wmd/wmd.js` file as well as +some other javascript files and an images directory in the same place. + +Note that the WMD plugin does **not** handle ikiwiki directives. For this +reason the normal `preview` button remains. -- cgit v1.2.3 From 4e11380c75ae66230139641b215d8ffbb0a74d5e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 7 Mar 2009 19:11:34 -0500 Subject: update, add some examples --- doc/usage.mdwn | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/doc/usage.mdwn b/doc/usage.mdwn index b6af75ac8..e411b127a 100644 --- a/doc/usage.mdwn +++ b/doc/usage.mdwn @@ -6,7 +6,7 @@ ikiwiki - a wiki compiler ikiwiki [options] source destination -ikiwiki --setup configfile +ikiwiki --setup setupfile # DESCRIPTION @@ -30,19 +30,19 @@ These options control the mode that ikiwiki operates in. Force a rebuild of all pages. -* --setup configfile +* --setup setupfile In setup mode, ikiwiki reads the config file, which is really a perl program that can call ikiwiki internal functions. The default action when --setup is specified is to automatically generate - wrappers for a wiki based on data in a config file, and rebuild the wiki. + wrappers for a wiki based on data in a setup file, and rebuild the wiki. If you only want to build any changed pages, you can use --refresh with --setup. -* --dumpsetup configfile +* --dumpsetup setupfile - Causes ikiwiki to write to the specified config file, dumping out + Causes ikiwiki to write to the specified setup file, dumping out its current configuration. * --wrappers @@ -103,7 +103,8 @@ These options control the mode that ikiwiki operates in. # CONFIG OPTIONS These options configure the wiki. Note that [[plugins]] can add additional -configuration options of their own. +configuration options of their own. All of these options and more besides can +also be configured using a setup file. * --wikiname @@ -316,10 +317,28 @@ configuration options of their own. * --set var=value This allows setting an arbitrary configuration variable, the same as if it - were set via a configuration file. Since most options can be configured + were set via a setup file. Since most options can be configured using command-line switches, you will rarely need to use this, but it can be useful for the odd option that lacks a command-line switch. +# EXAMPLES + +* ikiwiki --setup my.setup + + Completly (re)build the wiki using the specified setup file. + +* ikiwiki --setup my.setup --refresh + + Refresh the wiki, using settings from my.setup, and avoid + rebuilding any pages that have not changed. This is faster. + +* ikiwiki --setup my.setup --refresh --wrappers + + Refresh the wiki, including regnerating all wrapper programs, + but do not rebuild all pages. Useful if you have changed something + in the setup file that does not need a full wiki rebuild to update + all pages, but that you want to immediatly take effect. + # ENVIRONMENT * CC -- cgit v1.2.3 From 9a82ef32b96b07278b90a1219fa555fa2a970912 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 7 Mar 2009 19:22:27 -0500 Subject: look for wmd/wmd.js This means that the underlay needs to have a wmd/wmd/wmd.js, which is a trifle weird, but it isolates all the wmd stuff in a single wmd subdirectory of the built wiki. The wmd/images creating a toplevel images directory was particularly bad. --- IkiWiki/Plugin/wmd.pm | 2 +- doc/plugins/wmd.mdwn | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/IkiWiki/Plugin/wmd.pm b/IkiWiki/Plugin/wmd.pm index 9e9f17f7f..bdbcecc06 100644 --- a/IkiWiki/Plugin/wmd.pm +++ b/IkiWiki/Plugin/wmd.pm @@ -38,7 +38,7 @@ sub include_javascript ($;$) { my $page=shift; my $absolute=shift; - return ''."\n"; } diff --git a/doc/plugins/wmd.mdwn b/doc/plugins/wmd.mdwn index 31a508cdb..dc9a30703 100644 --- a/doc/plugins/wmd.mdwn +++ b/doc/plugins/wmd.mdwn @@ -6,10 +6,11 @@ To use the plugin, you will need to install WMD. 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 `underlaydir` directory (ie -`/usr/share/ikiwiki/`). You should now have a `wmd/wmd.js` file as well as -some other javascript files and an images directory in the same place. +you'll find a few example html files, a readme and `wmd` directory. Create +a 'wmd' subdirectory in the ikiwiki `underlaydir` directory (ie `sudo mkdir +/usr/share/ikiwiki/wmd`). Move the `wmd` directory into the directory you +made. You should now have a `wmd/wmd/wmd.js` file as well as some other +javascript files and an images directory in the same place. Note that the WMD plugin does **not** handle ikiwiki directives. For this reason the normal `preview` button remains. -- 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(-) 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(+) 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(+) 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(-) 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(+) 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(-) 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(-) 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 From 1edad6dca70175fd44b4f2e4e3bd8b3b16bbc055 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 8 Mar 2009 17:07:12 -0400 Subject: fix doc, prefix directives have been default for a while --- doc/usage.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/usage.mdwn b/doc/usage.mdwn index e411b127a..55ff17e94 100644 --- a/doc/usage.mdwn +++ b/doc/usage.mdwn @@ -293,7 +293,7 @@ also be configured using a setup file. * --prefix-directives, --no-prefix-directives Toggle new '!'-prefixed syntax for preprocessor directives. ikiwiki currently - defaults to --no-prefix-directives. + defaults to --prefix-directives. * --w3mmode, --no-w3mmode -- cgit v1.2.3 From d3b4c2dbd13f6721042db7a7b6843851c9037551 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 8 Mar 2009 18:46:18 -0400 Subject: avoid potential infinite loop in smiley expansion - In 3.05, ikiwiki began expanding templates in scan mode, for annoying, expensive, but ultimatly necessary reasons of correctness. - Smiley processing has a bug: It inserts a span for the smiley, and then continues searching forward in the content for more, starting at $end_of_smiley+1. Which means it searches for smilies in the span too! And if it somehow finds one, we get an infinite loop here. - This bug can, probably, only be tickled if a htmllink to show the smiley fails, because the smiley file doesn't exist, or because ikiwiki doesn't know about it. In that case, a link will be inserted to _create_ the missing page, and that link will include the smiley inside the . - When a template is expanded in scan mode, and it contains an inline, the sanitize hook is run during scan mode, which never happened before. That causes the smiley processor to run, before ikiwiki is, necessarily, aware that all the smiley files exist (depending on scan order). So it inserts creation links for them, and triggers the bug. I've put in the simple fix of jumping forward past the inserted span, and it does fix the problem. I will need to look in a bit more detail into why an inline nested inside a template is fully expanded during the scan pass -- that really shouldn't be necessary, and it makes things much slower than they need to be. --- IkiWiki/Plugin/smiley.pm | 6 +++--- debian/changelog | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/IkiWiki/Plugin/smiley.pm b/IkiWiki/Plugin/smiley.pm index 1697a37c1..0d77916d0 100644 --- a/IkiWiki/Plugin/smiley.pm +++ b/IkiWiki/Plugin/smiley.pm @@ -87,10 +87,10 @@ MATCH: while (m{(?:^|(?<=\s|>))(\\?)$smiley_regexp(?:(?=\s|<)|$)}g) { } else { # Replace the smiley with its expanded value. - substr($_, $spos, length($smiley))= - htmllink($params{page}, $params{destpage}, + my $link=htmllink($params{page}, $params{destpage}, $smileys{$smiley}, linktext => $smiley); - pos=$epos+1; + substr($_, $spos, length($smiley))=$link; + pos=$epos+length($link); } } diff --git a/debian/changelog b/debian/changelog index d6ee6fd8a..e5d522200 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,7 @@ ikiwiki (3.07) UNRELEASED; urgency=low * Updated French translation (Jean-Luc Coulon). Closes: #518510 * wmd: New plugin contributed by William Uther to support the WMD Wysiwym markdown editor. + * smiley: Avoid infinite loop in smiley expansion. Closes: #518805 -- Joey Hess Thu, 05 Mar 2009 15:43:02 -0500 -- cgit v1.2.3 From dd2fa2efb956f8af6c98d37f8cfd280df2f97cb5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 8 Mar 2009 18:57:47 -0400 Subject: When loading a template in scan mode, let preprocess know it only needs to scan. This makes wikis such as zack's much faster in the scan pass. In that pass, when a template contains an inline, there is no reason to process the entire inline and all its pages. I'd forgotten to pass along the flag to let preprocess() know it was in scan mode, leading to much unncessary churning. --- IkiWiki/Plugin/template.pm | 6 +++++- debian/changelog | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/IkiWiki/Plugin/template.pm b/IkiWiki/Plugin/template.pm index b872f0962..b6097bb49 100644 --- a/IkiWiki/Plugin/template.pm +++ b/IkiWiki/Plugin/template.pm @@ -69,9 +69,13 @@ sub preprocess (@) { } } + # This needs to run even in scan mode, in order to process + # links and other metadata includes via the template. + my $scan=! defined wantarray; + return IkiWiki::preprocess($params{page}, $params{destpage}, IkiWiki::filter($params{page}, $params{destpage}, - $template->output)); + $template->output), $scan); } 1 diff --git a/debian/changelog b/debian/changelog index e5d522200..95d414bc7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,8 @@ ikiwiki (3.07) UNRELEASED; urgency=low * wmd: New plugin contributed by William Uther to support the WMD Wysiwym markdown editor. * smiley: Avoid infinite loop in smiley expansion. Closes: #518805 + * template: When loading a template in scan mode, let preprocess + know it only needs to scan. -- Joey Hess Thu, 05 Mar 2009 15:43:02 -0500 -- cgit v1.2.3 From 3520d55361f8b6f04f54fb5b41b21e37cff0da21 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 8 Mar 2009 19:05:59 -0400 Subject: releasing version 3.07 --- debian/changelog | 7 ++++--- po/es.po | 26 +++++++++++++++++--------- po/fr.po | 41 +++++++++++++++++++++++------------------ po/ikiwiki.pot | 2 +- 4 files changed, 45 insertions(+), 31 deletions(-) diff --git a/debian/changelog b/debian/changelog index 95d414bc7..c66db85a2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,14 +1,15 @@ -ikiwiki (3.07) UNRELEASED; urgency=low +ikiwiki (3.07) unstable; urgency=low * Updated German translation (Kai Wasserbäch). Closes: #518377 * Updated French translation (Jean-Luc Coulon). Closes: #518510 * wmd: New plugin contributed by William Uther to support the WMD Wysiwym markdown editor. - * smiley: Avoid infinite loop in smiley expansion. Closes: #518805 + * smiley: Avoid infinite loop in smiley expansion triggered + by the template scan mode change in version 3.05. Closes: #518805 * template: When loading a template in scan mode, let preprocess know it only needs to scan. - -- Joey Hess Thu, 05 Mar 2009 15:43:02 -0500 + -- Joey Hess Sun, 08 Mar 2009 19:00:46 -0400 ikiwiki (3.06) unstable; urgency=low diff --git a/po/es.po b/po/es.po index abd44ee32..0212a86be 100644 --- a/po/es.po +++ b/po/es.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: es\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-03-01 15:03-0500\n" +"POT-Creation-Date: 2009-03-08 19:02-0400\n" "PO-Revision-Date: 2009-03-03 10:48+0100\n" "Last-Translator: Víctor Moral \n" "Language-Team: spanish \n" @@ -27,11 +27,15 @@ msgstr "Antes es necesario identificarse." msgid "" "probable misconfiguration: sslcookie is set, but you are attepting to login " "via http, not https" -msgstr "probablemente algo está mal configurado: la característica 'sslcookie' está activa, pero está intentando registrarse en el sistema vía el protocolo 'http' y no 'https'" +msgstr "" +"probablemente algo está mal configurado: la característica 'sslcookie' está " +"activa, pero está intentando registrarse en el sistema vía el protocolo " +"'http' y no 'https'" #: ../IkiWiki/CGI.pm:149 msgid "login failed, perhaps you need to turn on cookies?" -msgstr "registro fallido, ¿ tal vez necesita activar las cookies en el navegador ?" +msgstr "" +"registro fallido, ¿ tal vez necesita activar las cookies en el navegador ?" #: ../IkiWiki/CGI.pm:168 ../IkiWiki/CGI.pm:299 msgid "Your login session has expired." @@ -67,7 +71,8 @@ msgstr "Contenido añadido activado vía web." #: ../IkiWiki/Plugin/aggregate.pm:93 msgid "Nothing to do right now, all feeds are up-to-date!" -msgstr "¡ No hay nada que hacer, todas las fuentes de noticias están actualizadas !" +msgstr "" +"¡ No hay nada que hacer, todas las fuentes de noticias están actualizadas !" #: ../IkiWiki/Plugin/aggregate.pm:220 #, perl-format @@ -356,7 +361,8 @@ msgstr "" #: ../IkiWiki/Plugin/google.pm:31 msgid "Failed to parse url, cannot determine domain name" -msgstr "Error en el análisis del URL, no puedo determinar el nombre del dominio" +msgstr "" +"Error en el análisis del URL, no puedo determinar el nombre del dominio" #: ../IkiWiki/Plugin/goto.pm:49 msgid "missing page" @@ -447,7 +453,8 @@ msgstr "La página %s está bloqueada y no puede modificarse" #: ../IkiWiki/Plugin/mdwn.pm:44 msgid "multimarkdown is enabled, but Text::MultiMarkdown is not installed" -msgstr "el modo multimarkdown está activo, pero no está instalado Text::MultiMarkdown" +msgstr "" +"el modo multimarkdown está activo, pero no está instalado Text::MultiMarkdown" #: ../IkiWiki/Plugin/mdwn.pm:67 #, perl-format @@ -869,7 +876,8 @@ msgid "plugins" msgstr "complementos" #: ../IkiWiki/Plugin/websetup.pm:395 -msgid "The configuration changes shown below require a wiki rebuild to take effect." +msgid "" +"The configuration changes shown below require a wiki rebuild to take effect." msgstr "" "Los cambios en la configuración que se muestran más abajo precisan una " "reconstrucción del wiki para tener efecto." @@ -985,7 +993,8 @@ msgstr "el programa %s no parece ser ejecutable" #: ../IkiWiki/Wrapper.pm:20 msgid "cannot create a wrapper that uses a setup file" -msgstr "no puedo crear un programa envoltorio que utiliza un archivo de configuración" +msgstr "" +"no puedo crear un programa envoltorio que utiliza un archivo de configuración" #: ../IkiWiki/Wrapper.pm:24 msgid "wrapper filename not specified" @@ -1074,4 +1083,3 @@ msgstr "" #: ../auto.setup:23 msgid "What is the domain name of the web server?" msgstr "¿ Cuál es el dominio para el servidor web ?" - diff --git a/po/fr.po b/po/fr.po index 399fec2a3..eb2623fab 100644 --- a/po/fr.po +++ b/po/fr.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki 3.04\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-02-14 03:04-0500\n" +"POT-Creation-Date: 2009-03-08 19:02-0400\n" "PO-Revision-Date: 2009-02-26 21:28+0100\n" "Last-Translator: Philippe Batailler \n" "Language-Team: French \n" @@ -21,35 +21,41 @@ msgstr "" msgid "You need to log in first." msgstr "Vous devez d'abord vous identifier." -#: ../IkiWiki/CGI.pm:145 +#: ../IkiWiki/CGI.pm:146 +msgid "" +"probable misconfiguration: sslcookie is set, but you are attepting to login " +"via http, not https" +msgstr "" + +#: ../IkiWiki/CGI.pm:149 msgid "login failed, perhaps you need to turn on cookies?" msgstr "Échec de l'identification, vous devez autoriser les cookies." -#: ../IkiWiki/CGI.pm:163 ../IkiWiki/CGI.pm:294 +#: ../IkiWiki/CGI.pm:168 ../IkiWiki/CGI.pm:299 msgid "Your login session has expired." msgstr "Session d'authentification expirée." -#: ../IkiWiki/CGI.pm:184 +#: ../IkiWiki/CGI.pm:189 msgid "Login" msgstr "S’identifier" -#: ../IkiWiki/CGI.pm:185 +#: ../IkiWiki/CGI.pm:190 msgid "Preferences" msgstr "Préférences" -#: ../IkiWiki/CGI.pm:186 +#: ../IkiWiki/CGI.pm:191 msgid "Admin" msgstr "Administrateur" -#: ../IkiWiki/CGI.pm:226 +#: ../IkiWiki/CGI.pm:231 msgid "Preferences saved." msgstr "Les préférences ont été enregistrées." -#: ../IkiWiki/CGI.pm:257 +#: ../IkiWiki/CGI.pm:262 msgid "You are banned." msgstr "Vous avez été banni." -#: ../IkiWiki/CGI.pm:385 ../IkiWiki/CGI.pm:386 ../IkiWiki.pm:1204 +#: ../IkiWiki/CGI.pm:390 ../IkiWiki/CGI.pm:391 ../IkiWiki.pm:1209 msgid "Error" msgstr "Erreur" @@ -177,8 +183,8 @@ msgid "" "Sorry, but that looks like spam to blogspam: " msgstr "" -"Désolé, mais ceci ressemble à un spam à destination de blogspam: " +"Désolé, mais ceci ressemble à un spam à destination de blogspam: " #: ../IkiWiki/Plugin/brokenlinks.pm:33 ../IkiWiki/Plugin/editpage.pm:233 #: ../IkiWiki/Plugin/inline.pm:354 ../IkiWiki/Plugin/opendiscussion.pm:26 @@ -257,7 +263,7 @@ msgstr "Modération du commentaire" msgid "comment moderation" msgstr "modération du commentaire" -#: ../IkiWiki/Plugin/comments.pm:750 +#: ../IkiWiki/Plugin/comments.pm:751 msgid "Comments" msgstr "Commentaires" @@ -813,16 +819,16 @@ msgstr "Téléchargement direct des données" msgid "parse fail at line %d: %s" msgstr "Erreur d'analyse à la ligne %d : %s" -#: ../IkiWiki/Plugin/template.pm:28 +#: ../IkiWiki/Plugin/template.pm:29 msgid "missing id parameter" msgstr "Paramètre d'identification manquant" -#: ../IkiWiki/Plugin/template.pm:35 +#: ../IkiWiki/Plugin/template.pm:36 #, perl-format msgid "template %s not found" msgstr "Modèle de page %s introuvable" -#: ../IkiWiki/Plugin/template.pm:54 +#: ../IkiWiki/Plugin/template.pm:55 msgid "failed to process:" msgstr "Échec du traitement :" @@ -1036,12 +1042,12 @@ msgstr "Impossible d'utiliser plusieurs systèmes de contrôle des versions" msgid "failed to load external plugin needed for %s plugin: %s" msgstr "Impossible de charger le greffon externe nécessaire au greffon %s : %s" -#: ../IkiWiki.pm:1187 +#: ../IkiWiki.pm:1192 #, perl-format msgid "preprocessing loop detected on %s at depth %i" msgstr "Une boucle de pré traitement a été détectée sur %s à hauteur de %i" -#: ../IkiWiki.pm:1725 +#: ../IkiWiki.pm:1730 msgid "yes" msgstr "oui" @@ -1064,4 +1070,3 @@ msgstr "Identifiant de l'administrateur (utilisateur du wiki ou openid) :" #: ../auto.setup:23 msgid "What is the domain name of the web server?" msgstr "Nom de domaine du serveur HTTP :" - diff --git a/po/ikiwiki.pot b/po/ikiwiki.pot index 519417902..ffe2d09e3 100644 --- a/po/ikiwiki.pot +++ b/po/ikiwiki.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-03-01 15:03-0500\n" +"POT-Creation-Date: 2009-03-08 19:02-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" -- cgit v1.2.3 From 10872b91afce95193520f08c0e0e483d70aad96b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 8 Mar 2009 19:06:38 -0400 Subject: add news item for ikiwiki 3.07 --- doc/news/version_3.06.mdwn | 3 --- doc/news/version_3.07.mdwn | 10 ++++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) delete mode 100644 doc/news/version_3.06.mdwn create mode 100644 doc/news/version_3.07.mdwn diff --git a/doc/news/version_3.06.mdwn b/doc/news/version_3.06.mdwn deleted file mode 100644 index 0e2a48fe6..000000000 --- a/doc/news/version_3.06.mdwn +++ /dev/null @@ -1,3 +0,0 @@ -ikiwiki 3.06 released with [[!toggle text="these changes"]] -[[!toggleable text=""" - * Setup automator: Fix bug in password comparison. Closes: #[517654](http://bugs.debian.org/517654)"""]] \ No newline at end of file diff --git a/doc/news/version_3.07.mdwn b/doc/news/version_3.07.mdwn new file mode 100644 index 000000000..fbd448ddc --- /dev/null +++ b/doc/news/version_3.07.mdwn @@ -0,0 +1,10 @@ +ikiwiki 3.07 released with [[!toggle text="these changes"]] +[[!toggleable text=""" + * Updated German translation (Kai Wasserbäch). Closes: #[518377](http://bugs.debian.org/518377) + * Updated French translation (Jean-Luc Coulon). Closes: #[518510](http://bugs.debian.org/518510) + * wmd: New plugin contributed by William Uther to support the WMD + Wysiwym markdown editor. + * smiley: Avoid infinite loop in smiley expansion triggered + by the template scan mode change in version 3.05. Closes: #[518805](http://bugs.debian.org/518805) + * template: When loading a template in scan mode, let preprocess + know it only needs to scan."""]] \ No newline at end of file -- cgit v1.2.3 From 0978be7affa6222d91a0bc71ddd1e86f81fc56cd Mon Sep 17 00:00:00 2001 From: intrigeri Date: Mon, 9 Mar 2009 00:30:19 +0100 Subject: po: fixed last unaddressed item from Joey's review, please have a look Signed-off-by: intrigeri --- doc/plugins/contrib/po.mdwn | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/plugins/contrib/po.mdwn b/doc/plugins/contrib/po.mdwn index 8b19afae6..c39008466 100644 --- a/doc/plugins/contrib/po.mdwn +++ b/doc/plugins/contrib/po.mdwn @@ -320,3 +320,11 @@ finish it at some point in the first quarter of 2009. --[[intrigeri]] >> --[[intrigeri]] > > --[[Joey]] + +I reverted the `%backlinks` and `$backlinks_calculated` exposing. +The issue they were solving probably will arise again when I'll work +on my meta branch again (i.e. when the simplified po one is merged), +but the po thing is supposed to work without these ugly `our`. +Seems like it was the last unaddressed item from Joey's review, so I'm +daring a timid "please pull"... or rather, please review again :) +--[[intrigeri]] -- cgit v1.2.3