From: Joey Hess Date: Sun, 8 Apr 2012 19:54:25 +0000 (-0400) Subject: Merge remote-tracking branch 'smcv/ready/transient-rm' X-Git-Tag: 3.20120419~52 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/b92e8caa4d8f71e6a354fda23a7a99afda62bf75?hp=a7f8a4eb983c8cd92aa45d8e2000939915c377ec Merge remote-tracking branch 'smcv/ready/transient-rm' --- diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index 62383b6fd..5baa6c179 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -131,7 +131,7 @@ sub needsignin ($$) { if (! defined $session->param("name") || ! userinfo_get($session->param("name"), "regdate")) { - $session->param(postsignin => $ENV{QUERY_STRING}); + $session->param(postsignin => $q->query_string); cgi_signin($q, $session); cgi_savesession($session); exit; diff --git a/IkiWiki/Plugin/rename.pm b/IkiWiki/Plugin/rename.pm index 8e32d41ae..8387a1e32 100644 --- a/IkiWiki/Plugin/rename.pm +++ b/IkiWiki/Plugin/rename.pm @@ -206,14 +206,22 @@ sub rename_start ($$$$) { exit 0; } -sub postrename ($;$$$) { +sub postrename ($$$;$$) { + my $cgi=shift; my $session=shift; my $src=shift; my $dest=shift; my $attachment=shift; - # Load saved form state and return to edit page. - my $postrename=CGI->new($session->param("postrename")); + # Load saved form state and return to edit page, using stored old + # cgi state. Or, if the rename was not started on the edit page, + # return to the renamed page. + my $postrename=$session->param("postrename"); + if (! defined $postrename) { + IkiWiki::redirect($cgi, urlto(defined $dest ? $dest : $src)); + exit; + } + my $oldcgi=CGI->new($postrename); $session->clear("postrename"); IkiWiki::cgi_savesession($session); @@ -222,21 +230,21 @@ sub postrename ($;$$$) { # They renamed the page they were editing. This requires # fixups to the edit form state. # Tweak the edit form to be editing the new page. - $postrename->param("page", $dest); + $oldcgi->param("page", $dest); } # Update edit form content to fix any links present # on it. - $postrename->param("editcontent", + $oldcgi->param("editcontent", renamepage_hook($dest, $src, $dest, - $postrename->param("editcontent"))); + $oldcgi->param("editcontent"))); # Get a new edit token; old was likely invalidated. - $postrename->param("rcsinfo", + $oldcgi->param("rcsinfo", IkiWiki::rcs_prepedit($pagesources{$dest})); } - IkiWiki::cgi_editpage($postrename, $session); + IkiWiki::cgi_editpage($oldcgi, $session); } sub formbuilder (@) { @@ -291,16 +299,16 @@ sub sessioncgi ($$) { my $session=shift; my ($form, $buttons)=rename_form($q, $session, Encode::decode_utf8($q->param("page"))); IkiWiki::decode_form_utf8($form); + my $src=$form->field("page"); if ($form->submitted eq 'Cancel') { - postrename($session); + postrename($q, $session, $src); } elsif ($form->submitted eq 'Rename' && $form->validate) { IkiWiki::checksessionexpiry($q, $session, $q->param('sid')); # 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}) if exists $pagesources{$src}; my $dest=IkiWiki::possibly_foolish_untaint(titlepage($form->field("new_name"))); @@ -324,7 +332,7 @@ sub sessioncgi ($$) { IkiWiki::Plugin::attachment::is_held_attachment($src); if ($held) { rename($held, IkiWiki::Plugin::attachment::attachment_holding_location($dest)); - postrename($session, $src, $dest, $q->param("attachment")) + postrename($q, $session, $src, $dest, $q->param("attachment")) unless defined $srcfile; } @@ -430,7 +438,7 @@ sub sessioncgi ($$) { $renamesummary.=$template->output; } - postrename($session, $src, $dest, $q->param("attachment")); + postrename($q, $session, $src, $dest, $q->param("attachment")); } else { IkiWiki::showform($form, $buttons, $session, $q); diff --git a/debian/changelog b/debian/changelog index cf2dbf8a4..7d92ad151 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,6 +14,8 @@ ikiwiki (3.20120204) UNRELEASED; urgency=low * passwordauth: Fix url in password recovery email to be absolute. * httpauth: When it's the only auth method, avoid a pointless and confusing signin form, and go right to the httpauthurl. + * rename: Allow rename to be started not from the edit page; return to + the renamed page in this case. -- Joey Hess Wed, 21 Mar 2012 14:33:14 -0400 diff --git a/doc/bugs/definition_lists_should_be_bold.mdwn b/doc/bugs/definition_lists_should_be_bold.mdwn new file mode 100644 index 000000000..a6597a45c --- /dev/null +++ b/doc/bugs/definition_lists_should_be_bold.mdwn @@ -0,0 +1,20 @@ +Definition lists do not look great here... + +Here is an example. + +
+
this is a term
+
and this is its definition.
+
+ +(This wiki doesn't support Markdown's extended definition lists, but still, this is valid markup.) + +I believe `
` should be made bold. I have added this to my `local.css`, and I would hate to add this all the time forever: + + /* definition lists look better with the term in bold */ + dt + { + font-weight: bold; + } + +:) How does that look? I can provide a patch for the base wiki if you guys really want... ;) -- [[anarcat]] diff --git a/doc/bugs/must_save_before_uploading_more_than_one_attachment.mdwn b/doc/bugs/must_save_before_uploading_more_than_one_attachment.mdwn index 20d5dc8e6..bd5ddc6d5 100644 --- a/doc/bugs/must_save_before_uploading_more_than_one_attachment.mdwn +++ b/doc/bugs/must_save_before_uploading_more_than_one_attachment.mdwn @@ -26,7 +26,19 @@ Is this a problem on my site or does anyone else see this? >>> The right fix would probably be for `do=create` to allow replacing a page >>> in the transient underlay without complaining (like the behaviour that ->>> `do=edit` normally has). That wouldn't help you unless [[plugins/autoindex]] +>>> `do=edit` normally has). + +>>>> ... which it turns out it already does. --[[smcv]] + +>>> That wouldn't help you unless [[plugins/autoindex]] >>> defaulted to making transient pages (`autoindex_commit => 0`), but if we >>> can fix [[removal_of_transient_pages]] then maybe that default can change? >>> --[[smcv]] + +>>>> It turns out that with `autoindex_commit => 0`, the failure mode is +>>>> different. The transient map is created when you attach the +>>>> attachment. When you save the page, it's written into the srcdir, +>>>> the map is deleted from the transientdir, and the ctime/mtime +>>>> in the indexdb are those of the file in the srcdir, but for some +>>>> reason the HTML output isn't re-generated (despite a refresh +>>>> happening). --[[smcv]] diff --git a/doc/bugs/nonexistent_pages_in_inline_pagenames_do_not_add_a_dependency.mdwn b/doc/bugs/nonexistent_pages_in_inline_pagenames_do_not_add_a_dependency.mdwn index c2f560e64..70b06a951 100644 --- a/doc/bugs/nonexistent_pages_in_inline_pagenames_do_not_add_a_dependency.mdwn +++ b/doc/bugs/nonexistent_pages_in_inline_pagenames_do_not_add_a_dependency.mdwn @@ -33,3 +33,10 @@ I think the presence dependency is probably the cleanest approach? > I think it was possibly a mistake to use wikilink style lookup for > `pagenames`. --[[Joey]] + +[[!tag patch]] [[!template id=gitbranch branch=smcv/literal-pagenames author="[[smcv]]"]] +>> I used the linking rules to make references to +>> "nearby" pages convenient, but if you'd prefer "absolute" +>> semantics, my `ready/literal-pagenames` branch does that. For +>> my main use-case for `pagenames` ([[plugins/contrib/album]]) +>> it's fine either way. --[[smcv]] diff --git a/doc/bugs/removal_of_transient_pages.mdwn b/doc/bugs/removal_of_transient_pages.mdwn index 2667a2b83..8048ad9cc 100644 --- a/doc/bugs/removal_of_transient_pages.mdwn +++ b/doc/bugs/removal_of_transient_pages.mdwn @@ -25,3 +25,31 @@ pages, until this is fixed. --[[Joey]] >>>> to affect by web edits. The `-f` check seems rather redundant, >>>> surely if it's in `%pagesources` ikiwiki has already verified it's >>>> safe. --[[Joey]] + +---- + +[[!template id=gitbranch branch=smcv/ready/transient-rm author="[[Simon McVittie|smcv]]"]] + +Here's a branch. It special-cases the `$transientdir`, but in such a way +that the special case could easily be extended to other locations where +deletion should be allowed. + +It also changes `IkiWiki::prune()` to optionally stop pruning empty +parent directories at the point where you'd expect it to (for instance, +previously it would remove the `$transientdir` itself, if it turns out +to be empty), and updates callers. + +The new `prune` API looks like this: + + IkiWiki::prune("$config{srcdir}/$file", $config{srcdir}); + +with the second argument optional. I wonder whether it ought to look +more like `writefile`: + + IkiWiki::prune($config{srcdir}, $file); + +although that would be either an incompatible change to internal API +(forcing all callers to update to 2-argument), or being a bit +inconsistent between the one-and two-argument forms. Thoughts? + +--[[smcv]] 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 index fadf289df..5f7450b79 100644 --- 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 @@ -3,4 +3,6 @@ in ikiwiki instances that don't reside in the git root directory (the only ones the expected behavior is to compensate for the modified root directory (i.e., show index instead of doc/index). > This seems to work OK now - commit 84c4ca33 and its reversion both -> appear correctly in [[recentchanges]]. --[[smcv]] +> appear correctly in [[recentchanges]]. Looking at git history, +> Joey [[fixed this|done]] in commit 1b6c1895 before 3.20120203. +> --[[smcv]] diff --git a/doc/plugins/contrib/album.mdwn b/doc/plugins/contrib/album.mdwn index 836a98f33..745a44e8b 100644 --- a/doc/plugins/contrib/album.mdwn +++ b/doc/plugins/contrib/album.mdwn @@ -46,9 +46,9 @@ template: ---- -[[!template id=gitbranch branch=smcv/album3 author="[[Simon_McVittie|smcv]]"]] +[[!template id=gitbranch branch=smcv/album4 author="[[Simon_McVittie|smcv]]"]] -Available from [[smcv]]'s git repository, in the `album3` branch. +Available from [[smcv]]'s git repository, in the `album4` branch. I've called it `album` to distinguish it from [[contrib/gallery|plugins/contrib/gallery]], although `gallery` might well be a better name for this functionality. @@ -59,23 +59,25 @@ individual photos can't be bookmarked in a meaningful way, and the best it can do as a fallback for non-Javascript browsers is to provide a direct link to the image.) -Updated, November 2011: rebased onto [[trail]] v3, CSS adjusted. +Updated, April 2012: rebased onto the version of [[trail]] that got merged ## Manual installation -If you don't want to use a branch of ikiwiki, manual installation requires -these files (use the "raw" link in gitweb to download), in addition to the -ones needed by [[trail]]: +First, you need a version of ikiwiki with the [[trail]] plugin merged in +(version 3.20120203 or later). -* [album.pm](http://git.pseudorandom.co.uk/smcv/ikiwiki.git/blob/album3:/IkiWiki/Plugin/album.pm) +Manual installation requires these files (use the "raw" link in gitweb +to download): + +* [album.pm](http://git.pseudorandom.co.uk/smcv/ikiwiki.git/blob/album4:/IkiWiki/Plugin/album.pm) in an `IkiWiki/Plugin` subdirectory of your configured `plugindir` -* [albumviewer.tmpl](http://git.pseudorandom.co.uk/smcv/ikiwiki.git/blob/album3:/templates/albumviewer.tmpl), - [albumitem.tmpl](http://git.pseudorandom.co.uk/smcv/ikiwiki.git/blob/album3:/templates/albumitem.tmpl), - [albumnext.tmpl](http://git.pseudorandom.co.uk/smcv/ikiwiki.git/blob/album3:/templates/albumnext.tmpl) and - [albumprev.tmpl](http://git.pseudorandom.co.uk/smcv/ikiwiki.git/blob/album3:/templates/albumprev.tmpl), +* [albumviewer.tmpl](http://git.pseudorandom.co.uk/smcv/ikiwiki.git/blob/album4:/templates/albumviewer.tmpl), + [albumitem.tmpl](http://git.pseudorandom.co.uk/smcv/ikiwiki.git/blob/album4:/templates/albumitem.tmpl), + [albumnext.tmpl](http://git.pseudorandom.co.uk/smcv/ikiwiki.git/blob/album4:/templates/albumnext.tmpl) and + [albumprev.tmpl](http://git.pseudorandom.co.uk/smcv/ikiwiki.git/blob/album4:/templates/albumprev.tmpl), in your configured `templatedir`, or a `templates` subdirectory of your wiki repository * the album-related bits from the end of the - [stylesheet](http://git.pseudorandom.co.uk/smcv/ikiwiki.git/blob/album3:/doc/style.css) + [stylesheet](http://git.pseudorandom.co.uk/smcv/ikiwiki.git/blob/album4:/doc/style.css) (put them in your local.css) ## Demo diff --git a/doc/roadmap.mdwn b/doc/roadmap.mdwn index 159ded5de..f2ff5802e 100644 --- a/doc/roadmap.mdwn +++ b/doc/roadmap.mdwn @@ -77,13 +77,10 @@ Probably incomplete list: * Remove compatability code in `loadindex` to handle old index data layouts. * Make pagespecs match relative by default? (see [[discussion]]) * Flip wikilinks? (see [[todo/link_plugin_perhaps_too_general?]] and [[todo/do_not_make_links_backwards]]) -* YADA format setup files per default? * Enable tagbase by default (so that tag autocreation will work by default). Note that this is already done for wikis created by `auto-blog.setup`. * [[tips/html5]] on by default (some day..) * Remove support for old `.ikiwiki/comments_pending` from comment plugin. -* Use yaml formatted setup files by default. (Not too compatability breaking - really.) In general, we try to use [[ikiwiki-transition]] or forced rebuilds on upgrade to deal with changes that break compatability. Some things that @@ -91,8 +88,5 @@ can't help with. # future goals -* Conversion support for existing other wikis. - (Being worked on for MoinMoin and TWiki by [[Josh_Triplett|JoshTriplett]] - and Jamey Sharp; support for other wikis should fit into the same - framework.) +* Conversion support for existing other wikis. See [[convert]]. * [[TODO]], [[bugs]], ... diff --git a/doc/todo/do_not_make_links_backwards.mdwn b/doc/todo/do_not_make_links_backwards.mdwn index 55db32b4f..4059d8e2a 100644 --- a/doc/todo/do_not_make_links_backwards.mdwn +++ b/doc/todo/do_not_make_links_backwards.mdwn @@ -54,11 +54,18 @@ There's a caveat: we can't have a per-wiki backwards_links option, because of th >>> That style of link would work whether the link style was "backwards" or "forwards". Unfortunately it could make some links less readable; after all, there is a reason why one wants to be able to change the link text! But I don't know what proportion of the links are like that. It's a thought, anyway. >>> --[[KathrynAndersen]] +>>>> I dislike placing such requirements on the underlay, which is after +>>>> all, just a subset of pages in this wiki, which many of the people +>>>> editing may not even realize are part of the underlay. --[[Joey]] + >>> Another option for internal links is to just use the regular markdown links instead of `\[[text|link]]` markup, that way it works regardless. Then the documentation for the link plugin just has to state both syntaxes in a safe manner. >>> I also agree that we should just switch in one shot, although I am worried this means this could be postponed indefinitely.--[[anarcat]] >>>> I have done just that in my branch: now the underlay only uses wikilinks in the wikilink page, elsewhere regular markdown links are used. I haven't converted the whole of the doc/ directory however, that would be left to the migration. I have written a ikiwik-transition tool to migrate from wikilink to markdown while i was there. --[[anarcat]] +>>>>> No, that is *not* an option. Relative markdown links **break** when +>>>>> page A, containing a link, is inlined into page B. --[[Joey]] + ---- FWIW, I think this change may well be painful, but is a good idea. I can never remember which way around it should be.