diff options
50 files changed, 354 insertions, 100 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm index 3430c5742..b8e599928 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1407,7 +1407,7 @@ sub check_content (@) { my %old=map { $_ => 1 } split("\n", readfile(srcfile($pagesources{$params{page}}))); foreach my $line (split("\n", $params{content})) { - push @diff, $line if ! exists $old{$_}; + push @diff, $line if ! exists $old{$line}; } $params{diff}=join("\n", @diff); } diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index 9277223f0..866711a71 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -235,11 +235,15 @@ sub cgi_prefs ($$) { showform($form, $buttons, $session, $q); } -sub cgi_custom_failure ($$) { - my $header=shift; +sub cgi_custom_failure ($$$) { + my $q=shift; + my $httpstatus=shift; my $message=shift; - print $header; + print $q->header( + -status => $httpstatus, + -charset => 'utf-8', + ); print $message; # Internet Explod^Hrer won't show custom 404 responses @@ -274,7 +278,7 @@ sub check_banned ($$) { $session->delete(); cgi_savesession($session); cgi_custom_failure( - $q->header(-status => "403 Forbidden"), + $q, "403 Forbidden", gettext("You are banned.")); } } diff --git a/IkiWiki/Plugin/404.pm b/IkiWiki/Plugin/404.pm index bae9e15d1..85486e559 100644 --- a/IkiWiki/Plugin/404.pm +++ b/IkiWiki/Plugin/404.pm @@ -69,7 +69,8 @@ sub cgi ($) { if (exists $ENV{REDIRECT_STATUS} && $ENV{REDIRECT_STATUS} eq '404') { - my $page = cgi_page_from_404($ENV{REDIRECT_URL}, + my $page = cgi_page_from_404( + Encode::decode_utf8($ENV{REDIRECT_URL}), $config{url}, $config{usedirs}); IkiWiki::Plugin::goto::cgi_goto($cgi, $page); } diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm index 087c315a9..cbe6efc21 100644 --- a/IkiWiki/Plugin/attachment.pm +++ b/IkiWiki/Plugin/attachment.pm @@ -112,7 +112,7 @@ sub formbuilder (@) { return if ! defined $form->field("do") || ($form->field("do") ne "edit" && $form->field("do") ne "create") ; - my $filename=$q->param('attachment'); + my $filename=Encode::decode_utf8($q->param('attachment')); if (defined $filename && length $filename && ($form->submitted eq "Upload Attachment" || $form->submitted eq "Save Page")) { my $session=$params{session}; @@ -189,9 +189,10 @@ sub formbuilder (@) { IkiWiki::saveindex(); } elsif ($form->submitted eq "Insert Links") { - my $page=quotemeta($q->param("page")); + my $page=quotemeta(Encode::decode_utf8($q->param("page"))); my $add=""; foreach my $f ($q->param("attachment_select")) { + $f=Encode::decode_utf8($f); $f=~s/^$page\///; $add.="[[$f]]\n"; } @@ -230,6 +231,7 @@ sub attachment_list ($) { link => htmllink($page, $page, $f, noimageinline => 1), size => IkiWiki::Plugin::filecheck::humansize((stat(_))[7]), mtime => displaytime($IkiWiki::pagemtime{$f}), + mtime_raw => $IkiWiki::pagemtime{$f}, }; } } diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 517e16f9f..6340fc2cb 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -377,8 +377,6 @@ sub editcomment ($$) { IkiWiki::check_canedit($page, $cgi, $session); $postcomment=0; - my $location=unique_comment_location($page, $config{srcdir}); - my $content = "[[!comment format=$type\n"; # FIXME: handling of double quotes probably wrong? @@ -410,8 +408,11 @@ sub editcomment ($$) { my $subject = $form->field('subject'); if (defined $subject && length $subject) { $subject =~ s/"/"/g; - $content .= " subject=\"$subject\"\n"; } + else { + $subject = "comment ".(num_comments($page, $config{srcdir}) + 1); + } + $content .= " subject=\"$subject\"\n"; $content .= " date=\"" . decode_utf8(strftime('%Y-%m-%dT%H:%M:%SZ', gmtime)) . "\"\n"; @@ -421,6 +422,8 @@ sub editcomment ($$) { $editcontent =~ s/"/\\"/g; $content .= " content=\"\"\"\n$editcontent\n\"\"\"]]\n"; + my $location=unique_comment_location($page, $content, $config{srcdir}); + # This is essentially a simplified version of editpage: # - the user does not control the page that's created, only the parent # - it's always a create operation, never an edit @@ -458,7 +461,7 @@ sub editcomment ($$) { if (! $ok) { my $penddir=$config{wikistatedir}."/comments_pending"; - $location=unique_comment_location($page, $penddir); + $location=unique_comment_location($page, $content, $penddir); writefile("$location._comment", $penddir, $content); IkiWiki::printheader($session); print IkiWiki::misctemplate(gettext(gettext("comment stored for moderation")), @@ -554,7 +557,7 @@ sub commentmoderation ($$) { if ($action eq 'Accept') { my $content=eval { readfile($file) }; next if $@; # file vanished since form was displayed - my $dest=unique_comment_location($page, $config{srcdir})."._comment"; + my $dest=unique_comment_location($page, $content, $config{srcdir})."._comment"; writefile($dest, $config{srcdir}, $content); if ($config{rcs} and $config{comments_commit}) { IkiWiki::rcs_add($dest); @@ -813,15 +816,28 @@ sub pagetemplate (@) { } } -sub unique_comment_location ($) { +sub num_comments ($$) { my $page=shift; my $dir=shift; + my @comments=glob("$dir/$page/$config{comments_pagename}*._comment"); + return @comments; +} + +sub unique_comment_location ($$$) { + my $page=shift; + + eval q{use Digest::MD5 'md5_hex'}; + error($@) if $@; + my $content_md5=md5_hex(shift); + + my $dir=shift; + my $location; - my $i = 0; + my $i = num_comments($page, $dir); do { $i++; - $location = "$page/$config{comments_pagename}$i"; + $location = "$page/$config{comments_pagename}${i}_${content_md5}"; } while (-e "$dir/$location._comment"); return $location; diff --git a/IkiWiki/Plugin/getsource.pm b/IkiWiki/Plugin/getsource.pm index ae9ea3cc7..d1555430e 100644 --- a/IkiWiki/Plugin/getsource.pm +++ b/IkiWiki/Plugin/getsource.pm @@ -58,7 +58,8 @@ sub cgi_getsource ($) { if (! exists $pagesources{$page}) { IkiWiki::cgi_custom_failure( - $cgi->header(-status => "404 Not Found"), + $cgi, + "404 Not Found", IkiWiki::misctemplate(gettext("missing page"), "<p>". sprintf(gettext("The page %s does not exist."), diff --git a/IkiWiki/Plugin/goto.pm b/IkiWiki/Plugin/goto.pm index 2e2dc04a1..439552f62 100644 --- a/IkiWiki/Plugin/goto.pm +++ b/IkiWiki/Plugin/goto.pm @@ -51,7 +51,8 @@ sub cgi_goto ($;$) { if (! length $link) { IkiWiki::cgi_custom_failure( - $q->header(-status => "404 Not Found"), + $q, + "404 Not Found", IkiWiki::misctemplate(gettext("missing page"), "<p>". sprintf(gettext("The page %s does not exist."), diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 93dc0149e..17d1611db 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -209,7 +209,7 @@ sub preprocess_inline (@) { if ($params{show}) { $num=$params{show}; } - if ($params{feedshow} && $num < $params{feedshow}) { + if ($params{feedshow} && $num < $params{feedshow} && $num > 0) { $num=$params{feedshow}; } if ($params{skip} && $num) { diff --git a/IkiWiki/Plugin/linkmap.pm b/IkiWiki/Plugin/linkmap.pm index 9540bd112..28acbda32 100644 --- a/IkiWiki/Plugin/linkmap.pm +++ b/IkiWiki/Plugin/linkmap.pm @@ -49,6 +49,7 @@ sub genmap ($) { my $mapnum=shift; return "" unless exists $maps{$mapnum}; my %params=%{$maps{$mapnum}}; + my $connected=IkiWiki::yesno($params{connected}); # Get all the items to map. my %mapitems = map { $_ => urlto($_, $params{destpage}) } @@ -79,24 +80,38 @@ sub genmap ($) { print OUT "charset=\"utf-8\";\n"; print OUT "ratio=compress;\nsize=\"".($params{width}+0).", ".($params{height}+0)."\";\n" if defined $params{width} and defined $params{height}; + my %shown; + my $show=sub { + my $item=shift; + if (! $shown{$item}) { + print OUT "\"$item\" [shape=box,href=\"$mapitems{$item}\"];\n"; + $shown{$item}=1; + } + }; foreach my $item (keys %mapitems) { - print OUT "\"$item\" [shape=box,href=\"$mapitems{$item}\"];\n"; + $show->($item) unless $connected; foreach my $link (map { bestlink($item, $_) } @{$links{$item}}) { - print OUT "\"$item\" -> \"$link\";\n" - if $mapitems{$link}; + next unless length $link and $mapitems{$link}; + foreach my $endpoint ($item, $link) { + $show->($endpoint); + } + print OUT "\"$item\" -> \"$link\";\n"; } } print OUT "}\n"; - close OUT; + close OUT || error gettext("failed to run dot"); local $/=undef; my $ret="<object data=\"".urlto($dest, $params{destpage}). "\" type=\"image/png\" usemap=\"#linkmap$mapnum\">\n". <IN>. "</object>"; - close IN; + close IN || error gettext("failed to run dot"); waitpid $pid, 0; + if ($?) { + error gettext("failed to run dot"); + } $SIG{PIPE}="DEFAULT"; error gettext("failed to run dot") if $sigpipe; diff --git a/IkiWiki/Plugin/monotone.pm b/IkiWiki/Plugin/monotone.pm index 05c5a514d..c717ceefb 100644 --- a/IkiWiki/Plugin/monotone.pm +++ b/IkiWiki/Plugin/monotone.pm @@ -228,7 +228,7 @@ sub read_certs ($$) { my @ret; my $line = $results[0]; - while ($line =~ m/\s+key\s"(.*?)"\nsignature\s"(ok|bad|unknown)"\n\s+name\s"(.*?)"\n\s+value\s"(.*?)"\n\s+trust\s"(trusted|untrusted)"\n/sg) { + while ($line =~ m/\s+key\s["\[](.*?)[\]"]\nsignature\s"(ok|bad|unknown)"\n\s+name\s"(.*?)"\n\s+value\s"(.*?)"\n\s+trust\s"(trusted|untrusted)"\n/sg) { push @ret, { key => $1, signature => $2, diff --git a/IkiWiki/Plugin/pagestats.pm b/IkiWiki/Plugin/pagestats.pm index 47638210a..4313aa271 100644 --- a/IkiWiki/Plugin/pagestats.pm +++ b/IkiWiki/Plugin/pagestats.pm @@ -63,6 +63,16 @@ sub preprocess (@) { $max = $counts{$page} if $counts{$page} > $max; } + if (exists $params{show}) { + my $i=0; + my %show; + foreach my $key (sort { $counts{$b} <=> $counts{$a} } keys %counts) { + last if ++$i > $params{show}; + $show{$key}=$counts{$key}; + } + %counts=%show; + } + if ($style eq 'table') { return "<table class='pageStats'>\n". join("\n", map { diff --git a/IkiWiki/Plugin/remove.pm b/IkiWiki/Plugin/remove.pm index cbc8a0f2c..2b8cf0414 100644 --- a/IkiWiki/Plugin/remove.pm +++ b/IkiWiki/Plugin/remove.pm @@ -166,7 +166,7 @@ sub formbuilder (@) { removal_confirm($q, $session, 0, $form->field("page")); } elsif ($form->submitted eq "Remove Attachments") { - my @selected=$q->param("attachment_select"); + my @selected=map { Encode::decode_utf8($_) } $q->param("attachment_select"); if (! @selected) { error(gettext("Please select the attachments to remove.")); } @@ -187,7 +187,7 @@ sub sessioncgi ($$) { postremove($session); } elsif ($form->submitted eq 'Remove' && $form->validate) { - my @pages=$q->param("page"); + my @pages=$form->field("page"); # Validate removal by checking that the page exists, # and that the user is allowed to edit(/remove) it. @@ -237,7 +237,7 @@ sub sessioncgi ($$) { } } else { - removal_confirm($q, $session, 0, $q->param("page")); + removal_confirm($q, $session, 0, $form->field("page")); } exit 0; diff --git a/IkiWiki/Plugin/rename.pm b/IkiWiki/Plugin/rename.pm index c3e03496f..8213d21f6 100644 --- a/IkiWiki/Plugin/rename.pm +++ b/IkiWiki/Plugin/rename.pm @@ -235,6 +235,7 @@ sub formbuilder (@) { if (defined $form->field("do") && ($form->field("do") eq "edit" || $form->field("do") eq "create")) { + IkiWiki::decode_form_utf8($form); my $q=$params{cgi}; my $session=$params{session}; @@ -242,7 +243,7 @@ sub formbuilder (@) { rename_start($q, $session, 0, $form->field("page")); } elsif ($form->submitted eq "Rename Attachment") { - my @selected=$q->param("attachment_select"); + my @selected=map { Encode::decode_utf8($_) } $q->param("attachment_select"); if (@selected > 1) { error(gettext("Only one attachment can be renamed at a time.")); } @@ -278,7 +279,7 @@ sub sessioncgi ($$) { if ($q->param("do") eq 'rename') { my $session=shift; - my ($form, $buttons)=rename_form($q, $session, $q->param("page")); + my ($form, $buttons)=rename_form($q, $session, Encode::decode_utf8($q->param("page"))); IkiWiki::decode_form_utf8($form); if ($form->submitted eq 'Cancel') { @@ -290,9 +291,9 @@ sub sessioncgi ($$) { # These untaints are safe because of the checks # performed in check_canrename later. - my $src=$q->param("page"); + my $src=$form->field("page"); my $srcfile=IkiWiki::possibly_foolish_untaint($pagesources{$src}); - my $dest=IkiWiki::possibly_foolish_untaint(titlepage($q->param("new_name"))); + my $dest=IkiWiki::possibly_foolish_untaint(titlepage($form->field("new_name"))); my $destfile=$dest; if (! $q->param("attachment")) { my $type=$q->param('type'); diff --git a/IkiWiki/Plugin/toc.pm b/IkiWiki/Plugin/toc.pm index a585564e7..b8537d3eb 100644 --- a/IkiWiki/Plugin/toc.pm +++ b/IkiWiki/Plugin/toc.pm @@ -53,8 +53,8 @@ sub format (@) { my $page=""; my $index=""; my %anchors; - my $curlevel; - my $startlevel=0; + my $startlevel=($params{startlevel} ? $params{startlevel} : 0); + my $curlevel=$startlevel-1; my $liststarted=0; my $indent=sub { "\t" x $curlevel }; $p->handler(start => sub { @@ -65,12 +65,17 @@ sub format (@) { my $anchor="index".++$anchors{$level}."h$level"; $page.="$text<a name=\"$anchor\"></a>"; - # Take the first header level seen as the topmost level, + # Unless we're given startlevel as a parameter, + # take the first header level seen as the topmost level, # even if there are higher levels seen later on. if (! $startlevel) { $startlevel=$level; $curlevel=$startlevel-1; } + elsif (defined $params{startlevel} && + $level < $params{startlevel}) { + return; + } elsif ($level < $startlevel) { $level=$startlevel; } diff --git a/debian/changelog b/debian/changelog index ccf45df94..4ad346c13 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,35 @@ -ikiwiki (3.20091203) UNRELEASED; urgency=low +ikiwiki (3.20091219) UNRELEASED; urgency=low + + * pagestats: Add show parameter. Closes: #562129 (David Paleino) + * toc: Add startlevel parameter. (kerravonsen) + * Remove example ikiwiki setup file from the Debian package. This + re-enables linking to /usr/share/ikiwiki/examples which has the + example sites also used by auto-blog.setup. The example setup file + can be generated at any time using ikiwiki --dumpsetup so I do + not see a reason to ship it. Closes: #562183 + * Use env hack in python scripts. + * comments: Add a checksum to the name of comment pages, to + avoid merge conflicts when comments are posted to two branches of a + site. + * linkmap: Add option to omit disconnected pages from the map. + * inline: Fix bug that limited displayed pages when feedshow was + specified w/o show. + + -- Joey Hess <joeyh@debian.org> Fri, 25 Dec 2009 14:31:22 -0500 + +ikiwiki (3.20091218) unstable; urgency=low - * cvs: Add missing bit to Automator. * Add complete Spanish basewiki translation done by Fernando Gonzalez de Requena. + * Improve javascript onload handling. + * monotone: Deal with format change in version 0.45. + (Thanks, Richard Levitte) + * cvs: Add missing bit to Automator. + * attachment: Fix reversion in attachment sorting by age. + * Fix utf-8 problems in rename, remove, attachment, 404, sourcepage, and + goto. - -- Joey Hess <joeyh@debian.org> Wed, 02 Dec 2009 17:22:21 -0500 + -- Joey Hess <joeyh@debian.org> Fri, 18 Dec 2009 20:47:24 -0500 ikiwiki (3.20091202) unstable; urgency=low diff --git a/debian/examples b/debian/examples deleted file mode 100644 index a1e623192..000000000 --- a/debian/examples +++ /dev/null @@ -1 +0,0 @@ -ikiwiki.setup diff --git a/doc/bugs/anonok_vs._httpauth.mdwn b/doc/bugs/anonok_vs._httpauth.mdwn new file mode 100644 index 000000000..90c8c74c9 --- /dev/null +++ b/doc/bugs/anonok_vs._httpauth.mdwn @@ -0,0 +1,10 @@ +I've got a wiki where editing requires [[plugins/httpauth]] (with +`cgiauthurl` working nicely). I now want to let the general public +edit Discussion subpages, so I enabled [[plugins/anonok]] and set +`anonok_pagespec` to `'*/Discussion'`, but HTTP auth is still being +required for those. + +(Actually, what I'll really want to do is probably [[plugins/lockedit]] +and a whitelist of OpenIDs in `locked_pages`...) + +--[[schmonz]] diff --git a/doc/bugs/disable_sub-discussion_pages.mdwn b/doc/bugs/disable_sub-discussion_pages.mdwn index 5e9c8c9f9..233a377f1 100644 --- a/doc/bugs/disable_sub-discussion_pages.mdwn +++ b/doc/bugs/disable_sub-discussion_pages.mdwn @@ -6,6 +6,9 @@ I do want discussion subpage, but I don't want to have, for example: discussion/ > Discussion pages should clearly be a special case that don't get Discussion > links put at the top... aaand.. [[bugs/done]]! --[[Joey]] +>> This bug appears to have returned. For example, +>> [[plugins/contrib/unixauth/discussion]] has a Discussion link. -- [[schmonz]] + >>> Joey, I've just seen that you closed that bug in ikiwiki 1.37, but it seems >>> you fixed it only for English "discussion" page. The bug still occurs >>> for the international "discussion" pages. I have backported ikiwiki 1.40 diff --git a/doc/bugs/rst_plugin_has_python_hardcode_in_shebang_line.mdwn b/doc/bugs/rst_plugin_has_python_hardcode_in_shebang_line.mdwn new file mode 100644 index 000000000..a594adc09 --- /dev/null +++ b/doc/bugs/rst_plugin_has_python_hardcode_in_shebang_line.mdwn @@ -0,0 +1,15 @@ +Current the rst plugin uses this shebang line: + + #!/usr/bin/python + +The problem is that rst plugin uses some feature (for example, iterator comprehension) which is unavailable on old version of Python. + +So rst plugin will not work on a machine which has an old version of python in system path even though +the user have installed a new version of python in other place. For example, I am using ikiwiki with the rst plugin on Mac OS X 10.4 which ships python 2.3 but I do have python2.6 installed on /opt/local/bin/python (via macports). + +Thus I suggest to change the shebang line to: + + #!/usr/bin/env python + +> [[done]], although the irony of all the perl hashbangs in ikiwiki +> being hardcoded doesn't escape me. --[[Joey]] diff --git a/doc/css_market.mdwn b/doc/css_market.mdwn index fe58e77f1..a0943547c 100644 --- a/doc/css_market.mdwn +++ b/doc/css_market.mdwn @@ -49,6 +49,12 @@ gnomes will convert them to css files..) the action list (Edit, RecentChanges, etc.) as tabs. [[!meta stylesheet="actiontabs"]] +* **[wiki.css](http://cyborginstitute.net/includes/wiki.css)** by [[tychoish]]. + I typically throw this in as `local.css` in new wikis as a slightly more clear and readable + layout for wikis that need to be functional and elegant, but not necessarily uniquely designed. + Currently in use by the [the outeralliance wiki](http://oa.criticalfutures.com/). + + If your web browser allows selecting between multiple stylesheets, this page can be viewed using many of the stylesheets above. For example, if using Epiphany with the Select Stylesheet extension enabled, use View -> diff --git a/doc/examples/softwaresite/bugs/New_bug.mdwn b/doc/examples/softwaresite/bugs/New_bug.mdwn deleted file mode 100644 index 85f68d2b6..000000000 --- a/doc/examples/softwaresite/bugs/New_bug.mdwn +++ /dev/null @@ -1 +0,0 @@ -This is a new bug report! diff --git a/doc/examples/softwaresite/bugs/needs_more_bugs.mdwn b/doc/examples/softwaresite/bugs/needs_more_bugs.mdwn index 6627ac0b9..a150570a4 100644 --- a/doc/examples/softwaresite/bugs/needs_more_bugs.mdwn +++ b/doc/examples/softwaresite/bugs/needs_more_bugs.mdwn @@ -1,4 +1,3 @@ FooBar does not have enough bugs, which suggests that it's not a real Free Software project. Please help create more bugs by adding code to FooBar! :-) -And what now? diff --git a/doc/git.mdwn b/doc/git.mdwn index fef2e01e0..293446772 100644 --- a/doc/git.mdwn +++ b/doc/git.mdwn @@ -53,6 +53,8 @@ into [[Joey]]'s working tree. This is recommended. :-) * [[kaizer]] `git://github.com/engla/ikiwiki.git` * [[bbb]] `http://git.boulgour.com/bbb/ikiwiki.git` * [[KathrynAndersen]] `git://github.com/rubykat/ikiplugins.git` +* [[ktf]] `git://github.com/ktf/ikiwiki.git` + ## branches diff --git a/doc/ikiwiki/directive/inline/discussion.mdwn b/doc/ikiwiki/directive/inline/discussion.mdwn index e5cfeb91c..998ba642b 100644 --- a/doc/ikiwiki/directive/inline/discussion.mdwn +++ b/doc/ikiwiki/directive/inline/discussion.mdwn @@ -132,11 +132,15 @@ Else can you please suggest a smarter way of getting certain data out from pages Reading the documentation I would think that `feedshow` does not influence `show`. - [[!inline pages="./blog/*" archive=yes quick=yes feedshow=10 sort=title reverse=yes]] + \[[!inline pages="./blog/*" archive=yes quick=yes feedshow=10 sort=title reverse=yes]] Only ten pages are listed in this example although `archive` is set to yes. Removing `feedshow=10` all matching pages are shown. Is that behaviour intended? +> Is something going wrong because `quick="yes"` [[»turns off generation of any feeds«|inline]]? --[[PaulePanter]] + --[[PaulePanter]] + +>> Bug was that if feedshow was specified without show it limited to it incorrectly. Fixed. --[[Joey]] diff --git a/doc/ikiwiki/directive/linkmap.mdwn b/doc/ikiwiki/directive/linkmap.mdwn index 38cf0fd11..baa6fff61 100644 --- a/doc/ikiwiki/directive/linkmap.mdwn +++ b/doc/ikiwiki/directive/linkmap.mdwn @@ -7,9 +7,7 @@ graph showing the links between a set of pages in the wiki. Example usage: Only links between mapped pages will be shown; links pointing to or from unmapped pages will be omitted. If the pages to include are not specified, -the links between all pages (and other files) in the wiki are mapped. For -best results, only a small set of pages should be mapped, since otherwise -the map can become very large, unwieldy, and complicated. +the links between all pages (and other files) in the wiki are mapped. Here are descriptions of all the supported parameters to the `linkmap` directive: @@ -18,5 +16,14 @@ directive: * `height`, `width` - Limit the size of the map to a given height and width, in inches. Both must be specified for the limiting to take effect, otherwise the map's size is not limited. +* `connected` - Controls whether to include pages on the map that link to + no other pages (connected=no, the default), or to only show pages that + link to others (connected=yes). + +For best results, only a small set of pages should be mapped, since +otherwise the map can become very large, unwieldy, and complicated. +If too many pages are included, the map may get so large that graphviz +cannot render it. Using the `connected` parameter is a good way to prune +out pages that clutter the map. [[!meta robots="noindex, follow"]] diff --git a/doc/ikiwiki/directive/pagestats.mdwn b/doc/ikiwiki/directive/pagestats.mdwn index f14c80b07..68f4d2734 100644 --- a/doc/ikiwiki/directive/pagestats.mdwn +++ b/doc/ikiwiki/directive/pagestats.mdwn @@ -22,4 +22,10 @@ Or to display a cloud of tags related to Linux, you could use: \[[!pagestats pages="tags/* and not tags/linux" among="tagged(linux)"]] +The optional `show` parameter limits display to the specified number of +pages. For instance, to show a table of the top ten pages with the most +links: + + \[[!pagestats style="table" show="10"]] + [[!meta robots="noindex, follow"]] diff --git a/doc/ikiwiki/directive/pagestats/discussion.mdwn b/doc/ikiwiki/directive/pagestats/discussion.mdwn index 3c9dc7104..d72b4058d 100644 --- a/doc/ikiwiki/directive/pagestats/discussion.mdwn +++ b/doc/ikiwiki/directive/pagestats/discussion.mdwn @@ -7,4 +7,9 @@ I would rather not find and create a page for every tag I have created or will c Thanks ----- +> Hello unknown person. + +> I think it would require a different approach to what "tags" are, and/or what "pagestats" are. The pagestats plugin gives statistical information about *pages*, so it requires the pages in question to exist before it can get information about them. The tags plugin creates links to tag *pages*, with the expectation that a human being will create said pages and put whatever content they want on them (such as describing what the tag is about, and a map linking back to the tagged pages). + +> The approach that [PmWiki](http://www.pmwiki.org) takes is that it enables the optional auto-creation of (empty) pages which match a particular "group" (set of sub-pages); thus one could set all the "tags/*" pages to be auto-created, creating a new tags/foo page the first time the \[[!tag foo]] directive is used. See [[todo/auto-create_tag_pages_according_to_a_template]] for more discussion on this idea. +> -- [[KathrynAndersen]] diff --git a/doc/ikiwiki/directive/toc.mdwn b/doc/ikiwiki/directive/toc.mdwn index bf504dafc..bb1afa1ac 100644 --- a/doc/ikiwiki/directive/toc.mdwn +++ b/doc/ikiwiki/directive/toc.mdwn @@ -14,6 +14,12 @@ the `levels` parameter: The toc directive will take the level of the first header as the topmost level, even if there are higher levels seen later in the file. +To create a table of contents that only shows headers starting with a given +level, use the `startlevel` parameter. For example, to show only h2 and +smaller headers: + + \[[!toc startlevel=2]] + The table of contents will be created as an ordered list. If you want an unordered list instead, you can change the list-style in your local style sheet. diff --git a/doc/ikiwikiusers.mdwn b/doc/ikiwikiusers.mdwn index 418768a2c..aa4b4b4e6 100644 --- a/doc/ikiwikiusers.mdwn +++ b/doc/ikiwikiusers.mdwn @@ -2,6 +2,7 @@ Projects & Organizations ======================== * [This wiki](http://ikiwiki.info) (of course!) +<!-- * [NetBSD wiki](http://wiki.netbsd.org) --> * The [GNU Hurd](http://www.gnu.org/software/hurd/) * [DragonFly BSD](http://www.dragonflybsd.org/) * [Monotone](http://monotone.ca/wiki/FrontPage/) diff --git a/doc/news/server_move_2009.mdwn b/doc/news/server_move_2009.mdwn index 5865d2b7f..8be5debe1 100644 --- a/doc/news/server_move_2009.mdwn +++ b/doc/news/server_move_2009.mdwn @@ -1,6 +1,6 @@ [[!meta title="server move"]] -The ikiwiki.info domain has been moved to a new server. If you can see -this, though, your DNS has not caught up and you're using the old server -still. Any changes made will be synced over to the new server, so don't -worry. --[[Joey]] +The ikiwiki.info domain has been moved to a new server. If you can see +this, your DNS has already caught up and you are using the new server. +By the way, the new server should be somewhat faster. +--[[Joey]] diff --git a/doc/news/version_3.20091022.mdwn b/doc/news/version_3.20091022.mdwn deleted file mode 100644 index 6fc9713c0..000000000 --- a/doc/news/version_3.20091022.mdwn +++ /dev/null @@ -1,10 +0,0 @@ -ikiwiki 3.20091022 released with [[!toggle text="these changes"]] -[[!toggleable text=""" - * edittemplate: Allow template page name to be specified using anything - legal for a wikilink (including eg, leading slashes). - * edittemplate: Work around bug #551499 in CGI::FormBuilder. - * Fix a bug introduced in the last version that caused ikiwiki - to skip all files if a sourcedir of "./" was specified. - * Support CFLAGS when building wrapper. - * meta: Gather permalink info on scan pass so it is available - to inline when using a template that does not include page content."""]]
\ No newline at end of file diff --git a/doc/news/version_3.20091218.mdwn b/doc/news/version_3.20091218.mdwn new file mode 100644 index 000000000..224e81c4e --- /dev/null +++ b/doc/news/version_3.20091218.mdwn @@ -0,0 +1,11 @@ +ikiwiki 3.20091218 released with [[!toggle text="these changes"]] +[[!toggleable text=""" + * Add complete Spanish basewiki translation done by Fernando Gonzalez de + Requena. + * Improve javascript onload handling. + * monotone: Deal with format change in version 0.45. + (Thanks, Richard Levitte) + * cvs: Add missing bit to Automator. + * attachment: Fix reversion in attachment sorting by age. + * Fix utf-8 problems in rename, remove, attachment, 404, sourcepage, and + goto."""]]
\ No newline at end of file diff --git a/doc/plugins/contrib/field.mdwn b/doc/plugins/contrib/field.mdwn index 745a36bcd..a43bf24b2 100644 --- a/doc/plugins/contrib/field.mdwn +++ b/doc/plugins/contrib/field.mdwn @@ -1,4 +1,5 @@ [[!template id=plugin name=field author="[[rubykat]]"]] +[[!tag type/meta]] [[!toc]] ## NAME diff --git a/doc/plugins/contrib/pod.mdwn b/doc/plugins/contrib/pod.mdwn index dafffa844..97a9c648a 100644 --- a/doc/plugins/contrib/pod.mdwn +++ b/doc/plugins/contrib/pod.mdwn @@ -1,4 +1,5 @@ [[!template id=plugin name=pod author="[[rubykat]]"]] +[[!tag type/format]] ## NAME IkiWiki::Plugin::pod - process pages written in POD format. @@ -34,3 +35,4 @@ The following options can be set in the ikiwiki setup file. * browse at GitHub: <http://github.com/rubykat/ikiplugins/blob/master/IkiWiki/Plugin/pod.pm> * git repo at git://github.com/rubykat/ikiplugins.git + diff --git a/doc/plugins/contrib/xslt.mdwn b/doc/plugins/contrib/xslt.mdwn index c30e618ea..80c956c58 100644 --- a/doc/plugins/contrib/xslt.mdwn +++ b/doc/plugins/contrib/xslt.mdwn @@ -1,4 +1,5 @@ [[!template id=plugin name=xslt author="[[rubykat]]"]] +[[!tag type/chrome]] ## NAME IkiWiki::Plugin::xslt - ikiwiki directive to process an XML file with XSLT diff --git a/doc/plugins/google.mdwn b/doc/plugins/google.mdwn index 7c61e637b..349c278ee 100644 --- a/doc/plugins/google.mdwn +++ b/doc/plugins/google.mdwn @@ -5,8 +5,7 @@ This plugin adds a search form to the wiki, using google's site search. Google is asked to search for pages in the domain specified in the wiki's `url` configuration parameter. Results will depend on whether google has -indexed the site, and how recently. Also, if the same domain has other -content, outside the wiki's content, it will be searched as well. +indexed the site, and how recently. The [[search]] plugin offers full text search of only the wiki, but requires that a search engine be installed on your site. diff --git a/doc/plugins/google/discussion.mdwn b/doc/plugins/google/discussion.mdwn index 94fc36a35..e664f5723 100644 --- a/doc/plugins/google/discussion.mdwn +++ b/doc/plugins/google/discussion.mdwn @@ -11,3 +11,15 @@ domain, and appears to be legal. I've got a wiki that'd benefit tweaked to do this? --[[schmonz]] > Done. --[[Joey]] + +The main page said: + +> Also, if the same domain has other content, outside the wiki's +> content, it will be searched as well. + +Is it still true now? (Or this statement is out of date?) --[weakish] + +[weakish]: http://weakish.pigro.net + +> I checked, and it's never been true; google is given the url to the top +> of the wiki and only searches things in there. --[[Joey]] diff --git a/doc/todo/ACL.mdwn b/doc/todo/ACL.mdwn index e9fb2717f..d40701d60 100644 --- a/doc/todo/ACL.mdwn +++ b/doc/todo/ACL.mdwn @@ -69,3 +69,10 @@ Here is how I see it: <pre> \[[!acl user=* page=/subsite/* acl=/subsite/acl.mdwn]] </pre> + +Any idea when this is going to be finished? If you want, I am happy to beta test. + +> It's already done, though that is sorta hidden in the above. :-) +> Example of use to only allow two users to edit the tipjar page: +> locked_pages => 'tipjar and !(user(joey) or user(bob))', +> --[[Joey]] diff --git a/doc/todo/Resolve_native_reStructuredText_links_to_ikiwiki_pages.mdwn b/doc/todo/Resolve_native_reStructuredText_links_to_ikiwiki_pages.mdwn index ca7b282fa..6e0f32fd5 100644 --- a/doc/todo/Resolve_native_reStructuredText_links_to_ikiwiki_pages.mdwn +++ b/doc/todo/Resolve_native_reStructuredText_links_to_ikiwiki_pages.mdwn @@ -322,3 +322,12 @@ The page is rST-parsed once in 'scan' and once in 'htmlize' (the first to genera >> However, I think that if the cache does not work for a big load, it should >> not work at all; small loads are small so they don't matter. --ulrik +----- + +Another possiblity is using empty url for wikilinks (gitit uses this approach), for example: + + `SomePage <>`_ + +Since it uses *empty* url, I would like to call it *proposal 0* :-) --[weakish] + +[weakish]: http://weakish.pigro.net diff --git a/doc/todo/conflict_free_comment_merges.mdwn b/doc/todo/conflict_free_comment_merges.mdwn new file mode 100644 index 000000000..2cef0ee8c --- /dev/null +++ b/doc/todo/conflict_free_comment_merges.mdwn @@ -0,0 +1,23 @@ +Currently, new comments are named with an incrementing ID (comment_N). So +if a wiki has multiple disconnected servers, and comments are made to the +same page on both, merging is guaranteed to result in conflicts. + +I propose avoiding such merge problems by naming a comment with a sha1sum +of its (full) content. Keep the incrementing ID too, so there is an +-ordering. And so duplicate comments are allowed..) +So, "comment_N_SHA1". + +Note: The comment body will need to use meta title in the case where no +title is specified, to retain the current behavior of the default title +being "comment N". + +What do you think [[smcv]]? --[[Joey]] + +> I had to use md5sums, as sha1sum perl module may not be available and I +> didn't want to drag it in. But I think that's ok; this doesn't need to be +> cryptographically secure and even the chances of being able to +> purposefully cause a md5 collision and thus an undesired merge conflict +> are quite low since it modifies the input text and adds a date stamp to +> it. +> +> Anyway, I think it's good, [[[done]] --[[Joey]] diff --git a/doc/todo/tagging_with_a_publication_date.mdwn b/doc/todo/tagging_with_a_publication_date.mdwn index 80240ec5a..39fc4e220 100644 --- a/doc/todo/tagging_with_a_publication_date.mdwn +++ b/doc/todo/tagging_with_a_publication_date.mdwn @@ -38,3 +38,34 @@ on vacation". > > > > I no longer have the original wiki for which I wanted this feature, but I can > > see using it on future ones. -- [[DonMarti]] + +>>> FWIW, for the case where one wants to update a site offline, +>>> using an ikiwiki instance on a laptop, and include some deffered +>>> posts in the push, the ad-hoc cron job type approach will be annoying. +>>> +>>> In modern ikiwiki, I guess the way to accomplish this would be to +>>> add a pagespec that matches only pages posted in the present or past. +>>> Then a page can have its post date set to the future, using meta date, +>>> and only show up when its post date rolls around. +>>> +>>> Ikiwiki will need to somehow notice that a pagespec began matching +>>> a page it did not match previously, despite said page not actually +>>> changing. I'm not sure what the best way is. +>>> +>>> * One way could be to +>>> use a needsbuild hook and some stored data about which pagespecs +>>> exclude pages in the future. (But I'm not sure how evaluating the +>>> pagespec could lead to that metadata and hook being set up.) +>>> * Another way would be to use an explicit directive to delay a +>>> page being posted. Then the directive stores the metadata and +>>> sets up the needsbuild hook. +>>> * Another way would be for ikiwiki to remember the last +>>> time it ran. It could then easily find pages that have a post +>>> date after that time, and treat them the same as it treats actually +>>> modified files. Or a plugin could do this via a needsbuild hook, +>>> probably. (Only downside to this is it would probably need to do +>>> a O(n) walk of the list of pages -- but only running an integer +>>> compare per page.) +>>> +>>> You'd still need a cron job to run ikiwiki -refresh every hour, or +>>> whatever, so it can update. --[[Joey]] diff --git a/doc/todo/toc_plugin:_set_a_header_ceiling___40__opposite_of_levels__61____41__.mdwn b/doc/todo/toc_plugin:_set_a_header_ceiling___40__opposite_of_levels__61____41__.mdwn index ce51d90a3..07d2d383c 100644 --- a/doc/todo/toc_plugin:_set_a_header_ceiling___40__opposite_of_levels__61____41__.mdwn +++ b/doc/todo/toc_plugin:_set_a_header_ceiling___40__opposite_of_levels__61____41__.mdwn @@ -10,19 +10,39 @@ Currently, the levels=X parameter lets you tweak how deep it will go for small h > > projects prefer to receive changes as unified diffs (or as > > branches in their chosen VCS, which is [[git]] here). --[[smcv]] - 56,57c56,57 - < my $curlevel; - < my $startlevel=0; - --- - > my $startlevel=($params{startlevel} ? $params{startlevel} : 0); - > my $curlevel=$startlevel-1; - 69a70 - > # unless we're given startlevel as a parameter - 73a75,79 - > elsif (defined $params{startlevel} - > and $level < $params{startlevel}) - > { - > return; - > } +> > > Done. -- [[KathrynAndersen]] + +> > > > Looks like Joey has now [[merged|done]] this. Thanks! --[[smcv]] + + --- /files/git/other/ikiwiki/IkiWiki/Plugin/toc.pm 2009-11-16 12:44:00.352050178 +1100 + +++ toc.pm 2009-12-26 06:36:06.686512552 +1100 + @@ -53,8 +53,8 @@ + my $page=""; + my $index=""; + my %anchors; + - my $curlevel; + - my $startlevel=0; + + my $startlevel=($params{startlevel} ? $params{startlevel} : 0); + + my $curlevel=$startlevel-1; + my $liststarted=0; + my $indent=sub { "\t" x $curlevel }; + $p->handler(start => sub { + @@ -67,10 +67,16 @@ + + # Take the first header level seen as the topmost level, + # even if there are higher levels seen later on. + + # unless we're given startlevel as a parameter + if (! $startlevel) { + $startlevel=$level; + $curlevel=$startlevel-1; + } + + elsif (defined $params{startlevel} + + and $level < $params{startlevel}) + + { + + return; + + } + elsif ($level < $startlevel) { + $level=$startlevel; + } [[!tag patch]] diff --git a/doc/usage.mdwn b/doc/usage.mdwn index 4ee935f73..e4808d4c2 100644 --- a/doc/usage.mdwn +++ b/doc/usage.mdwn @@ -249,8 +249,8 @@ also be configured using a setup file. Makes ikiwiki look in the specified directory first, before the regular locations when loading library files and plugins. For example, if you set - libdir to "/home/you/.ikiwiki/", you can install a Foo.pm plugin as - "/home/you/.ikiwiki/IkiWiki/Plugin/Foo.pm". + libdir to "/home/you/.ikiwiki/", you can install a foo.pm plugin as + "/home/you/.ikiwiki/IkiWiki/Plugin/foo.pm". * --discussion, --no-discussion diff --git a/doc/w3mmode.mdwn b/doc/w3mmode.mdwn index 3afee5c9b..04e37ba04 100644 --- a/doc/w3mmode.mdwn +++ b/doc/w3mmode.mdwn @@ -1,5 +1,5 @@ It's possible to use all of ikiwiki's web features (page editing, etc) in -the `w3m` web browser without using a web server. `w3m` supports local CGI +the [`w3m`](http://w3m.sourceforge.net/) web browser without using a web server. `w3m` supports local CGI scripts, and ikiwiki can be set up to run that way. This requires some special configuration: diff --git a/ikiwiki.spec b/ikiwiki.spec index 1651377e1..eb6e5d039 100644 --- a/ikiwiki.spec +++ b/ikiwiki.spec @@ -1,5 +1,5 @@ Name: ikiwiki -Version: 3.20091202 +Version: 3.20091218 Release: 1%{?dist} Summary: A wiki compiler diff --git a/plugins/pythondemo b/plugins/pythondemo index c63ce3973..911f4d7d9 100755 --- a/plugins/pythondemo +++ b/plugins/pythondemo @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: utf-8 -*- # # pythondemo — demo Python ikiwiki plugin diff --git a/plugins/rst b/plugins/rst index 449dba415..9f64b33a0 100755 --- a/plugins/rst +++ b/plugins/rst @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: utf-8 -*- # # rst — xml-rpc-based ikiwiki plugin to process RST files diff --git a/po/ikiwiki.pot b/po/ikiwiki.pot index eb1824411..bf78ec046 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-12-02 13:10-0500\n" +"POT-Creation-Date: 2009-12-18 20:48-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -30,7 +30,7 @@ msgstr "" msgid "login failed, perhaps you need to turn on cookies?" msgstr "" -#: ../IkiWiki/CGI.pm:169 ../IkiWiki/CGI.pm:314 +#: ../IkiWiki/CGI.pm:169 ../IkiWiki/CGI.pm:318 msgid "Your login session has expired." msgstr "" @@ -50,11 +50,11 @@ msgstr "" msgid "Preferences saved." msgstr "" -#: ../IkiWiki/CGI.pm:278 +#: ../IkiWiki/CGI.pm:282 msgid "You are banned." msgstr "" -#: ../IkiWiki/CGI.pm:405 ../IkiWiki/CGI.pm:406 ../IkiWiki.pm:1281 +#: ../IkiWiki/CGI.pm:409 ../IkiWiki/CGI.pm:410 ../IkiWiki.pm:1281 msgid "Error" msgstr "" @@ -320,20 +320,20 @@ msgstr "" msgid "fortune failed" msgstr "" -#: ../IkiWiki/Plugin/getsource.pm:62 ../IkiWiki/Plugin/goto.pm:55 +#: ../IkiWiki/Plugin/getsource.pm:63 ../IkiWiki/Plugin/goto.pm:56 msgid "missing page" msgstr "" -#: ../IkiWiki/Plugin/getsource.pm:64 ../IkiWiki/Plugin/goto.pm:57 +#: ../IkiWiki/Plugin/getsource.pm:65 ../IkiWiki/Plugin/goto.pm:58 #, perl-format msgid "The page %s does not exist." msgstr "" -#: ../IkiWiki/Plugin/getsource.pm:73 +#: ../IkiWiki/Plugin/getsource.pm:74 msgid "not a page" msgstr "" -#: ../IkiWiki/Plugin/getsource.pm:75 +#: ../IkiWiki/Plugin/getsource.pm:76 #, perl-format msgid "%s is an attachment, not a page." msgstr "" @@ -817,20 +817,20 @@ msgstr "" msgid "Also rename SubPages and attachments" msgstr "" -#: ../IkiWiki/Plugin/rename.pm:247 +#: ../IkiWiki/Plugin/rename.pm:248 msgid "Only one attachment can be renamed at a time." msgstr "" -#: ../IkiWiki/Plugin/rename.pm:250 +#: ../IkiWiki/Plugin/rename.pm:251 msgid "Please select the attachment to rename." msgstr "" -#: ../IkiWiki/Plugin/rename.pm:347 +#: ../IkiWiki/Plugin/rename.pm:348 #, perl-format msgid "rename %s to %s" msgstr "" -#: ../IkiWiki/Plugin/rename.pm:571 +#: ../IkiWiki/Plugin/rename.pm:572 #, perl-format msgid "update for rename of %s to %s" msgstr "" @@ -1059,16 +1059,16 @@ msgstr "" msgid "you must enter a wikiname (that contains alphanumerics)" msgstr "" -#: ../IkiWiki/Setup/Automator.pm:76 +#: ../IkiWiki/Setup/Automator.pm:79 #, perl-format msgid "unsupported revision control system %s" msgstr "" -#: ../IkiWiki/Setup/Automator.pm:102 +#: ../IkiWiki/Setup/Automator.pm:105 msgid "failed to set up the repository with ikiwiki-makerepo" msgstr "" -#: ../IkiWiki/Setup/Automator.pm:120 +#: ../IkiWiki/Setup/Automator.pm:123 #, perl-format msgid "** Disabling plugin %s, since it is failing with this message:" msgstr "" diff --git a/templates/misc.tmpl b/templates/misc.tmpl index 0de56edeb..9ec9a59cb 100644 --- a/templates/misc.tmpl +++ b/templates/misc.tmpl @@ -20,7 +20,10 @@ <div class="pageheader"> <div class="header"> <span> -<TMPL_VAR INDEXLINK>/ <TMPL_VAR TITLE> +<TMPL_VAR INDEXLINK>/ +<span class="title"> +<TMPL_VAR TITLE> +</span> </span> </div> </div> <!-- .pageheader --> diff --git a/underlays/javascript/ikiwiki.js b/underlays/javascript/ikiwiki.js index 1252f244f..aebc5cf7e 100644 --- a/underlays/javascript/ikiwiki.js +++ b/underlays/javascript/ikiwiki.js @@ -10,11 +10,13 @@ if (document.addEventListener) { // other browsers window.onload = run_hooks_onload; +var onload_done = 0; + function run_hooks_onload() { // avoid firing twice - if (arguments.callee.done) + if (onload_done) return; - arguments.callee.done = true; + onload_done = true; run_hooks("onload"); } |