From b7d7abf2b490b1b599f318358dc2d299bef179af Mon Sep 17 00:00:00 2001 From: "http://www.cse.unsw.edu.au/~willu/" Date: Sat, 2 Aug 2008 19:53:08 -0400 Subject: [PATCH 1/8] Sidebar layout strange --- doc/bugs/sidebar_is_obscured_by_recentchanges.mdwn | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 doc/bugs/sidebar_is_obscured_by_recentchanges.mdwn diff --git a/doc/bugs/sidebar_is_obscured_by_recentchanges.mdwn b/doc/bugs/sidebar_is_obscured_by_recentchanges.mdwn new file mode 100644 index 000000000..90bb800a5 --- /dev/null +++ b/doc/bugs/sidebar_is_obscured_by_recentchanges.mdwn @@ -0,0 +1,14 @@ +I've set up a simple sidebar on an otherwise fairly default wiki. The sidebar uses css float:right and sits above most pages quite nicely. + +For example, my wiki's [front](http://www.cse.unsw.edu.au/~cs3431/wiki/) and [news](http://www.cse.unsw.edu.au/~cs3431/wiki/news/) pages show the sidebar nicely floating on top of the background. (As a side note, I had to add: + + #sidebar { + border: 1px solid; + background: white; + } + +to local.css to get the border and make sure that the RSS feed's grey title didn't show through on the news page.) + +Unfortunately, the [recentchanges](http://www.cse.unsw.edu.au/~cs3431/wiki/recentchanges/) page doesn't look so nice - the sidebar appears below the recentchanges list. + +I don't understand why the sidebar is appearing below the recentchanges inline, but above the news inline. From 6c2163d596dccf794ef47cf828c209432db2bca3 Mon Sep 17 00:00:00 2001 From: "http://www.cse.unsw.edu.au/~willu/" Date: Sat, 2 Aug 2008 21:52:48 -0400 Subject: [PATCH 2/8] update to actual generated example --- ...s_inconsistent_about_bare_directories.mdwn | 81 ++++++++++++++----- 1 file changed, 63 insertions(+), 18 deletions(-) diff --git a/doc/bugs/map_is_inconsistent_about_bare_directories.mdwn b/doc/bugs/map_is_inconsistent_about_bare_directories.mdwn index 479db3e0f..07c8851b1 100644 --- a/doc/bugs/map_is_inconsistent_about_bare_directories.mdwn +++ b/doc/bugs/map_is_inconsistent_about_bare_directories.mdwn @@ -1,26 +1,71 @@ The [[plugins/map]] plugin has inconsistent behaviour. In particular, I have in my wiki some directory structures holding files without wikitext pointers (I point directly to the files from elsewhere). For example, imagine the following file structure in the source dir: -* Assignments.mdwn -* Assignments - * 2004 - * Assign1.pdf - * Assign2.pdf - * 2005 - * Assign1.pdf - * Assign2.pdf - * 2006 - * etc., etc. + ; ls -R dirA dirB + dirA: + subA subB + + dirA/subA: + filea.mdwn fileb.mdwn + + dirA/subB: + filec.mdwn filed.mdwn + + dirB: + subA subC + + dirB/subA: + filea.mdwn + + dirB/subC: + fileb.mdwn filec.mdwn When I use map to make a map of this, the result looks more like this: -* Assignments # this is a link to the correct page - * 2004 # this has a create link - * Assign1.pdf - * Assign2.pdf - * Assign1.pdf - * Assign2.pdf - * etc., etc. + -Note that while the 2004 directory exists with a create link, the 2005 and 2006 (etc) directories are missing from the site map. +Note that while the dirA/subA directory exists with a create link, the dirA/subB directory is missing from the map. Interstingly, dirB/subC is shown in the map. If you add a second file to dirB/subA then dirB/subC disappears as well. I could imagine including all 'bare' directories in the map, and I could imagine including no 'bare' directories in the map. Just including the first bare directory seems a strange intermediate point. From 35a3559ebe6fe5fbcfc655629ff7458414885a54 Mon Sep 17 00:00:00 2001 From: "http://www.cse.unsw.edu.au/~willu/" Date: Sat, 2 Aug 2008 22:14:26 -0400 Subject: [PATCH 3/8] Add patch to bug report --- ...s_inconsistent_about_bare_directories.mdwn | 49 ++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/doc/bugs/map_is_inconsistent_about_bare_directories.mdwn b/doc/bugs/map_is_inconsistent_about_bare_directories.mdwn index 07c8851b1..c1f388001 100644 --- a/doc/bugs/map_is_inconsistent_about_bare_directories.mdwn +++ b/doc/bugs/map_is_inconsistent_about_bare_directories.mdwn @@ -66,6 +66,53 @@ When I use map to make a map of this, the result looks more like this: -Note that while the dirA/subA directory exists with a create link, the dirA/subB directory is missing from the map. Interstingly, dirB/subC is shown in the map. If you add a second file to dirB/subA then dirB/subC disappears as well. +Note that while the dirA/subA directory exists with a create link, the dirA/subB directory is missing from the map. Interestingly, dirB/subC is shown in the map. If you add a second file to dirB/subA then dirB/subC disappears as well. I could imagine including all 'bare' directories in the map, and I could imagine including no 'bare' directories in the map. Just including the first bare directory seems a strange intermediate point. + +Attached is a [[patch]] that fixes the issue. The current map code makes one pass over the sorted list of pages. This adds an initial pass that goes through and makes sure that all parent directories are included. With this initial pass added, the following pass could probably be simplified. + +Note: This patch adds items to a map while it is in a foreach loop over a sorted list of keys from that same map. Changing a map while iterating through it is normally problematic. I'm assuming the sort insulates the code from this - I do not need to iterate over any of the newly added elements. + + diff --git a/IkiWiki/Plugin/map.pm b/IkiWiki/Plugin/map.pm + index 5b6a843..142073d 100644 + --- a/IkiWiki/Plugin/map.pm + +++ b/IkiWiki/Plugin/map.pm + @@ -67,6 +67,37 @@ sub preprocess (@) { #{{{ + # are removed. + add_depends($params{page}, join(" or ", keys %mapitems)); + + + # Include all the parent directories in the map + + my $lastbase=""; + + foreach my $item (sort keys %mapitems) { + + $item=~s/^\Q$common_prefix\E\/// + + if defined $common_prefix && length $common_prefix; + + my $itembase=IkiWiki::dirname($item); + + if ($itembase ne $lastbase) { + + # find the common dir + + my @a=split(/\//, $itembase); + + my @b=split(/\//, $lastbase); + + my $common_dir=""; + + while (@a && @b && $a[0] eq $b[0]) { + + if (length $common_dir) { + + $common_dir.="/"; + + } + + $common_dir.=shift(@a); + + shift @b; + + } + + # add all the dirs down to the current base + + while (@a) { + + if (length $common_dir) { + + $common_dir.="/"; + + } + + $common_dir.=shift(@a); + + $mapitems{$common_dir}='' + + unless defined $mapitems{$common_dir}; + + } + + $lastbase = $itembase; + + } + + } + + + # Create the map. + my $parent=""; + my $indent=0; From 4cdf41df0cd1383f50060922ea9dafb8c5323051 Mon Sep 17 00:00:00 2001 From: "http://www.cse.unsw.edu.au/~willu/" Date: Sat, 2 Aug 2008 22:20:53 -0400 Subject: [PATCH 4/8] small patch update --- doc/bugs/map_is_inconsistent_about_bare_directories.mdwn | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/bugs/map_is_inconsistent_about_bare_directories.mdwn b/doc/bugs/map_is_inconsistent_about_bare_directories.mdwn index c1f388001..6e9dc104d 100644 --- a/doc/bugs/map_is_inconsistent_about_bare_directories.mdwn +++ b/doc/bugs/map_is_inconsistent_about_bare_directories.mdwn @@ -75,15 +75,17 @@ Attached is a [[patch]] that fixes the issue. The current map code makes one pa Note: This patch adds items to a map while it is in a foreach loop over a sorted list of keys from that same map. Changing a map while iterating through it is normally problematic. I'm assuming the sort insulates the code from this - I do not need to iterate over any of the newly added elements. diff --git a/IkiWiki/Plugin/map.pm b/IkiWiki/Plugin/map.pm - index 5b6a843..142073d 100644 + index 5b6a843..16de45e 100644 --- a/IkiWiki/Plugin/map.pm +++ b/IkiWiki/Plugin/map.pm - @@ -67,6 +67,37 @@ sub preprocess (@) { #{{{ + @@ -67,6 +67,39 @@ sub preprocess (@) { #{{{ # are removed. add_depends($params{page}, join(" or ", keys %mapitems)); + # Include all the parent directories in the map + my $lastbase=""; + + my $commonbase = ""; + + $commonbase = $common_prefix if defined $common_prefix && length $common_prefix; + foreach my $item (sort keys %mapitems) { + $item=~s/^\Q$common_prefix\E\/// + if defined $common_prefix && length $common_prefix; @@ -92,7 +94,7 @@ Note: This patch adds items to a map while it is in a foreach loop over a sorted + # find the common dir + my @a=split(/\//, $itembase); + my @b=split(/\//, $lastbase); - + my $common_dir=""; + + my $common_dir=$commonbase; + while (@a && @b && $a[0] eq $b[0]) { + if (length $common_dir) { + $common_dir.="/"; From b6d1078d5622627d54c8edb3b03fb895034c96f3 Mon Sep 17 00:00:00 2001 From: "http://schmonz.livejournal.com/" Date: Sat, 2 Aug 2008 22:27:34 -0400 Subject: [PATCH 5/8] --- doc/users/schmonz.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/users/schmonz.mdwn b/doc/users/schmonz.mdwn index 7e297fbf0..42b3713ea 100644 --- a/doc/users/schmonz.mdwn +++ b/doc/users/schmonz.mdwn @@ -1 +1 @@ -[Amitai Schlair](http://www.schmonz.com/) recently discovered ikiwiki. +[Amitai Schlair](http://www.schmonz.com/) recently discovered ikiwiki. His first attempt at contributing is [[plugins/contrib/unixauth]]. From e4de043201d82cce8d3b2b5882a61e17e69e3cb0 Mon Sep 17 00:00:00 2001 From: bremner Date: Sun, 3 Aug 2008 08:57:37 -0400 Subject: [PATCH 6/8] --- doc/todo/mbox.mdwn | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/todo/mbox.mdwn b/doc/todo/mbox.mdwn index dd0e5756b..91816ae8a 100644 --- a/doc/todo/mbox.mdwn +++ b/doc/todo/mbox.mdwn @@ -2,9 +2,9 @@ I'd like to be able to drop an unmodified RFC2822 email message into ikiwiki, an > We're discussing doing just that (well, whole mailboxes, really) over in > [[comment_by_mail]] --[[Joey]] ->> If you like to read code, you can have a gander at the +>> The >> [mailbox](http://pivot.cs.unb.ca/git/?p=ikimailbox.git;a=summary) ->> plugin. At the moment, it reads all of the messages in a maildir and passes them through ->> a template of your choice. Kinda acts like `cat` at the moment because none of the ->> css is defined yet. Next missions are threading (Email::Thread?), and maybe some simple css. +>> plugin can now be considered a prototype of itself, tested only with maildirs. +>> Basic threading and some simple css is now included. Next mission: +>> doing something sensible with MIME. >> To see the (unsurprising) syntax, look at [a trivial example markdown file](http://pivot.cs.unb.ca/git/?p=ikimailbox.git;a=blob;f=test/in/index.mdwn;hb=HEAD) From 47b4564c500b93ce6e29fb04618e6f45df004b83 Mon Sep 17 00:00:00 2001 From: "http://jeremie.koenig.myopenid.com/" Date: Sun, 3 Aug 2008 10:50:40 -0400 Subject: [PATCH 7/8] link some related stuff --- doc/todo/plugin.mdwn | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/todo/plugin.mdwn b/doc/todo/plugin.mdwn index 8db4a0182..132de4480 100644 --- a/doc/todo/plugin.mdwn +++ b/doc/todo/plugin.mdwn @@ -61,6 +61,9 @@ Suggestions of ideas for plugins: > The hard part is just that right now the assumption of html as the one destination > type is in the code a lot. --ChapmanFlack + >> Readers who bought this also liked: [[format_escape]], [[multiple_output_formats]] + >> --[[JeremieKoenig]] + * list of registered users - tricky because it sorta calls for a way to rebuild the page when a new user is registered. Might be better as a cgi? > At best, this could only show the users who have logged in, not all > permitted by the current auth plugin(s). HTTP auth would need From eadff687abbec442423967d5cba3bcfb606dc1a9 Mon Sep 17 00:00:00 2001 From: "http://smcv.pseudorandom.co.uk/" Date: Sun, 3 Aug 2008 11:24:20 -0400 Subject: [PATCH 8/8] --- ...nd_a_directive_does_not_contain_a_space.mdwn | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 doc/bugs/Warns_about_use_of_uninitialized_value_if_prefix__95__directives_is_on_and_a_directive_does_not_contain_a_space.mdwn diff --git a/doc/bugs/Warns_about_use_of_uninitialized_value_if_prefix__95__directives_is_on_and_a_directive_does_not_contain_a_space.mdwn b/doc/bugs/Warns_about_use_of_uninitialized_value_if_prefix__95__directives_is_on_and_a_directive_does_not_contain_a_space.mdwn new file mode 100644 index 000000000..6274f1299 --- /dev/null +++ b/doc/bugs/Warns_about_use_of_uninitialized_value_if_prefix__95__directives_is_on_and_a_directive_does_not_contain_a_space.mdwn @@ -0,0 +1,17 @@ +In `IkiWiki::preprocess`, the last capturing group in the regex used to parse directives in prefix_directives mode is of the form `(\s+...)?\]\]`, which will not be matched if the directive is something without arguments or whitespace, like `\[[!orphans]]`. As a result, its value is undef instead of being an empty string, causing a warning when it is used in the anonymous sub `$handle`. A trivial fix is to treat it as "" if it is undef. + +[[patch]] in the master branch of my git repository, and quoted here. --[[smcv]] + + diff --git a/IkiWiki.pm b/IkiWiki.pm + index 241a7c0..d2c35a2 100644 + --- a/IkiWiki.pm + +++ b/IkiWiki.pm + @@ -1167,7 +1167,8 @@ sub preprocess ($$$;$$) { #{{{ + }sx; + } + + - $content =~ s{$regex}{$handle->($1, $2, $3, $4)}eg; + + # $4 can be undef if the directive was \[[!foo]] + + $content =~ s{$regex}{$handle->($1, $2, $3, ($4 or ""))}eg; + return $content; + } #}}}