From: Joey Hess Date: Wed, 29 Jun 2011 21:55:53 +0000 (-0400) Subject: Merge remote-tracking branch 'smcv/comments-metadata' X-Git-Tag: 3.20110707~16 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/6d01db205f41f16755fe7fbe49694b3bba2121c8?hp=94268a46cd30fc72b51714e42e9db741eb29cc73 Merge remote-tracking branch 'smcv/comments-metadata' --- diff --git a/Bundle/IkiWiki.pm b/Bundle/IkiWiki.pm index 532006baf..795fef463 100644 --- a/Bundle/IkiWiki.pm +++ b/Bundle/IkiWiki.pm @@ -29,6 +29,7 @@ Mail::Sendmail CGI Data::Dumper YAML +JSON =head1 AUTHOR diff --git a/IkiWiki.pm b/IkiWiki.pm index 8136a7c4b..8a66dcedb 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -237,8 +237,8 @@ sub getsetup () { html5 => { type => "boolean", default => 0, - description => "generate HTML5? (experimental)", - advanced => 1, + description => "generate HTML5?", + advanced => 0, safe => 1, rebuild => 1, }, @@ -1026,7 +1026,7 @@ sub bestlink ($$) { sub isinlinableimage ($) { my $file=shift; - return $file =~ /\.(png|gif|jpg|jpeg)$/i; + return $file =~ /\.(png|gif|jpg|jpeg|svg)$/i; } sub pagetitle ($;$) { @@ -1237,7 +1237,7 @@ sub htmllink ($$$;@) { $cgilink = " "create", - page => lc($link), + page => $link, from => $lpage )."\" rel=\"nofollow\">?"; } diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index 6a04decb6..62383b6fd 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -429,7 +429,7 @@ sub cgi (;$$) { # userinfo db. if (! userinfo_get($session->param("name"), "regdate")) { userinfo_setall($session->param("name"), { - email => "", + email => defined $session->param("email") ? $session->param("email") : "", password => "", regdate => time, }) || error("failed adding user"); diff --git a/IkiWiki/Plugin/aggregate.pm b/IkiWiki/Plugin/aggregate.pm index 4a704617e..5e22609c9 100644 --- a/IkiWiki/Plugin/aggregate.pm +++ b/IkiWiki/Plugin/aggregate.pm @@ -614,6 +614,7 @@ sub add_page (@) { # updating an existing post $guid=$guids{$params{guid}}; return if $guid->{expired}; + write_page($feed, $guid, $mtime, \%params); } else { # new post @@ -640,23 +641,33 @@ sub add_page (@) { $c++ } - # Make sure that the file name isn't too long. - # NB: This doesn't check for path length limits. - my $max=POSIX::pathconf($config{srcdir}, &POSIX::_PC_NAME_MAX); - if (defined $max && length(htmlfn($page)) >= $max) { + $guid->{page}=$page; + eval { write_page($feed, $guid, $mtime, \%params) }; + if ($@) { + # assume failure was due to a too long filename + # (or o $c=""; $page=$feed->{dir}."/item"; while (exists $IkiWiki::pagecase{lc $page.$c} || -e $IkiWiki::Plugin::transient::transientdir."/".htmlfn($page.$c) || - - -e "$config{srcdir}/".htmlfn($page.$c)) { + -e "$config{srcdir}/".htmlfn($page.$c)) { $c++ } + + $guid->{page}=$page; + write_page($feed, $guid, $mtime, \%params); } - $guid->{page}=$page; debug(sprintf(gettext("creating new page %s"), $page)); } +} + +sub write_page ($$$$$) { + my $feed=shift; + my $guid=shift; + my $mtime=shift; + my %params=%{shift()}; + $guid->{feed}=$feed->{name}; # To write or not to write? Need to avoid writing unchanged pages diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm index 647a671a5..4d6dee23e 100644 --- a/IkiWiki/Plugin/attachment.pm +++ b/IkiWiki/Plugin/attachment.pm @@ -6,11 +6,13 @@ use strict; use IkiWiki 3.00; sub import { + add_underlay("attachment"); add_underlay("javascript"); + add_underlay("jquery"); hook(type => "getsetup", id => "attachment", call => \&getsetup); hook(type => "checkconfig", id => "attachment", call => \&checkconfig); hook(type => "formbuilder_setup", id => "attachment", call => \&formbuilder_setup); - hook(type => "formbuilder", id => "attachment", call => \&formbuilder); + hook(type => "formbuilder", id => "attachment", call => \&formbuilder, last => 1); IkiWiki::loadplugin("filecheck"); } @@ -89,10 +91,20 @@ sub formbuilder_setup (@) { $form->tmpl_param("field-upload" => ''); $form->tmpl_param("field-link" => ''); - # Add the toggle javascript; the attachments interface uses - # it to toggle visibility. + # Add all the javascript used by the attachments interface. require IkiWiki::Plugin::toggle; - $form->tmpl_param("javascript" => IkiWiki::Plugin::toggle::include_javascript($params{page})); + my $js=IkiWiki::Plugin::toggle::include_javascript($params{page}); + $js.=''."\n"; + my @jsfiles=qw{jquery.min jquery-ui.min + jquery.tmpl.min jquery.iframe-transport + jquery.fileupload jquery.fileupload-ui + }; + foreach my $file (@jsfiles) { + $js.=''."\n"; + } + $form->tmpl_param("javascript" => $js); + # Start with the attachments interface toggled invisible, # but if it was used, keep it open. if ($form->submitted ne "Upload Attachment" && @@ -103,6 +115,12 @@ sub formbuilder_setup (@) { else { $form->tmpl_param("attachments-class" => "toggleable-open"); } + + # Save attachments in holding area before previewing so + # they can be seen in the preview. + if ($form->submitted eq "Preview") { + attachments_save($form, $params{session}); + } } } @@ -114,88 +132,15 @@ sub formbuilder (@) { return if ! defined $form->field("do") || ($form->field("do") ne "edit" && $form->field("do") ne "create") ; 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}; - - # This is an (apparently undocumented) way to get the name - # of the temp file that CGI writes the upload to. - my $tempfile=$q->tmpFileName($filename); - if (! defined $tempfile || ! length $tempfile) { - # perl 5.8 needs an alternative, awful method - if ($q =~ /HASH/ && exists $q->{'.tmpfiles'}) { - foreach my $key (keys(%{$q->{'.tmpfiles'}})) { - $tempfile=$q->tmpFileName(\$key); - last if defined $tempfile && length $tempfile; - } - } - if (! defined $tempfile || ! length $tempfile) { - error("CGI::tmpFileName failed to return the uploaded file name"); - } - } - - $filename=IkiWiki::basename($filename); - $filename=~s/.*\\+(.+)/$1/; # hello, windows - - $filename=linkpage(IkiWiki::possibly_foolish_untaint( - attachment_location($form->field('page')). - $filename)); - if (IkiWiki::file_pruned($filename)) { - error(gettext("bad attachment filename")); - } - - # Check that the user is allowed to edit a page with the - # name of the attachment. - IkiWiki::check_canedit($filename, $q, $session); - # And that the attachment itself is acceptable. - check_canattach($session, $filename, $tempfile); - - # Needed for fast_file_copy and for rendering below. - require IkiWiki::Render; - - # Move the attachment into place. - # Try to use a fast rename; fall back to copying. - IkiWiki::prep_writefile($filename, $config{srcdir}); - unlink($config{srcdir}."/".$filename); - if (rename($tempfile, $config{srcdir}."/".$filename)) { - # The temp file has tight permissions; loosen up. - chmod(0666 & ~umask, $config{srcdir}."/".$filename); - } - else { - my $fh=$q->upload('attachment'); - if (! defined $fh || ! ref $fh) { - # needed by old CGI versions - $fh=$q->param('attachment'); - if (! defined $fh || ! ref $fh) { - # even that doesn't always work, - # fall back to opening the tempfile - $fh=undef; - open($fh, "<", $tempfile) || error("failed to open \"$tempfile\": $!"); - } - } - binmode($fh); - writefile($filename, $config{srcdir}, undef, 1, sub { - IkiWiki::fast_file_copy($tempfile, $filename, $fh, @_); - }); - } + if (defined $filename && length $filename) { + attachment_store($filename, $form, $q, $params{session}); + } - # Check the attachment in and trigger a wiki refresh. - if ($config{rcs}) { - IkiWiki::rcs_add($filename); - IkiWiki::disable_commit_hook(); - IkiWiki::rcs_commit( - file => $filename, - message => gettext("attachment upload"), - token => IkiWiki::rcs_prepedit($filename), - session => $session, - ); - IkiWiki::enable_commit_hook(); - IkiWiki::rcs_update(); - } - IkiWiki::refresh(); - IkiWiki::saveindex(); + if ($form->submitted eq "Save Page") { + attachments_save($form, $params{session}); } - elsif ($form->submitted eq "Insert Links") { + + if ($form->submitted eq "Insert Links") { my $page=quotemeta(Encode::decode_utf8($q->param("page"))); my $add=""; foreach my $f ($q->param("attachment_select")) { @@ -220,6 +165,140 @@ sub formbuilder (@) { $form->tmpl_param("attachment_list" => [attachment_list($form->field('page'))]); } +sub attachment_holding_location { + my $page=attachment_location(shift); + + my $dir=$config{wikistatedir}."/attachments/". + IkiWiki::possibly_foolish_untaint(linkpage($page)); + $dir=~s/\/$//; + return $dir; +} + +sub is_held_attachment { + my $attachment=shift; + + my $f=attachment_holding_location($attachment); + if (-f $f) { + return $f + } + else { + return undef; + } +} + +# Stores the attachment in a holding area, not yet in the wiki proper. +sub attachment_store { + my $filename=shift; + my $form=shift; + my $q=shift; + my $session=shift; + + # This is an (apparently undocumented) way to get the name + # of the temp file that CGI writes the upload to. + my $tempfile=$q->tmpFileName($filename); + if (! defined $tempfile || ! length $tempfile) { + # perl 5.8 needs an alternative, awful method + if ($q =~ /HASH/ && exists $q->{'.tmpfiles'}) { + foreach my $key (keys(%{$q->{'.tmpfiles'}})) { + $tempfile=$q->tmpFileName(\$key); + last if defined $tempfile && length $tempfile; + } + } + if (! defined $tempfile || ! length $tempfile) { + error("CGI::tmpFileName failed to return the uploaded file name"); + } + } + + $filename=IkiWiki::basename($filename); + $filename=~s/.*\\+(.+)/$1/; # hello, windows + $filename=IkiWiki::possibly_foolish_untaint(linkpage($filename)); + my $dest=attachment_holding_location($form->field('page')); + + # Check that the user is allowed to edit the attachment. + my $final_filename= + linkpage(IkiWiki::possibly_foolish_untaint( + attachment_location($form->field('page')))). + $filename; + eval { + if (IkiWiki::file_pruned($final_filename)) { + error(gettext("bad attachment filename")); + } + IkiWiki::check_canedit($final_filename, $q, $session); + # And that the attachment itself is acceptable. + check_canattach($session, $final_filename, $tempfile); + }; + if ($@) { + json_response($q, $form, $dest."/".$filename, $@); + error $@; + } + + # Move the attachment into holding directory. + # Try to use a fast rename; fall back to copying. + IkiWiki::prep_writefile($filename, $dest); + unlink($dest."/".$filename); + if (rename($tempfile, $dest."/".$filename)) { + # The temp file has tight permissions; loosen up. + chmod(0666 & ~umask, $dest."/".$filename); + } + else { + my $fh=$q->upload('attachment'); + if (! defined $fh || ! ref $fh) { + # needed by old CGI versions + $fh=$q->param('attachment'); + if (! defined $fh || ! ref $fh) { + # even that doesn't always work, + # fall back to opening the tempfile + $fh=undef; + open($fh, "<", $tempfile) || error("failed to open \"$tempfile\": $!"); + } + } + binmode($fh); + require IkiWiki::Render; + writefile($filename, $dest, undef, 1, sub { + IkiWiki::fast_file_copy($tempfile, $filename, $fh, @_); + }); + } + + json_response($q, $form, $dest."/".$filename, stored_msg()); +} + +# Save all stored attachments for a page. +sub attachments_save { + my $form=shift; + my $session=shift; + + # Move attachments out of holding directory. + my @attachments; + my $dir=attachment_holding_location($form->field('page')); + foreach my $filename (glob("$dir/*")) { + next unless -f $filename; + my $dest=$config{srcdir}."/". + linkpage(IkiWiki::possibly_foolish_untaint( + attachment_location($form->field('page')))). + IkiWiki::basename($filename); + unlink($dest); + rename($filename, $dest); + push @attachments, $dest; + } + return unless @attachments; + require IkiWiki::Render; + IkiWiki::prune($dir); + + # Check the attachments in and trigger a wiki refresh. + if ($config{rcs}) { + IkiWiki::rcs_add($_) foreach @attachments; + IkiWiki::disable_commit_hook(); + IkiWiki::rcs_commit_staged( + message => gettext("attachment upload"), + session => $session, + ); + IkiWiki::enable_commit_hook(); + IkiWiki::rcs_update(); + } + IkiWiki::refresh(); + IkiWiki::saveindex(); +} + sub attachment_location ($) { my $page=shift; @@ -235,23 +314,75 @@ sub attachment_list ($) { my $page=shift; my $loc=attachment_location($page); - my @ret; + my $std=sub { + my $file=shift; + my $mtime=shift; + my $date=shift; + my $size=shift; + + name => $file, + size => IkiWiki::Plugin::filecheck::humansize($size), + mtime => $date, + mtime_raw => $mtime, + }; + + # attachments already in the wiki + my %attachments; foreach my $f (values %pagesources) { if (! defined pagetype($f) && $f=~m/^\Q$loc\E[^\/]+$/) { - push @ret, { - "field-select" => '', + $attachments{$f}={ + $std->($f, $IkiWiki::pagemtime{$f}, displaytime($IkiWiki::pagemtime{$f}), (stat($f))[7]), link => htmllink($page, $page, $f, noimageinline => 1), - size => IkiWiki::Plugin::filecheck::humansize((stat($f))[7]), - mtime => displaytime($IkiWiki::pagemtime{$f}), - mtime_raw => $IkiWiki::pagemtime{$f}, }; } } + + # attachments in holding directory + my $dir=attachment_holding_location($page); + my $heldmsg=gettext("this attachment is not yet saved"); + foreach my $file (glob("$dir/*")) { + next unless -f $file; + my $base=IkiWiki::basename($file); + my $f=$loc.$base; + $attachments{$f}={ + $std->($f, (stat($file))[9]*2, stored_msg(), (stat(_))[7]), + link => $base, + } + } - # Sort newer attachments to the top of the list, so a newly-added - # attachment appears just before the form used to add it. - return sort { $b->{mtime_raw} <=> $a->{mtime_raw} || $a->{link} cmp $b->{link} } @ret; + # Sort newer attachments to the end of the list. + return sort { $a->{mtime_raw} <=> $b->{mtime_raw} || $a->{link} cmp $b->{link} } + values %attachments; +} + +sub stored_msg { + gettext("just uploaded"); +} + +sub json_response ($$$$) { + my $q=shift; + my $form=shift; + my $filename=shift; + my $stored_msg=shift; + + if (! defined $form->submitted || + $form->submitted ne "Upload Attachment") { + eval q{use JSON}; + error $@ if $@; + print "Content-type: text/html\n\n"; + my $size=-s $filename; + print to_json([ + { + name => IkiWiki::basename($filename), + size => $size, + humansize => IkiWiki::Plugin::filecheck::humansize($size), + stored_msg => $stored_msg, + + } + ]); + exit 0; + } } 1 diff --git a/IkiWiki/Plugin/editpage.pm b/IkiWiki/Plugin/editpage.pm index 3d094c263..a385ed839 100644 --- a/IkiWiki/Plugin/editpage.pm +++ b/IkiWiki/Plugin/editpage.pm @@ -227,6 +227,8 @@ sub cgi_editpage ($$) { $absolute || $form->submitted) { @page_locs=$best_loc=$page; + unshift @page_locs, lc($page) + if ! $form->submitted && lc($page) ne $page; } else { my $dir=$from."/"; @@ -241,13 +243,18 @@ sub cgi_editpage ($$) { $best_loc=$dir.$page; } + my $mixedcase=lc($page) ne $page; + + push @page_locs, $dir.lc($page) if $mixedcase; push @page_locs, $dir.$page; - push @page_locs, "$from/$page"; + push @page_locs, $from."/".lc($page) if $mixedcase; + push @page_locs, $from."/".$page; while (length $dir) { $dir=~s![^/]+/+$!!; + push @page_locs, $dir.lc($page) if $mixedcase; push @page_locs, $dir.$page; } - + my $userpage=IkiWiki::userpage($page); push @page_locs, $userpage if ! grep { $_ eq $userpage } @page_locs; diff --git a/IkiWiki/Plugin/headinganchors.pm b/IkiWiki/Plugin/headinganchors.pm new file mode 100644 index 000000000..ece6f4eac --- /dev/null +++ b/IkiWiki/Plugin/headinganchors.pm @@ -0,0 +1,43 @@ +#!/usr/bin/perl +# quick HTML heading id adder by Paul Wise +package IkiWiki::Plugin::headinganchors; + +use warnings; +use strict; +use IkiWiki 3.00; +use URI::Escape; + +sub import { + hook(type => "getsetup", id => "headinganchors", call => \&getsetup); + hook(type => "sanitize", id => "headinganchors", call => \&headinganchors); +} + +sub getsetup () { + return + plugin => { + safe => 1, + rebuild => undef, + section => "widget", + }, +} + +sub text_to_anchor { + my $str = shift; + $str =~ s/^\s+//; + $str =~ s/\s+$//; + $str =~ s/\s/_/g; + $str =~ s/"//g; + $str =~ s/^[^a-zA-Z]/z-/; # must start with an alphabetical character + $str = uri_escape_utf8($str); + $str =~ s/%/./g; + return $str; +} + +sub headinganchors (@) { + my %params=@_; + my $content=$params{content}; + $content=~s{([^>]*)}{''.$2.''}gie; + return $content; +} + +1 diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm index 103f6b2b3..b98e843d4 100644 --- a/IkiWiki/Plugin/img.pm +++ b/IkiWiki/Plugin/img.pm @@ -64,10 +64,11 @@ sub preprocess (@) { my $dir = $params{page}; my $base = IkiWiki::basename($file); + my $issvg = $base=~s/\.svg$/.png/i; eval q{use Image::Magick}; error gettext("Image::Magick is not installed") if $@; - my $im = Image::Magick->new; + my $im = Image::Magick->new($issvg ? (magick => "png") : ()); my $imglink; my $r = $im->Read($srcfile); error sprintf(gettext("failed to read %s: %s"), $file, $r) if $r; diff --git a/IkiWiki/Plugin/openid.pm b/IkiWiki/Plugin/openid.pm index bd2cfdc44..b6642619a 100644 --- a/IkiWiki/Plugin/openid.pm +++ b/IkiWiki/Plugin/openid.pm @@ -8,6 +8,7 @@ use IkiWiki 3.00; sub import { add_underlay("openid-selector"); + add_underlay("jquery"); hook(type => "checkconfig", id => "openid", call => \&checkconfig); hook(type => "getsetup", id => "openid", call => \&getsetup); hook(type => "auth", id => "openid", call => \&auth); diff --git a/IkiWiki/Plugin/remove.pm b/IkiWiki/Plugin/remove.pm index bc481502a..b94447020 100644 --- a/IkiWiki/Plugin/remove.pm +++ b/IkiWiki/Plugin/remove.pm @@ -117,13 +117,27 @@ sub removal_confirm ($$@) { my $session=shift; my $attachment=shift; my @pages=@_; + + # Special case for unsaved attachments. + foreach my $page (@pages) { + if (IkiWiki::Plugin::attachment->can("is_held_attachment")) { + my $f=IkiWiki::Plugin::attachment::is_held_attachment($page); + if (defined $f) { + print STDERR "!! remove $f\n"; + require IkiWiki::Render; + IkiWiki::prune($f); + } + } + } + @pages=grep { exists $pagesources{$_} } @pages; + return unless @pages; foreach my $page (@pages) { IkiWiki::check_canedit($page, $q, $session); check_canremove($page, $q, $session); } - # Save current form state to allow returning to it later + # Save current form state to allow returning to it later # without losing any edits. # (But don't save what button was submitted, to avoid # looping back to here.) @@ -178,10 +192,10 @@ sub formbuilder (@) { } sub sessioncgi ($$) { - my $q=shift; + my $q=shift; if ($q->param("do") eq 'remove') { - my $session=shift; + my $session=shift; my ($form, $buttons)=confirmation_form($q, $session); IkiWiki::decode_form_utf8($form); @@ -192,7 +206,7 @@ sub sessioncgi ($$) { IkiWiki::checksessionexpiry($q, $session, $q->param('sid')); my @pages=$form->field("page"); - + # Validate removal by checking that the page exists, # and that the user is allowed to edit(/remove) it. my @files; diff --git a/IkiWiki/Plugin/rename.pm b/IkiWiki/Plugin/rename.pm index e871b815d..aa1081756 100644 --- a/IkiWiki/Plugin/rename.pm +++ b/IkiWiki/Plugin/rename.pm @@ -179,8 +179,15 @@ sub rename_start ($$$$) { my $attachment=shift; my $page=shift; - check_canrename($page, $pagesources{$page}, undef, undef, - $q, $session); + # Special case for renaming held attachments; normal checks + # don't apply. + my $held=$attachment && + IkiWiki::Plugin::attachment->can("is_held_attachment") && + IkiWiki::Plugin::attachment::is_held_attachment($page); + if (! defined $held) { + check_canrename($page, $pagesources{$page}, undef, undef, + $q, $session); + } # Save current form state to allow returning to it later # without losing any edits. @@ -291,13 +298,11 @@ sub sessioncgi ($$) { elsif ($form->submitted eq 'Rename' && $form->validate) { IkiWiki::checksessionexpiry($q, $session, $q->param('sid')); - # Queue of rename actions to perfom. - my @torename; - # These untaints are safe because of the checks # performed in check_canrename later. my $src=$form->field("page"); - my $srcfile=IkiWiki::possibly_foolish_untaint($pagesources{$src}); + my $srcfile=IkiWiki::possibly_foolish_untaint($pagesources{$src}) + if exists $pagesources{$src}; my $dest=IkiWiki::possibly_foolish_untaint(titlepage($form->field("new_name"))); my $destfile=$dest; if (! $q->param("attachment")) { @@ -312,6 +317,19 @@ sub sessioncgi ($$) { $destfile=newpagefile($dest, $type); } + + # Special case for renaming held attachments. + my $held=$q->param("attachment") && + IkiWiki::Plugin::attachment->can("is_held_attachment") && + IkiWiki::Plugin::attachment::is_held_attachment($src); + if (defined $held) { + rename($held, IkiWiki::Plugin::attachment::attachment_holding_location($dest)); + postrename($session, $src, $dest, $q->param("attachment")) + unless defined $srcfile; + } + + # Queue of rename actions to perfom. + my @torename; push @torename, { src => $src, srcfile => $srcfile, diff --git a/IkiWiki/Plugin/userlist.pm b/IkiWiki/Plugin/userlist.pm new file mode 100644 index 000000000..2ebf61978 --- /dev/null +++ b/IkiWiki/Plugin/userlist.pm @@ -0,0 +1,76 @@ +#!/usr/bin/perl +package IkiWiki::Plugin::userlist; + +use warnings; +use strict; +use IkiWiki 3.00; + +sub import { + hook(type => "getsetup", id => "userlist", call => \&getsetup); + hook(type => "sessioncgi", id => "userlist", call => \&sessioncgi); + hook(type => "formbuilder_setup", id => "userlist", + call => \&formbuilder_setup); +} + +sub getsetup () { + return + plugin => { + safe => 1, + rebuild => 0, + section => "web", + }, +} + +sub sessioncgi ($$) { + my $cgi=shift; + my $session=shift; + + if ($cgi->param("do") eq "userlist") { + showuserlist($cgi, $session); + exit; + } +} + +sub formbuilder_setup (@) { + my %params=@_; + + my $form=$params{form}; + if ($form->title eq "preferences" && + IkiWiki::is_admin($params{session}->param("name"))) { + push @{$params{buttons}}, "Users"; + if ($form->submitted && $form->submitted eq "Users") { + showuserlist($params{cgi}, $params{session}); + exit; + } + } +} + +sub showuserlist ($$) { + my $q=shift; + my $session=shift; + + IkiWiki::needsignin($q, $session); + if (! defined $session->param("name") || + ! IkiWiki::is_admin($session->param("name"))) { + error(gettext("you are not logged in as an admin")); + } + + my $h="\n"; + $h.="\n"; + my $info=IkiWiki::userinfo_retrieve(); + eval q{use HTML::Entities}; + if (ref $info) { + foreach my $user (sort { $info->{$a}->{regdate} <=> $info->{$b}->{regdate} } keys %$info) { + my %i=%{$info->{$user}}; + $h.="\n"; + } + } + $h.="
".gettext("login")."".gettext("email")."
".encode_entities($user)."". + encode_entities(defined $i{email} ? $i{email} : ""). + "
\n"; + + IkiWiki::printheader($session); + print IkiWiki::cgitemplate(undef, gettext("Users"), $h); +} + +1 diff --git a/IkiWiki/Wrapper.pm b/IkiWiki/Wrapper.pm index 4fe2d8111..d39a3ea40 100644 --- a/IkiWiki/Wrapper.pm +++ b/IkiWiki/Wrapper.pm @@ -49,7 +49,7 @@ sub gen_wrapper () { push @envsave, qw{REMOTE_ADDR QUERY_STRING REQUEST_METHOD REQUEST_URI CONTENT_TYPE CONTENT_LENGTH GATEWAY_INTERFACE HTTP_COOKIE REMOTE_USER HTTPS REDIRECT_STATUS - HTTP_HOST SERVER_PORT HTTPS + HTTP_HOST SERVER_PORT HTTPS HTTP_ACCEPT REDIRECT_URL} if $config{cgi}; my $envsave=""; foreach my $var (@envsave) { diff --git a/debian/changelog b/debian/changelog index cf3539f1d..8f659cb31 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,36 @@ -ikiwiki (3.20110432) UNRELEASED; urgency=low - +ikiwiki (3.20110609) UNRELEASED; urgency=low + + * userlist: New plugin, lets admins see a list of users and their info. + * aggregate: Improve checking for too long aggregated filenames. + * Updated to jQuery 1.6.1. + * attachment: Speed up multiple file uploads by storing uploaded files + in a staging area until the page is saved/previewed, rather than + refreshing the site after each upload. + (Sponsored by The TOVA Company.) + * attachment: Files can be dragged into the edit page to upload them. + Multiple file batch upload support. Upload progress bars. + AJAX special effects. Impemented using the jQuery-File-Upload widget. + (If you don't have javascript don't worry, I kept that working too.) + (Sponsored by The TOVA Company.) + * Add libtext-multimarkdown-perl to Suggests. Closes: #630705 + * headinganchors: Plugin by Paul Wise that adds ids to headings. + * html5 is not experimental anymore. But not the default either, quite yet. + * Support svg as a inlinable image type; svg images can be included on a + page by simply linking to them, or by using the img directive. + Note that sanitizing svg files is still not addressed. + * img: Generate png format thumbnails for svg images. + * Preserve mixed case in page creation links, and when creating a page + whose title is mixed case, allow selecting between the mixed case and + all lower-case names. + * Fix ikiwiki-update-wikilist -r to actually work. + + -- Joey Hess Thu, 09 Jun 2011 10:06:44 -0400 + +ikiwiki (3.20110608) unstable; urgency=high + + * ikiwiki-mass-rebuild: Fix tty hijacking vulnerability by using su. + (Once su's related bug #628843 is fixed.) Thanks, Ludwig Nussel. + (CVE-2011-1408) * search: Update search page when page.tmpl or searchquery.tmpl are locally modified. diff --git a/debian/control b/debian/control index 202f82db6..b01c88ae3 100644 --- a/debian/control +++ b/debian/control @@ -20,7 +20,7 @@ Architecture: all Depends: ${misc:Depends}, ${perl:Depends}, ${python:Depends}, libtext-markdown-perl | markdown, libhtml-scrubber-perl, libhtml-template-perl, - libhtml-parser-perl, liburi-perl (>= 1.36), libyaml-perl + libhtml-parser-perl, liburi-perl (>= 1.36), libyaml-perl, libjson-perl Recommends: gcc | c-compiler, libc6-dev | libc-dev, subversion | git-core (>= 1:1.5.0) | git (>= 1:1.7) | tla | bzr (>= 0.91) | mercurial | monotone (>= 0.38) | darcs, @@ -38,7 +38,8 @@ Suggests: viewvc | gitweb | viewcvs, libsearch-xapian-perl, libtext-csv-perl, graphviz, libnet-amazon-s3-perl, libsparkline-php, texlive, dvipng, libtext-wikicreole-perl, libsort-naturally-perl, libtext-textile-perl, libhighlight-perl, - po4a (>= 0.35-1), gettext, libnet-inet6glue-perl + po4a (>= 0.35-1), gettext, libnet-inet6glue-perl, + libtext-multimarkdown-perl Conflicts: ikiwiki-plugin-table Replaces: ikiwiki-plugin-table Provides: ikiwiki-plugin-table diff --git a/debian/copyright b/debian/copyright index 82c72d734..bcd9642b6 100644 --- a/debian/copyright +++ b/debian/copyright @@ -203,10 +203,27 @@ Comment: From http://code.google.com/p/openid-selector/ License: BSD-2-clause -Files: underlays/openid-selector/ikiwiki/openid/jquery.js -Copyright: © 2005-2008 by John Resig, Branden Aaron & Jörn Zaefferer +Files: underlays/jquery/* +Copyright: © 2005-2011 by John Resig, Branden Aaron & Jörn Zaefferer + © 2011 The Dojo Foundation License: GPL-2 +Files: underlays/attachments/ikiwiki/jquery-ui* +Copyright: © 2008 Paul Bakaus + © 2011 the jQuery UI Authors (http://jqueryui.com/about) +License: GPL-2 + +Files: underlays/attachments/ikiwiki/jquery.tmpl.min.js +Copyright: © Boris Moore +License: GPL-2 + +Files: underlays/attachments/ikiwiki/ +Copyright: 2010, 2011 Sebastian Tschan +Comment: + blueimp / jQuery-File-Upload widget, + from https://github.com/blueimp/jQuery-File-Upload +License: Expat + Files: underlays/themes/blueview/style.css Copyright: © 2009,2010 Bernd Zeimetz © 2008 Yahoo! Inc. diff --git a/doc/bugs/404_plugin_should_handle_403.mdwn b/doc/bugs/404_plugin_should_handle_403.mdwn new file mode 100644 index 000000000..50288e525 --- /dev/null +++ b/doc/bugs/404_plugin_should_handle_403.mdwn @@ -0,0 +1,16 @@ +Apache will return 403 (Forbidden) instead of 404 (Not Found) if the +`Indexes` option is turned off. This is because with `Indexes` turned on, +it considers it something it *might* be able to serve in the future. With +`Indexes` off, it will never serve that page in the future (unless +`Indexes` is turned back on). + +The [[404 plugin|plugins/404]] code only checks for 404, not 403. It should check for both. + +> There are plenty of reasons a web server might 403. In most of those +> cases, trying to create a page where the forbidden content is is not the +> right thing for ikiwiki to do. --[[Joey]] + +See Also: + + * [StackOverflow: 404-vs-403](http://stackoverflow.com/questions/5075300/404-vs-403-when-directory-index-is-missing) + * [[404 plugin discussion|plugins/404/discussion]] diff --git a/doc/bugs/Comments_are_not_sorted_by_their_date_attribute.mdwn b/doc/bugs/Comments_are_not_sorted_by_their_date_attribute.mdwn index a656a33a0..f5a331a1a 100644 --- a/doc/bugs/Comments_are_not_sorted_by_their_date_attribute.mdwn +++ b/doc/bugs/Comments_are_not_sorted_by_their_date_attribute.mdwn @@ -15,7 +15,7 @@ The presentation of the resulting comments is not sorted by this date, which I w > > That's not what I intended - it's meant to be more or less just > > syntactic sugar for `\[[!meta date=foo]]`, setting the `%pagectime`. > > The code looks as though it ought to work, but perhaps it's buggy? -> > --[[smcv]] +> > (edited to add: it is, see below) --[[smcv]] > > The only time I've seen this be much problem personally is when moving > a page, which means moving its comments directory, which tends to @@ -46,3 +46,21 @@ The presentation of the resulting comments is not sorted by this date, which I w >>> Sorting by filename would only be useful with >>> [[!cpan Sort::Naturally]], since normal `cmp` ordering would break pages >>> with more than 9 comments. --s + +---- + +[[!template id=gitbranch author="[[smcv]]" branch=smcv/comments-metadata]] + +I thought that, as internal pages, comments were not preprocessed +(and so their date attributes did not have a chance to take effect) until +they were already being inlined, by which time they have already been +sorted by the files' ctimes. Actually, I was wrong about that - internal +pages have a special case elsewhere - but they did skip the `scan` hook, +which is also fixed in my branch. + +The real bug was that the preprocess hook for comments didn't run +in the scan phase; my branch fixes that, streamlines that hook a bit +when run in the scan phase (so it doesn't htmlize, and only runs nested +directives in scan mode), and adds a regression test. --[[smcv]] + +[[!tag patch]] diff --git a/doc/bugs/External_links_with_Creole.mdwn b/doc/bugs/External_links_with_Creole.mdwn index 3d800b04e..0d743e685 100644 --- a/doc/bugs/External_links_with_Creole.mdwn +++ b/doc/bugs/External_links_with_Creole.mdwn @@ -1,3 +1,5 @@ When using Creole for markup, creating an external link appears to be impossible. Neither \[[Outside URL|http://example.com]] nor <> nor \[Outside URL]\(http://example.com) work. The first gets rendered as a broken WikiLink, the second get eaten and the last is not parsed in anyway so you end up with that exact text in your page. I'd have made this as a Creole page as a practical demonstration, but that doesn't seem possible here. Here's a page with an example: + +Looking at my example it seems that this is now [[done]] at least in 3.20100815.7 (Debian) diff --git a/doc/bugs/SVG_files_not_recognized_as_images.mdwn b/doc/bugs/SVG_files_not_recognized_as_images.mdwn index 207edd426..b14cd9b94 100644 --- a/doc/bugs/SVG_files_not_recognized_as_images.mdwn +++ b/doc/bugs/SVG_files_not_recognized_as_images.mdwn @@ -17,6 +17,16 @@ The 'img' plugin also seems to not support SVGs. > image (png). The img plugin could probably do that fairly simply. > --[[Joey]] +>> This seems to have improved since; at least chromium can display svg +>> images from `` tags. Firefox 3.5.19 did not in my testing. +>> +>> So, svgs can now be included on pages by linking to them, or by using +>> the img directive. The most portable thing is to use the img directive +>> plus some size, which forces them to be resized and a png to actually +>> be displayed. +>> +>> I have not yet tried to do anything with sanitizing them. --[[Joey]] + >> I'm working on inline SVG and MathML support in ikiwiki and I've >> modified my htmlscrubber to sanitize SVG and MathML using the >> whitelists from html5lib. Here's a [patch][]. I've also made some diff --git a/doc/bugs/Titles_are_lower-cased_when_creating_a_page.mdwn b/doc/bugs/Titles_are_lower-cased_when_creating_a_page.mdwn index 059415819..351c2c1a1 100644 --- a/doc/bugs/Titles_are_lower-cased_when_creating_a_page.mdwn +++ b/doc/bugs/Titles_are_lower-cased_when_creating_a_page.mdwn @@ -32,3 +32,6 @@ If I click on "Czars in Russia", I'd like Ikiwiki to create "Czars\_in\_Russia.m > Then, which one is the default wouldn't much matter. (The non-lower cased > one would probably be the best choice.) --[[Joey]] >> Either of your proposed solutions (make it the default or include both in the pop-up menu) sounds fine to me. Which one is easier? :) --[[sabr]] + +>>> [[Done]]; it now defaults to the mixed case title and provides +>>> the lower-case one as an option in the select box. --[[Joey]] diff --git a/doc/bugs/Unable_to_add_attachments_to_some_pages.mdwn b/doc/bugs/Unable_to_add_attachments_to_some_pages.mdwn new file mode 100644 index 000000000..5b5aec267 --- /dev/null +++ b/doc/bugs/Unable_to_add_attachments_to_some_pages.mdwn @@ -0,0 +1,17 @@ +I can add attachment to some pages within an ikiwiki site. ( for example the index page ), but I'm unable to add attachments to other child pages. + +When I try I get the error message "Error: bad attachment filename". I can successfully attach the same file to the index page. + +I'm running + +ikiwiki version 3.20100815.7 on Debian Squeeze. + +Please advise. + + +> I get the following error in apache error.log +> Died at /usr/share/perl5/IkiWiki/CGI.pm line 466. +> -- [[aland]] + +> Well, what subpages are you trying to add it to? What is your +> `allowed_attachments` PageSpec set to in your setup file? --[[Joey]] diff --git a/doc/bugs/aggregate_generates_long_filenames.mdwn b/doc/bugs/aggregate_generates_long_filenames.mdwn index fae8333ab..33c300bd2 100644 --- a/doc/bugs/aggregate_generates_long_filenames.mdwn +++ b/doc/bugs/aggregate_generates_long_filenames.mdwn @@ -35,3 +35,6 @@ It would also appear this abrubtly terminates aggregate processing (if not ikiwi >>> Path length seems unlikely, since the max is 4096 there. >>> --[[Joey]] + +>>>> Aggregate now used a "if it crashes, it must be too long" strategy. +>>>> [[done]] --[[Joey]] diff --git a/doc/bugs/broken_page_after_buggy_remove.mdwn b/doc/bugs/broken_page_after_buggy_remove.mdwn new file mode 100644 index 000000000..c85d22cc5 --- /dev/null +++ b/doc/bugs/broken_page_after_buggy_remove.mdwn @@ -0,0 +1,4 @@ +Hi, I created \[[sandbox/subpage]] then I deleted it with the "remove" button. +After confirmation there was a message about a xapian error (My bad, I did not write down the exact error message). +Now, accessing [[sandbox/subpage|sandbox/subpage]] leads my browser complains about a redirect loop. [[JeanPrivat]] +>Uh. Now the bug of redirect loop seems to have solved itself. However, I don't know if the xapian error need to be investigated. But I found another [[bug|cannot revert page deletion]]. [[JeanPrivat]] diff --git a/doc/bugs/cannot_revert_page_deletion.mdwn b/doc/bugs/cannot_revert_page_deletion.mdwn new file mode 100644 index 000000000..5292906a1 --- /dev/null +++ b/doc/bugs/cannot_revert_page_deletion.mdwn @@ -0,0 +1,2 @@ +After deleting a page with the "remove" button, it seems that the page deletion cannot be reverted using the "revert" icon in [[RecentChanges]]. +It ironically says that "Error: ?$pagename does not exist". See [[http://ikiwiki.info/ikiwiki.cgi?rev=860c2c84d98ea0a38a4f91dacef6d4e09f6e6c2e&do=revert]]. [[JeanPrivat]] diff --git a/doc/bugs/emails_should_not_be_considered_as_broken_links.mdwn b/doc/bugs/emails_should_not_be_considered_as_broken_links.mdwn new file mode 100644 index 000000000..90d9fceff --- /dev/null +++ b/doc/bugs/emails_should_not_be_considered_as_broken_links.mdwn @@ -0,0 +1,5 @@ +The [[ikiwiki/directive/brokenlinks]] directive lists emails when used inside [[ikiwiki/wikilink]]s: \[[john.doo@example.com\]] -> [[john.doo@example.com]]. Obviously its is a bug since 1) there is a link generated in the page; 2) "fixing" the broken link in the brokenlinks page may yield to stange results [[http://ikiwiki.info/ikiwiki.cgi?page=john.doo__64__example.com&do=create]]. [[JeanPrivat]] + +[[!brokenlinks pages="*@* and !recentchanges"]] + +> Weird. The bug, imho, is that `\[[email-address]]` results in a marked-up email address. I think marking up email addresses into hyperlinks should be handled by a markup plugin (e.g. markdown), not by the wikilink parser. I feel the same way for external links, but it appears [this is all by design](http://source.ikiwiki.branchable.com/?p=source.git;a=commitdiff;h=07a08122d926ab6b7741c94bc6c0038ffe0113fb). — [[Jon]] diff --git a/doc/bugs/http_proxy_for_openid.mdwn b/doc/bugs/http_proxy_for_openid.mdwn index dc8423e46..b7ae76aeb 100644 --- a/doc/bugs/http_proxy_for_openid.mdwn +++ b/doc/bugs/http_proxy_for_openid.mdwn @@ -61,3 +61,20 @@ Brian May >> Use $ua->env_proxy() to get it to read the environment variables. Then http:// does work. >> >> Unfortunately this breaks https:// even more - but nothing I do seems to make https:// work anymore. + + +>>> LWP::UserAgent defaults to not caring about proxy settings in +>>> the environment. (To give control over the result, I guess?) +>>> To get it to care, pass `env_proxy => 1` to the constructor. Affected +>>> plugins: aggregate, openid, pinger. This probably wants to be on +>>> by default, and might not need to be configurable. --[[schmonz]] + +>>>> Okay, in a real-world scenario it does need to be +>>>> configurable. A working implementation (tested with aggregate, +>>>> not tested with the other two plugins) is in my git, commit +>>>> 91c46819dee237a281909b0c7e65718eb43f4119. --[[schmonz]] + +>>>>> Oh, and according to the LWPx::ParanoidAgent docs, "proxy support is +>>>>> explicitly removed", so if ikiwiki can preferentially find that +>>>>> installed, even with the above commit, `openid` won't be able to +>>>>> traverse a proxy. --[[schmonz]] diff --git a/doc/bugs/mailto:_links_not_properly_generated_in_rssatom_feeds.mdwn b/doc/bugs/mailto:_links_not_properly_generated_in_rssatom_feeds.mdwn index e8392a80d..9e4539334 100644 --- a/doc/bugs/mailto:_links_not_properly_generated_in_rssatom_feeds.mdwn +++ b/doc/bugs/mailto:_links_not_properly_generated_in_rssatom_feeds.mdwn @@ -3,3 +3,18 @@ A link like \[this](mailto:foo@bar.org) will not be converted correctly to a mailto link in the rss/atom feeds, but an absolute link instead. See e.g. the logitech post on http://madduck.net/blog/feeds/planet-lca2008/index.rss > fixed --[[Joey]] [[!tag done]] + +This still happens for auto-generated mailto: links that are [garbled](http://daringfireball.net/projects/markdown/syntax#autolink) by Markdown, so that + + +is turned into + + matthias@rampke.de + +for HTML, but + + <a href="http://rampke.de/m&#97;&#105;&#x6C;t&#111;:&#109;&#x61;&#116;&#x74;&#x68;&#105;a&#x73;&#64;&#x72;&#x61;&#109;&#x70;&#x6B;&#101;&#46;&#100;&#x65;">&#109;&#x61;&#116;&#x74;&#x68;&#105;a&#x73;&#64;&#x72;&#x61;&#109;&#x70;&#x6B;&#101;&#46;&#100;&#x65;</a></p> + +for Atom and RSS. + + diff --git a/doc/bugs/wrong_link_in_recentchanges_when_reverting_an_ikiwiki_outside_git_root.mdwn b/doc/bugs/wrong_link_in_recentchanges_when_reverting_an_ikiwiki_outside_git_root.mdwn new file mode 100644 index 000000000..bf311c198 --- /dev/null +++ b/doc/bugs/wrong_link_in_recentchanges_when_reverting_an_ikiwiki_outside_git_root.mdwn @@ -0,0 +1,3 @@ +in ikiwiki instances that don't reside in the git root directory (the only ones i know of are ikiwiki itself), reverts show the wrong link in the recentchanges (for example, in the ikiwiki main repository's 4530430 and its revert, the main index page was edited, but the revert shows doc/index as a link). + +the expected behavior is to compensate for the modified root directory (i.e., show index instead of doc/index). diff --git a/doc/forum/Can_one_tell_if_a_page_is_added_rather_than_changed__63__.mdwn b/doc/forum/Can_one_tell_if_a_page_is_added_rather_than_changed__63__.mdwn new file mode 100644 index 000000000..4c06cbabb --- /dev/null +++ b/doc/forum/Can_one_tell_if_a_page_is_added_rather_than_changed__63__.mdwn @@ -0,0 +1,5 @@ +In the plugin interface, there are hooks for "deleted" and "changed" and the "changed" interfaces includes files which are *either* changed or added. Is there any way of telling that a file has been added rather than changed? With some plugins (for example, [[plugins/sidebar]]) if a new page (of a certain sort) is added, the only way one can fix up the dependencies is to rebuild the whole site from scratch. This is Not Good. Now, one could do something in the "changed" hook, but since one can't tell if a file has been changed or added, if one did something for every changed file, one would be doing a lot of needless work (so one might as well rebuild the site when one *knows* that a new (relevant) page has been added). + +But I really would like to be able to do things just to the *new* files, so is there any way that one can distinguish the changed files from the added files? + +-- [[KathrynAndersen]] diff --git a/doc/forum/Can_one_tell_if_a_page_is_added_rather_than_changed__63__/comment_1_1397feebfb0fb7cc57af2f8b74ce047e._comment b/doc/forum/Can_one_tell_if_a_page_is_added_rather_than_changed__63__/comment_1_1397feebfb0fb7cc57af2f8b74ce047e._comment new file mode 100644 index 000000000..7ddbb40fd --- /dev/null +++ b/doc/forum/Can_one_tell_if_a_page_is_added_rather_than_changed__63__/comment_1_1397feebfb0fb7cc57af2f8b74ce047e._comment @@ -0,0 +1,8 @@ +[[!comment format=mdwn + username="http://joey.kitenet.net/" + nickname="joey" + subject="comment 1" + date="2011-06-20T00:22:54Z" + content=""" +I think that presence dependencies mostly cover this case. But no, there is not currently a hook that gets information about which files changed vs were added. The information is available at the time the hooks are called so some new ones could be added. +"""]] diff --git a/doc/forum/Can_one_tell_if_a_page_is_added_rather_than_changed__63__/comment_2_ad36c945f59fe525428fc30246911ff5._comment b/doc/forum/Can_one_tell_if_a_page_is_added_rather_than_changed__63__/comment_2_ad36c945f59fe525428fc30246911ff5._comment new file mode 100644 index 000000000..4cffde3fc --- /dev/null +++ b/doc/forum/Can_one_tell_if_a_page_is_added_rather_than_changed__63__/comment_2_ad36c945f59fe525428fc30246911ff5._comment @@ -0,0 +1,10 @@ +[[!comment format=mdwn + username="http://kerravonsen.dreamwidth.org/" + ip="202.173.183.92" + subject="comment 2" + date="2011-06-20T03:24:49Z" + content=""" +If new hooks could be added, that would be greatly appreciated. Perhaps two new hooks: `added` and `updated` (the \"updated\" hook would be for files which were already-existing files which were changed). + +--[[KathrynAndersen]] +"""]] diff --git a/doc/forum/Flowplayer/comment_1_75d13cd915a736422db47e00dbe46671._comment b/doc/forum/Flowplayer/comment_1_75d13cd915a736422db47e00dbe46671._comment new file mode 100644 index 000000000..159e9dce1 --- /dev/null +++ b/doc/forum/Flowplayer/comment_1_75d13cd915a736422db47e00dbe46671._comment @@ -0,0 +1,9 @@ +[[!comment format=mdwn + username="Sphynkx" + ip="85.238.106.185" + subject="Videoplugin" + date="2011-06-27T02:27:19Z" + content=""" +Hello!! +Test my [videoplugin](http://ikiwiki.info/plugins/contrib/video/)!! +"""]] diff --git a/doc/forum/How_long_does_server_delay_newly_pushed_revisions__63__.mdwn b/doc/forum/How_long_does_server_delay_newly_pushed_revisions__63__.mdwn new file mode 100644 index 000000000..dea95c285 --- /dev/null +++ b/doc/forum/How_long_does_server_delay_newly_pushed_revisions__63__.mdwn @@ -0,0 +1,10 @@ +So I + +1. checked out the repository of the my Ikiwiki instance and added new page and editted existing pages in the working copy +2. Then add and commit the revisions: `git add .` and `git commit -m "update"` +3. Then push it to server: `git push` + +I then go to browser and go to the Ikiwiki URL of recent changes. I didn't find the new revision, neither I can open the new pages. +Is there a way to verify my revision did go in? How long does the server delays processing it? + + diff --git a/doc/forum/How_to_apply_a_background_color_to_a_page__63__.mdwn b/doc/forum/How_to_apply_a_background_color_to_a_page__63__.mdwn new file mode 100644 index 000000000..5beba1258 --- /dev/null +++ b/doc/forum/How_to_apply_a_background_color_to_a_page__63__.mdwn @@ -0,0 +1 @@ +I want one page to use gray background color (full page, not just background of text). How? diff --git a/doc/forum/How_to_make_a_table_of_content_at_the_top_of_page__63__.mdwn b/doc/forum/How_to_make_a_table_of_content_at_the_top_of_page__63__.mdwn new file mode 100644 index 000000000..b185e3b61 --- /dev/null +++ b/doc/forum/How_to_make_a_table_of_content_at_the_top_of_page__63__.mdwn @@ -0,0 +1,3 @@ +How to make a table of content at the top of page? + +Ideally, it should be a programmable approach, for example, allow such table of content to be made automatically when the page length is longer than certain configurable threshold. diff --git a/doc/forum/How_to_make_a_table_of_content_at_the_top_of_page__63__/comment_1_6dedc31dd1145490bb5fa4ad14cc4c63._comment b/doc/forum/How_to_make_a_table_of_content_at_the_top_of_page__63__/comment_1_6dedc31dd1145490bb5fa4ad14cc4c63._comment new file mode 100644 index 000000000..49d25ed02 --- /dev/null +++ b/doc/forum/How_to_make_a_table_of_content_at_the_top_of_page__63__/comment_1_6dedc31dd1145490bb5fa4ad14cc4c63._comment @@ -0,0 +1,8 @@ +[[!comment format=mdwn + username="https://www.google.com/accounts/o8/id?id=AItOawnxp2XU8gIribhhGhGuYtU6eMMwHv5gUGI" + nickname="Amitai" + subject="comment 1" + date="2011-06-05T17:11:40Z" + content=""" +To insert one where you want it, [[ikiwiki/directive/toc]]. +"""]] diff --git a/doc/forum/Need_help_installing_h1title_plugin.mdwn b/doc/forum/Need_help_installing_h1title_plugin.mdwn new file mode 100644 index 000000000..f6de2fe6f --- /dev/null +++ b/doc/forum/Need_help_installing_h1title_plugin.mdwn @@ -0,0 +1,5 @@ +I am trying to install plugins that's not included in Ikiwiki following instructions at `http://ikiwiki.info/plugins/install/`. So far I tried `http://jblevins.org/git/ikiwiki/plugins.git/plain/h1title.pm` and `http://ikiwiki.info/plugins/contrib/default_content_for___42__copyright__42___and___42__license__42__/`. After putting these `.pm` files in `/home/foo/website/libi/IkiWiki/Plugin` and making them executable, I rebuilt the wiki instance. But the plugins aren't working. + +Any ideas what might be wrong? + +Is there some way to debug? diff --git a/doc/forum/java_script_slideshow.mdwn b/doc/forum/java_script_slideshow.mdwn new file mode 100644 index 000000000..7289e3dec --- /dev/null +++ b/doc/forum/java_script_slideshow.mdwn @@ -0,0 +1,11 @@ +Hi there, + +I tried yesterday to make a slide-show for my frontpage. I enabled the [[!iki plugins/meta desc=meta]] and the [[!iki plugins/html desc=html]] plugins, then, on my frontpage, I pointed to the .js files that do the trick and I added the html code to actually run the slide-show. I also set [[!iki plugins/htmlscrubber desc=htmlscrubber]] to skip everything except the Discussion pages. I used this code [[http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm]]. + +In theory this should have worked but unfortunately it didn't worked at all. I know I can use [[!iki plugins/rawhtml desc=rawhtml]] plugin but with this I get a page that is treated as data, I need the page to be treated as source so I can use directives. I'm now wondering if this is even possible in ikiwiki... + +Anyway, I thought to check with you guys. The main idea is to have a simple slide-show with 4 or 5 slides that change every 3 seconds and each slide should link to a different page. Any ideas are extremely welcomed! + +Thanks + +Marius diff --git a/doc/forum/java_script_slideshow/comment_1_3eba0b2f3c12acc991dc3069d2b83d49._comment b/doc/forum/java_script_slideshow/comment_1_3eba0b2f3c12acc991dc3069d2b83d49._comment new file mode 100644 index 000000000..745da0281 --- /dev/null +++ b/doc/forum/java_script_slideshow/comment_1_3eba0b2f3c12acc991dc3069d2b83d49._comment @@ -0,0 +1,8 @@ +[[!comment format=mdwn + username="http://smcv.pseudorandom.co.uk/" + nickname="smcv" + subject="comment 1" + date="2011-06-23T07:52:04Z" + content=""" +See [[tips/embedding_content]], which applies equally to any scripting or other \"unsafe\" markup. +"""]] diff --git a/doc/forum/java_script_slideshow/comment_2_59d90f42b2ca2a5cc71a4d9ba9b9ee9f._comment b/doc/forum/java_script_slideshow/comment_2_59d90f42b2ca2a5cc71a4d9ba9b9ee9f._comment new file mode 100644 index 000000000..6df07cb6a --- /dev/null +++ b/doc/forum/java_script_slideshow/comment_2_59d90f42b2ca2a5cc71a4d9ba9b9ee9f._comment @@ -0,0 +1,10 @@ +[[!comment format=mdwn + username="http://smcv.pseudorandom.co.uk/" + nickname="smcv" + subject="comment 2" + date="2011-06-23T07:54:06Z" + content=""" +Oh, sorry, you already said you disabled the htmlscrubber. In that case, +please define \"doesn't work\" - it might be helpful to compare the IkiWiki +output with similar code that you've added to a static copy of the HTML? +"""]] diff --git a/doc/forum/java_script_slideshow/comment_3_820a86db38231cff7239f0a88b1925fd._comment b/doc/forum/java_script_slideshow/comment_3_820a86db38231cff7239f0a88b1925fd._comment new file mode 100644 index 000000000..e14d6d892 --- /dev/null +++ b/doc/forum/java_script_slideshow/comment_3_820a86db38231cff7239f0a88b1925fd._comment @@ -0,0 +1,21 @@ +[[!comment format=mdwn + username="https://www.google.com/accounts/o8/id?id=AItOawk3MUhMRflE8-Vg4fevsT1sadSetiAxVKg" + nickname="Marius" + subject="IT WORKS!!! Ikiwiki rules!" + date="2011-06-23T09:42:00Z" + content=""" +Well, surprise, I tried a different approach and this time it worked perfectly. So, how I did it?... + +I created externally a html file with the slid-show I wanted and then put it (along with the javascript files and the images) in the source directory. I rebuilt the wiki and then inlined that html page in the wiki page where I wanted the slide-show. + +So, from now on my wiki will look like any wordpress or drupal eye-candy website but without all that bloat. + +Short outline: + +- put the slid-show files in the source directory +- rebuild the wiki +- on the wiki page you want some eye-candy inline the html page that contains the slid-show +- that's it ;) + +Marius +"""]] diff --git a/doc/forum/java_script_slideshow/comment_4_a68972e3dd20b65119211d4ab120b294._comment b/doc/forum/java_script_slideshow/comment_4_a68972e3dd20b65119211d4ab120b294._comment new file mode 100644 index 000000000..1cbd2040a --- /dev/null +++ b/doc/forum/java_script_slideshow/comment_4_a68972e3dd20b65119211d4ab120b294._comment @@ -0,0 +1,10 @@ +[[!comment format=mdwn + username="https://www.google.com/accounts/o8/id?id=AItOawk3MUhMRflE8-Vg4fevsT1sadSetiAxVKg" + nickname="Marius" + subject="comment 4" + date="2011-06-23T09:49:29Z" + content=""" +Oh, I forgot to mention. It seems that you have to have both [[!iki plugins/html desc=html]] and [[!iki plugins/rawhtml desc=rawhtml]] plugins enabled for this to work. + +Marius +"""]] diff --git a/doc/forum/nginx:_404_plugin_not_working.mdwn b/doc/forum/nginx:_404_plugin_not_working.mdwn index b39dde110..dd23e3128 100644 --- a/doc/forum/nginx:_404_plugin_not_working.mdwn +++ b/doc/forum/nginx:_404_plugin_not_working.mdwn @@ -8,4 +8,5 @@ If i use the [[shell script for lighttpd|bugs/404_plugin_and_lighttpd]], ikiwiki Might this be a mistake by me or does anyone know a workaround to get the 404 plugin working with nginx? --[[bacuh]] - + + diff --git a/doc/forum/nginx:_404_plugin_not_working/comment_5_0720cd8842dc1cb338b74a0e6fdb2aac._comment b/doc/forum/nginx:_404_plugin_not_working/comment_5_0720cd8842dc1cb338b74a0e6fdb2aac._comment new file mode 100644 index 000000000..60824bd8a --- /dev/null +++ b/doc/forum/nginx:_404_plugin_not_working/comment_5_0720cd8842dc1cb338b74a0e6fdb2aac._comment @@ -0,0 +1,8 @@ +[[!comment format=mdwn + username="https://www.google.com/accounts/o8/id?id=AItOawl981Fi5YVeEC_ncO9cJTfkPyyy2A_-tG8" + nickname="Mick" + subject="comment 5" + date="2011-06-25T12:00:24Z" + content=""" +Is [[this|missing_pages_redirected_to_search-SOLVED]] what you are after ? --[Mick](http://www.lunix.com.au) +"""]] diff --git a/doc/forum/pandoc-iki_plugin/comment_2_2c437577390cffe3401f5cc2f08a2ab1._comment b/doc/forum/pandoc-iki_plugin/comment_2_2c437577390cffe3401f5cc2f08a2ab1._comment new file mode 100644 index 000000000..472bd38b5 --- /dev/null +++ b/doc/forum/pandoc-iki_plugin/comment_2_2c437577390cffe3401f5cc2f08a2ab1._comment @@ -0,0 +1,8 @@ +[[!comment format=mdwn + username="http://profjim.myopenid.com/" + nickname="profjim" + subject="comment 2" + date="2011-06-12T20:20:13Z" + content=""" +Done, thanks. --Profjim +"""]] diff --git a/doc/ikiwiki-mass-rebuild.mdwn b/doc/ikiwiki-mass-rebuild.mdwn index 5f144b49b..a2db0a858 100644 --- a/doc/ikiwiki-mass-rebuild.mdwn +++ b/doc/ikiwiki-mass-rebuild.mdwn @@ -9,7 +9,10 @@ ikiwiki-mass-rebuild # DESCRIPTION `ikiwiki-mass-rebuild` can be used to force a rebuild of all the wikis -on a system. You will need to list the setup files for the wikis it should +on a system (when run as root), or all of a user's wikis (when run as +non-root). + +You will need to list the setup files for the wikis it should build in the file `/etc/ikiwiki/wikilist`, which has the format: user /path/to/ikiwiki.setup diff --git a/doc/ikiwikiusers.mdwn b/doc/ikiwikiusers.mdwn index 715482ae5..d4e8add56 100644 --- a/doc/ikiwikiusers.mdwn +++ b/doc/ikiwikiusers.mdwn @@ -188,3 +188,5 @@ Personal sites and blogs * [Jonas Smedegaard](http://dr.jones.dk/) multilingual "classic" website w/ blog * [Siri Reiter](http://sirireiter.dk/) portfolio website with a blog (in danish) * [L'Altro Wiki](http://laltromondo.dynalias.net/~iki/) Tutorials, reviews, miscellaneus articles in English and Italian, from the IRC network syrolnet.org +* [STUPiD](http://lhzhang.com/) +* gregoa's [p.r. - political rants](http://info.comodo.priv.at/pr/) diff --git a/doc/install/discussion.mdwn b/doc/install/discussion.mdwn index c06893ec1..b4ec5ebf4 100644 --- a/doc/install/discussion.mdwn +++ b/doc/install/discussion.mdwn @@ -331,3 +331,21 @@ I've not investigated more the /etc files ussage, but does not seems like a good Iñigo + +----- + + +Portability fixes encountered while maintaining the pkgsrc package: + +* In `IkiWiki::Setup::Standard::gendump()`, generate a shebang + matching the current `perl`. +* In `Makefile.PL`, provide overridable defaults for `SYSCONFDIR` + and `MANDIR`. +* In `Makefile.PL`, use `perl` to bump `ikiwiki.spec` instead of + `sed -i`. +* In `Makefile.PL`, specify more portable options to `cp`. + +I've attempted to mergeably patch these in my git, commit +5c177c96ac98b24aaa0613ca241fb113f1b32c55. + +--[[schmonz]] diff --git a/doc/news/version_3.20110225.mdwn b/doc/news/version_3.20110225.mdwn deleted file mode 100644 index 8e38bd7b8..000000000 --- a/doc/news/version_3.20110225.mdwn +++ /dev/null @@ -1,23 +0,0 @@ -ikiwiki 3.20110225 released with [[!toggle text="these changes"]] -[[!toggleable text=""" - * editpage: Avoid inheriting internal page types. - * htmltidy: Avoid breaking the sidebar when websetup is running. - * transient: New utility plugin that allows transient pages to - be stored in .ikiwiki/transient/ (smcv) - * aggregate: Aggregated content is stored in the transient underlay. - (Existing aggregated content is not moved, since it will eventually - expire and be removed) (smcv) - * autoindex, tag: Added autoindex\_commit and tag\_autocreate\_commit that - can be unset to make index files and tags respectively not be committed, - and instead be stored in the transient underlay. - Closes: #[544322](http://bugs.debian.org/544322) (smcv) - * autoindex: Adapted to use add\_autofile. Slight behavior changes - in edge cases that are probably really bug fixes. (smcv) - * recentchanges: Use transient underlay (smcv) - * map: Avoid unnecessary ul's in maps with nested directories. - (Giuseppe Bilotta) - * Fix broken baseurl in cgi mode when usedirs is disabled. Bug introduced - in 3.20101231. - * inline: Fix link to nested inlined pages's feeds. (Giuseppe Bilotta) - * inline: Add 'id' parameter that can be used when styling individual - feedlinks and postforms. (Giuseppe Bilotta)"""]] \ No newline at end of file diff --git a/doc/news/version_3.20110608.mdwn b/doc/news/version_3.20110608.mdwn new file mode 100644 index 000000000..64fec0208 --- /dev/null +++ b/doc/news/version_3.20110608.mdwn @@ -0,0 +1,7 @@ +ikiwiki 3.20110608 released with [[!toggle text="these changes"]] +[[!toggleable text=""" + * ikiwiki-mass-rebuild: Fix tty hijacking vulnerability by using su. + (Once su's related bug #628843 is fixed.) Thanks, Ludwig Nussel. + (CVE-2011-1408) + * search: Update search page when page.tmpl or searchquery.tmpl are locally + modified."""]] \ No newline at end of file diff --git a/doc/plugins/404.mdwn b/doc/plugins/404.mdwn index bf033202a..128b26e7b 100644 --- a/doc/plugins/404.mdwn +++ b/doc/plugins/404.mdwn @@ -5,12 +5,20 @@ This plugin lets you use the IkiWiki CGI script as an Apache 404 handler, to give the behaviour of various other wiki engines where visiting a nonexistent page provides you with a link to create it. -To achieve this, put something like this in the wiki's Apache configuration -file: +To enable the 404 handler you need to: - ErrorDocument 404 /ikiwiki.cgi +1. Edit your `.setup` file and add `404` to the `add_plugins` line. +2. Add a 404 error document handler in your Apache configuration: -(The path here needs to be whatever the path is to the ikiwiki.cgi from -the root of your web server.) + `ErrorDocument 404 /url/path/to/ikiwiki.cgi` + Where `/url/path/to` is the path portion of the URL to the `ikiwiki.cgi` binary. +This plugin might also be useful on non-Apache web servers, if they provide the +`REDIRECT_STATUS` and `REDIRECT_URL` environment variables to their 404 handlers. +`REDIRECT_STATUS` should be `404` and `REDIRECT_URL` should be the path +part of the URL (for instance it would be `/plugins/404/` if this page was missing). + +If you would like help with adapting this plugin for a different web server, +you will need to provide the output of +[[this 404 handler|forum/nginx:_404_plugin_not_working#comment-6b1607f7961d2873517d4780f56ac3ad]]. diff --git a/doc/plugins/contrib/album.mdwn b/doc/plugins/contrib/album.mdwn index daf16fd3c..8dfbbf716 100644 --- a/doc/plugins/contrib/album.mdwn +++ b/doc/plugins/contrib/album.mdwn @@ -1,10 +1,10 @@ [[!template id=plugin name=album author="[[Simon_McVittie|smcv]]"]] -[[!template id=gitbranch branch=smcv/album author="[[Simon_McVittie|smcv]]"]] +[[!template id=gitbranch branch=smcv/album2 author="[[Simon_McVittie|smcv]]"]] [[!tag type/chrome]] -Available from [[smcv]]'s git repository, in the `album` branch -([[users/smcv/gallery|users/smcv/gallery]] contains some older -thoughts about this plugin). +Available from [[smcv]]'s git repository, in the `album2` branch. +Older (pre-rebase) versions in `album`, `album-live` (the latter +was used on an actual website and didn't explode too much). This plugin formats a collection of images into a photo album, in the same way as many websites: good examples include the @@ -16,9 +16,9 @@ I've called it `album` to distinguish it from a better name for this functionality. The web UI I'm trying to achieve consists of one -[HTML page of thumbnails](http://www.pseudorandom.co.uk/2008/2008-03-08-panic-cell-gig/) +[HTML page of thumbnails](http://ikialbum.hosted.pseudorandom.co.uk/album/) as an entry point to the album, where each thumbnail links to -[a "viewer" HTML page](http://www.pseudorandom.co.uk/2008/2008-03-08-panic-cell-gig/img_0068/) +[a "viewer" HTML page](http://ikialbum.hosted.pseudorandom.co.uk/album/img_0120/) with a full size image, next/previous thumbnail links, and [[plugins/comments]]. @@ -110,7 +110,7 @@ image viewer. * The plugin doesn't do anything special to handle albums that are subpages of each other. If, say, `debconf` and `debconf/monday` are both albums, then `debconf/monday/p100.jpg` will currently be assigned to one or the - other, arbitrarily. + other, arbitrarily. It should probably pick the closest (longest) album name. * The plugin doesn't do anything special to handle photos with similar names. If you have `p100.jpg` and `p100.png`, one will get a viewer page called @@ -119,10 +119,18 @@ image viewer. * If there's no `albumimage` in a viewer page, one should probably be appended automatically. +* When editing a viewer page, rebuilding it seems to fail at the moment. + Probably related to: + +* Integration with [[plugins/contrib/trail]] is new, untested and not + very well implemented. In particular, the prev/up/next links are + redundant with the ones from `trail`. + ## TODO * The documentation should mention how to replicate the appearance of - `album` and `albumsection` using an `inline` of viewer pages. + `album` and `albumsection` using an `inline` of viewer pages, + elsewhere on the site. * The documentation should mention all the template variables and all the parameters. diff --git a/doc/plugins/contrib/default_content_for___42__copyright__42___and___42__license__42__.mdwn b/doc/plugins/contrib/default_content_for___42__copyright__42___and___42__license__42__.mdwn index 16c147b68..b76bf55dc 100644 --- a/doc/plugins/contrib/default_content_for___42__copyright__42___and___42__license__42__.mdwn +++ b/doc/plugins/contrib/default_content_for___42__copyright__42___and___42__license__42__.mdwn @@ -46,6 +46,11 @@ by ikiwiki are likewise fine. --[[tschwinge]] > that it doesn't support setting defaults for a given "subdirectory" > only. --[[smcv]] +> I downloaded the two *.pm files and made them executable, and put in +> `$ ls /usr/local/lib/site_perl/IkiWiki/Plugin/` and added `copyright.mdwn` and `license.mdwn` +> and rebuilt the wiki, but the copyright/license text doesn't show up. Does these plugin work with Ikiwiki `3.20100815`? +> -- 9unmetal + [[!template id=gitbranch branch=smcv/contrib/defcopyright author="[[tschwinge]]"]] > For `./gitremotes` convenience (taking the Linus approach to backups :-) ) diff --git a/doc/plugins/contrib/headinganchors.mdwn b/doc/plugins/contrib/headinganchors.mdwn deleted file mode 100644 index becbf89a5..000000000 --- a/doc/plugins/contrib/headinganchors.mdwn +++ /dev/null @@ -1,36 +0,0 @@ -[[!template id=plugin name=headinganchors author="[[PaulWise]]"]] - -This is a simple plugin to add ids (which will serve as [[anchor]]s) to all headings, based on their text. It -works as a postprocessing filter, allowing it to work on mdwn, wiki, html, -rst and any other format that produces html. The code is available here: - - #!/usr/bin/perl - # quick HTML heading id adder by Paul Wise - package IkiWiki::Plugin::headinganchors; - - use warnings; - use strict; - use IkiWiki 2.00; - - sub import { - hook(type => "sanitize", id => "headinganchors", call => \&headinganchors); - } - - sub text_to_anchor { - my $str = shift; - $str =~ s/^\s+//; - $str =~ s/\s+$//; - $str = lc($str); - $str =~ s/[&\?"\'\.,\(\)!]//mig; - $str =~ s/[^a-z]/_/mig; - return $str; - } - - sub headinganchors (@) { - my %params=@_; - my $content=$params{content}; - $content=~s{([^>]*)}{''.$2.''}gie; - return $content; - } - - 1 diff --git a/doc/plugins/contrib/headinganchors/discussion.mdwn b/doc/plugins/contrib/headinganchors/discussion.mdwn deleted file mode 100644 index 151af8d92..000000000 --- a/doc/plugins/contrib/headinganchors/discussion.mdwn +++ /dev/null @@ -1,33 +0,0 @@ -Isn't this functionality a part of what [[plugins/toc]] needs and does? Then probably the [[plugins/toc]] plugin's code could be split into the part that implements the [[plugins/contrib/headinganchors]]'s functionality and the TOC generation itself. That will bring more order into the code and the set of available plugins. --Ivan Z. - ---- - -A patch to make it more like MediaWiki: - -
--- headinganchors.pm
-+++ headinganchors.pm
-@@ -5,6 +5,7 @@
- use warnings;
- use strict;
- use IkiWiki 2.00;
-+use URI::Escape;
- 
- sub import {
-         hook(type => "sanitize", id => "headinganchors", call => \&headinganchors);
-@@ -14,9 +15,11 @@
-         my $str = shift;
-         $str =~ s/^\s+//;
-         $str =~ s/\s+$//;
--        $str = lc($str);
--        $str =~ s/[&\?"\'\.,\(\)!]//mig;
--        $str =~ s/[^a-z]/_/mig;
-+        $str =~ s/\s/_/g;
-+        $str =~ s/"//g;
-+        $str =~ s/^[^a-zA-Z]/z-/; # must start with an alphabetical character
-+        $str = uri_escape_utf8($str);
-+        $str =~ s/%/./g;
-         return $str;
- }
- 
- ---Changaco diff --git a/doc/plugins/contrib/mandoc.mdwn b/doc/plugins/contrib/mandoc.mdwn new file mode 100644 index 000000000..1db3e4da6 --- /dev/null +++ b/doc/plugins/contrib/mandoc.mdwn @@ -0,0 +1,9 @@ +[[!template id=plugin name=mandoc author="[[schmonz]]"]] +[[!template id=gitbranch branch=schmonz/master author="[[schmonz]]"]] +[[!tag type/format]] + +This plugin lets ikiwiki convert Unix man pages to HTML. It uses +[mdocml](http://mdocml.bsd.lv/) for the conversion, and postprocesses +xrefs into hyperlinks. + +Sample output: diff --git a/doc/plugins/contrib/pandoc.mdwn b/doc/plugins/contrib/pandoc.mdwn new file mode 100644 index 000000000..c8e2e9a94 --- /dev/null +++ b/doc/plugins/contrib/pandoc.mdwn @@ -0,0 +1,6 @@ +[[!template id=plugin name=pandoc author="profjim"]] + +This plugin enables Markdown processing using [Pandoc](http://johnmacfarlane.net/pandoc/). You can configure it for Pandoc to take over processing of all .mkdn files, or only files with a different extension. Given the features Pandoc has added over the past 6-12 months, this makes for a very powerful combination, e.g. with code block syntax highlighting and lots of options for how to process and display inline TeX. + +This is an expanded and updated version of [[Jason Blevin|users/jasonblevins]]'s pandoc plugin. Get it and see further details at . + diff --git a/doc/plugins/contrib/report/ikiwiki/directive/report.mdwn b/doc/plugins/contrib/report/ikiwiki/directive/report.mdwn index df88b33ad..aa884c137 100644 --- a/doc/plugins/contrib/report/ikiwiki/directive/report.mdwn +++ b/doc/plugins/contrib/report/ikiwiki/directive/report.mdwn @@ -114,14 +114,15 @@ to the other pages. The following options are used to improve efficiency when dealing with large numbers of pages; most people probably won't need them. -**doscan**: - -Whether this report should be called in "scan" mode; if it is, then -the pages which match the pagespec are added to the list of links from -this page. This can be used by *another* report by setting this -page to be a "trail" page in *that* report. -It is not possible to use "trail" and "doscan" at the same time. -By default, "doscan" is false. +**maketrail**: + +Make a trail; if true, then this report is called in "scan" mode and the +pages which match the pagespec are added to the list of links from this +page. This can be used by *another* report by setting this page to be a +"trail" page in *that* report. + +It is not possible to use "trail" and "maketrail" at the same time. +By default, "maketrail" is false. ## TEMPLATE PARAMETERS diff --git a/doc/plugins/contrib/trail.mdwn b/doc/plugins/contrib/trail.mdwn index 337e5d427..def91d85a 100644 --- a/doc/plugins/contrib/trail.mdwn +++ b/doc/plugins/contrib/trail.mdwn @@ -4,19 +4,13 @@ Available from [[smcv]]'s git repository, in the `trail` branch. This plugin aims to solve [[todo/wikitrails]] in a simpler way. -Joey: what do you think of this plugin? If you like the general approach -and are likely to include it in ikiwiki, I'll try to modify -[[plugins/contrib/album]] to be based on it, rather than partially -reinventing it. +Updated, June 2011: -Bugs: +* removed `inline` integration for now -* \[[!inline pages="..." trail=yes]] currently tries to work out - what pages are in the trail, and their order, at scan time. That - won't work, because matching a pagespec at scan time is - unreliable - pages we want might not have been scanned yet! I - haven't worked out a solution for this. I think - \[[!inline pagenames="..." trail=yes]] would be safe, though. +* added `` tags + +* switched from a custom data structure to using typed links ---- @@ -29,38 +23,73 @@ links within that page. If using the default `page.tmpl`, each page automatically displays the trails that it's a member of (if any), with links to the trail and to -the next and previous members. +the next and previous members. HTML `` tags with the `prev`, +`next` and `up` relations are also generated. The `traillink` [[ikiwiki/directive]] is used to record which pages are in a trail, and simultaneously link to them. Alternatively, the -[[ikiwiki/directive/inline]] directive can be used with `trail=yes` -to record the inlined pages as part of the trail, in the order in -which they are inlined. +[[ikiwiki/directive/trailitem]] directive can be used to make an +invisible `traillink`. ## Directives (These will go to the appropriate pages in [[ikiwiki/directive]] if this plugin is included in ikiwiki.) +### trailitem + +The `trailitem` directive is supplied by the [[!iki plugins/contrib/trail desc=trail]] +plugin. It is used like this: + + \[[!trailitem some_other_page]] + +to add `some_other_page` to the trail represented by this page, without +generating a visible hyperlink. + ### traillink The `traillink` directive is supplied by the [[!iki plugins/contrib/trail desc=trail]] -plugin. This directive appears on the page representing a trail. It acts -as a visible [[ikiwiki/WikiLink]], but also records the linked page as -a member of the trail. +plugin. It generates a visible [[ikiwiki/WikiLink]], and also adds the linked page to +the trail represented by the page containing the directive. + +In its simplest form, the first parameter is like the content of a WikiLink: -Various syntaxes can be used: + \[[!traillink some_other_page]] - \[[!traillink Badgers]] - \[[!traillink How_to_find_mushrooms_using_badgers|badgers]] - \[[!traillink badgers text="How to find mushrooms using badgers"]] +The displayed text can also be overridden, either with a `|` symbol or with +a `text` parameter: + + \[[!traillink Click_here_to_start_the_trail|some_other_page]] + \[[!traillink some_other_page text="Click here to start the trail"]] ### trailoptions The `trailoptions` directive is supplied by the [[!iki plugins/contrib/trail desc=trail]] -plugin. This directive appears on the page representing a trail, and -produces no output. +plugin. It sets options for the trail represented by this page. Example usage: + + \[[!trailoptions sort="meta(title)" circular="no"]] + +The available options are: + +* `sort`: sets a [[ikiwiki/pagespec/sorting]] order; if not specified, the + items of the trail are ordered according to the first link to each item + found on the trail page + +* `circular`: if set to `yes` or `1`, the trail is made into a loop by + making the last page's "next" link point to the first page, and the first + page's "previous" link point to the last page + +---- + +## Future directions + +The current version of this plugin doesn't implement inline-based or +otherwise [[ikiwiki/PageSpec]]-based trails. This is difficult because +there's a circular dependency: + +* adding typed links should happen *before* scanning has finished, to + guarantee that they're available before the first page is rendered -Currently, the only option supported is `[[!trailoptions circular=yes]]`, -which adds links between the first and last pages, turning the trail into -a circle. +* evaluating pagespecs should only happen *after* scanning has finished, + to guarantee that everything you might want to base a pagespec on + (`meta`, etc.) has been gathered by scanning diff --git a/doc/plugins/contrib/video.mdwn b/doc/plugins/contrib/video.mdwn new file mode 100644 index 000000000..baa0c6500 --- /dev/null +++ b/doc/plugins/contrib/video.mdwn @@ -0,0 +1,25 @@ +[[!template id=plugin name=video author="[[Yury Chumak|sphynkx]]"]] + +## Video + +This plugin provides embedding video on wikipages. Plugin uses most simple embedding method - only with *embed* tag and without any JS-scripts. + +###Usage + +>\[\[\!video width=100 height=100 type="application/x-shockwave-flash" src="/\_jwplayer/player.swf" allowscriptaccess="always" allowfullscreen="true" autostart="false" file="path\_to\_video"\]\] + +All parameters are optional except *file* and will be replaced with the default settings as showed in the above example. + +*file* is relative path in webdir or web-address (to Youtube page). + +### Install +Download and unpack [archive](http://sphynkx.org.ua/progr/videoplug/jw_videoplugin.tar.bz2) in your ikiwiki webdir. +Or download [JW Player](http://www.longtailvideo.com/players/jw-flv-player/) and [perl module](http://sphynkx.org.ua/progr/videoplug/video.pm) separately. Make dir *\_jwplayer* and put player.swf in it. Also put *video.pm* in *Plugin* dir. In Ikiwiki configuration switch on the plugin: + + add_plugins => [qw{.......... video}] + +### Note + +[Htmlscrubber](http://ikiwiki.info/plugins/htmlscrubber/) may block *embed* tag. + +If embed tag present but video not playing - check mode of unpacked *player.swf*. diff --git a/doc/plugins/contrib/video/discussion.mdwn b/doc/plugins/contrib/video/discussion.mdwn new file mode 100644 index 000000000..577790988 --- /dev/null +++ b/doc/plugins/contrib/video/discussion.mdwn @@ -0,0 +1,3 @@ +I'm sure this is useful to its author in his situation, but I have to point +out that ikiwiki supports the html5 `