]> sipb.mit.edu Git - ikiwiki.git/commitdiff
Merge remote-tracking branch 'smcv/ready/literal-pagenames'
authorJoey Hess <joey@kitenet.net>
Sun, 8 Apr 2012 20:02:03 +0000 (16:02 -0400)
committerJoey Hess <joey@kitenet.net>
Sun, 8 Apr 2012 20:02:03 +0000 (16:02 -0400)
21 files changed:
IkiWiki/CGI.pm
IkiWiki/Plugin/aggregate.pm
IkiWiki/Plugin/amazon_s3.pm
IkiWiki/Plugin/attachment.pm
IkiWiki/Plugin/comments.pm
IkiWiki/Plugin/editpage.pm
IkiWiki/Plugin/po.pm
IkiWiki/Plugin/remove.pm
IkiWiki/Plugin/rename.pm
IkiWiki/Plugin/transient.pm
IkiWiki/Render.pm
debian/changelog
doc/bugs/definition_lists_should_be_bold.mdwn [new file with mode: 0644]
doc/bugs/must_save_before_uploading_more_than_one_attachment.mdwn
doc/bugs/nonexistent_pages_in_inline_pagenames_do_not_add_a_dependency.mdwn
doc/bugs/removal_of_transient_pages.mdwn
doc/bugs/wrong_link_in_recentchanges_when_reverting_an_ikiwiki_outside_git_root.mdwn
doc/plugins/contrib/album.mdwn
doc/roadmap.mdwn
doc/todo/do_not_make_links_backwards.mdwn
t/prune.t [new file with mode: 0755]

index 62383b6fd22cf3ca6bed2dc3571f5cafb3c10715..5baa6c1798ef02e1f45680daa032da17674fafb0 100644 (file)
@@ -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;
index 5e22609c9b354a2b2770762a17cd60bcd5c36535..83bd670cb449f017ce9c35b81262af29ccdb6883 100644 (file)
@@ -201,7 +201,7 @@ sub migrate_to_internal {
                if (-e $oldoutput) {
                        require IkiWiki::Render;
                        debug("removing output file $oldoutput");
-                       IkiWiki::prune($oldoutput);
+                       IkiWiki::prune($oldoutput, $config{destdir});
                }
        }
        
index cfd8cd3477f81dd0758564994f35979419e330a0..a9da6bf12b69dc62f2ee05f22aaaef2c88fe7dde 100644 (file)
@@ -232,8 +232,9 @@ sub writefile ($$$;$$) {
 }
 
 # This is a wrapper around the real prune.
-sub prune ($) {
+sub prune ($;$) {
        my $file=shift;
+       my $up_to=shift;
 
        my @keys=IkiWiki::Plugin::amazon_s3::file2keys($file);
 
@@ -250,7 +251,7 @@ sub prune ($) {
                }
        }
 
-       return $IkiWiki::Plugin::amazon_s3::subs{'IkiWiki::prune'}->($file);
+       return $IkiWiki::Plugin::amazon_s3::subs{'IkiWiki::prune'}->($file, $up_to);
 }
 
 1
index 133a54dafd718f15cb763503c7d9b5d80b17d577..aea70429d0bcc3bc86a776ba8b2dde8352483a37 100644 (file)
@@ -286,7 +286,7 @@ sub attachments_save {
        }
        return unless @attachments;
        require IkiWiki::Render;
-       IkiWiki::prune($dir);
+       IkiWiki::prune($dir, $config{wikistatedir}."/attachments");
 
        # Check the attachments in and trigger a wiki refresh.
        if ($config{rcs}) {
index 0d5e3c078a9c229b409950c1e65eb1affa3787ac..285013e49175c8651055bb53e34e71e44115699c 100644 (file)
@@ -665,9 +665,11 @@ sub commentmoderation ($$) {
 
                                my $page=IkiWiki::dirname($f);
                                my $file="$config{srcdir}/$f";
+                               my $filedir=$config{srcdir};
                                if (! -e $file) {
                                        # old location
                                        $file="$config{wikistatedir}/comments_pending/".$f;
+                                       $filedir="$config{wikistatedir}/comments_pending";
                                }
 
                                if ($action eq 'Accept') {
@@ -682,7 +684,7 @@ sub commentmoderation ($$) {
                                }
 
                                require IkiWiki::Render;
-                               IkiWiki::prune($file);
+                               IkiWiki::prune($file, $filedir);
                        }
                }
 
index 54051c58c2cf836e258c110d0ec4a47d6ff1e0a2..d3c6959354eeebf550d199870cbe7a1c5d1a818c 100644 (file)
@@ -39,7 +39,7 @@ sub refresh () {
                                }
                                if ($delete) {
                                        debug(sprintf(gettext("removing old preview %s"), $file));
-                                       IkiWiki::prune("$config{destdir}/$file");
+                                       IkiWiki::prune("$config{destdir}/$file", $config{destdir});
                                }
                        }
                        elsif (defined $mtime) {
index 26c6463dabf5705eeb870f2b44bfa51e1cafed59..53e6af92f1db14c668f287724aed7b8b12c6f76a 100644 (file)
@@ -1102,7 +1102,7 @@ sub deletetranslations ($) {
                        IkiWiki::rcs_remove($_);
                }
                else {
-                       IkiWiki::prune("$config{srcdir}/$_");
+                       IkiWiki::prune("$config{srcdir}/$_", $config{srcdir});
                }
        } @todelete;
 
index 14ac01c9bcfc390f370f1a8fca74c3b51d7f0baa..d48b28f955043ec347dd87879a789c0830dfa5ab 100644 (file)
@@ -22,6 +22,13 @@ sub getsetup () {
                },
 }
 
+sub allowed_dirs {
+       return grep { defined $_ } (
+               $config{srcdir},
+               $IkiWiki::Plugin::transient::transientdir,
+       );
+}
+
 sub check_canremove ($$$) {
        my $page=shift;
        my $q=shift;
@@ -33,12 +40,22 @@ sub check_canremove ($$$) {
                        htmllink("", "", $page, noimageinline => 1)));
        }
 
-       # Must exist on disk, and be a regular file.
+       # Must exist in either the srcdir or a suitable underlay (e.g.
+       # transient underlay), and be a regular file.
        my $file=$pagesources{$page};
-       if (! -e "$config{srcdir}/$file") {
+       my $dir;
+
+       foreach my $srcdir (allowed_dirs()) {
+               if (-e "$srcdir/$file") {
+                       $dir = $srcdir;
+                       last;
+               }
+       }
+
+       if (! defined $dir) {
                error(sprintf(gettext("%s is not in the srcdir, so it cannot be deleted"), $file));
        }
-       elsif (-l "$config{srcdir}/$file" && ! -f _) {
+       elsif (-l "$dir/$file" && ! -f _) {
                error(sprintf(gettext("%s is not a file"), $file));
        }
        
@@ -46,7 +63,7 @@ sub check_canremove ($$$) {
        # This is sorta overkill, but better safe than sorry.
        if (! defined pagetype($pagesources{$page})) {
                if (IkiWiki::Plugin::attachment->can("check_canattach")) {
-                       IkiWiki::Plugin::attachment::check_canattach($session, $page, "$config{srcdir}/$file");
+                       IkiWiki::Plugin::attachment::check_canattach($session, $page, "$dir/$file");
                }
                else {
                        error("removal of attachments is not allowed");
@@ -124,7 +141,7 @@ sub removal_confirm ($$@) {
                        my $f=IkiWiki::Plugin::attachment::is_held_attachment($page);
                        if (defined $f) {
                                require IkiWiki::Render;
-                               IkiWiki::prune($f);
+                               IkiWiki::prune($f, "$config{wikistatedir}/attachments");
                        }
                }
        }
@@ -223,21 +240,34 @@ sub sessioncgi ($$) {
                        require IkiWiki::Render;
                        if ($config{rcs}) {
                                IkiWiki::disable_commit_hook();
-                               foreach my $file (@files) {
-                                       IkiWiki::rcs_remove($file);
+                       }
+                       my $rcs_removed = 1;
+
+                       foreach my $file (@files) {
+                               foreach my $srcdir (allowed_dirs()) {
+                                       if (-e "$srcdir/$file") {
+                                               if ($srcdir eq $config{srcdir} && $config{rcs}) {
+                                                       IkiWiki::rcs_remove($file);
+                                                       $rcs_removed = 1;
+                                               }
+                                               else {
+                                                       IkiWiki::prune("$srcdir/$file", $srcdir);
+                                               }
+                                       }
                                }
-                               IkiWiki::rcs_commit_staged(
-                                       message => gettext("removed"),
-                                       session => $session,
-                               );
-                               IkiWiki::enable_commit_hook();
-                               IkiWiki::rcs_update();
                        }
-                       else {
-                               foreach my $file (@files) {
-                                       IkiWiki::prune("$config{srcdir}/$file");
+
+                       if ($config{rcs}) {
+                               if ($rcs_removed) {
+                                       IkiWiki::rcs_commit_staged(
+                                               message => gettext("removed"),
+                                               session => $session,
+                                       );
                                }
+                               IkiWiki::enable_commit_hook();
+                               IkiWiki::rcs_update();
                        }
+
                        IkiWiki::refresh();
                        IkiWiki::saveindex();
 
index 8e32d41aecfd58934fc7353612c680162abd2914..8387a1e32446753f749887ba5655d23c2dfce462 100644 (file)
@@ -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);
index 4ea4317d4fde56e6eb2652f70fe0c773316d4290..d4eb005ea2485374410396b5323c3db0c6e6b191 100644 (file)
@@ -43,7 +43,7 @@ sub rendered (@) {
                my $casualty = "$transientdir/$file";
                if (srcfile($file) ne $casualty && -e $casualty) {
                        debug(sprintf(gettext("removing transient version of %s"), $file));
-                       IkiWiki::prune($casualty);
+                       IkiWiki::prune($casualty, $transientdir);
                }
        }
 }
index d6c1f4f4c5ec685ff0cfefcb4c6f7db81163e786..a90d202eef0c10fd480b00459c1238f58052b094 100644 (file)
@@ -262,12 +262,13 @@ sub render ($$) {
        }
 }
 
-sub prune ($) {
+sub prune ($;$) {
        my $file=shift;
+       my $up_to=shift;
 
        unlink($file);
        my $dir=dirname($file);
-       while (rmdir($dir)) {
+       while ((! defined $up_to || $dir =~ m{^\Q$up_to\E\/}) && rmdir($dir)) {
                $dir=dirname($dir);
        }
 }
@@ -447,7 +448,7 @@ sub remove_del (@) {
                }
        
                foreach my $old (@{$oldrenderedfiles{$page}}) {
-                       prune($config{destdir}."/".$old);
+                       prune($config{destdir}."/".$old, $config{destdir});
                }
 
                foreach my $source (keys %destsources) {
@@ -537,7 +538,7 @@ sub remove_unrendered () {
                foreach my $file (@{$oldrenderedfiles{$page}}) {
                        if (! grep { $_ eq $file } @{$renderedfiles{$page}}) {
                                debug(sprintf(gettext("removing %s, no longer built by %s"), $file, $page));
-                               prune($config{destdir}."/".$file);
+                               prune($config{destdir}."/".$file, $config{destdir});
                        }
                }
        }
@@ -844,7 +845,7 @@ sub clean_rendered {
        remove_unrendered();
        foreach my $page (keys %oldrenderedfiles) {
                foreach my $file (@{$oldrenderedfiles{$page}}) {
-                       prune($config{destdir}."/".$file);
+                       prune($config{destdir}."/".$file, $config{destdir});
                }
        }
 }
index cf2dbf8a436747adada5c04d0b782e8c3ce391c9..97f5500f8b68a5bce8dc4d502c9fe223b8268088 100644 (file)
@@ -14,6 +14,9 @@ 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.
+  * remove: Support removing of pages in the transient underlay. (smcv)
 
  -- Joey Hess <joeyh@debian.org>  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 (file)
index 0000000..95233f7
--- /dev/null
@@ -0,0 +1,25 @@
+Definition lists do not look great here...
+
+Here is an example.
+
+<dl>
+<dt>this is a term</dt>
+<dd>and this is its definition.</dd>
+</dl>
+
+(This wiki doesn't support Markdown's extended definition lists, but still, this is valid markup.)
+
+I believe `<dt>` 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]]
+
+> What you dislike seems to be the default rendering of definition lists by
+> browsers. I don't think it's ikiwiki's place to override browser defaults
+> for standard markup in the document body, at least not in the default
+> antitheme. --[[Joey]] 
index 20d5dc8e64407fd88a7b03b4b08049f1d15df47b..bd5ddc6d5a0dc2b3ff4f5d4c7e2c14e016092396 100644 (file)
@@ -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]]
index c2f560e646b953028e21ac1c6a57302ec75692f4..70b06a951b43656db77bdee103438e92d85ae397 100644 (file)
@@ -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]]
index 2667a2b8318cfdecddafb4caa9d1b1efd1913737..dfa14d359a831eef1749927055628dcd177e8ffb 100644 (file)
@@ -25,3 +25,37 @@ 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]]
+
+> I've applied the branch as-is, so this bug is [[done]].
+> `prune` is not an exported API so changing it would be ok.. 
+> I think required 2-argument would be better, but have not checked
+> all the call sites to see if the `$file` is available split out
+> as that would need. --[[Joey]] 
index fadf289dfd3fbc53681a009536d16b05e3798033..5f7450b799a0f955e4f083a1073bac8549f49800 100644 (file)
@@ -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]]
index 836a98f33b9d5225b810bd40360ed2ad392c819a..745a44e8b8c82ca691fe0b504963c234cd8ef8a0 100644 (file)
@@ -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
index 159ded5deb788709476ba1176fe2d46cb791a94b..f2ff5802ec30747584ba9510fcad679e4213e3af 100644 (file)
@@ -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]], ...
index 55db32b4f49e856ffd1cc229aed74a4d236928e2..4059d8e2ac83d092bb5210549159082a581ef0f3 100644 (file)
@@ -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.
diff --git a/t/prune.t b/t/prune.t
new file mode 100755 (executable)
index 0000000..8c3925e
--- /dev/null
+++ b/t/prune.t
@@ -0,0 +1,23 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+use Test::More tests => 6;
+use File::Path qw(make_path remove_tree);
+
+BEGIN { use_ok("IkiWiki"); }
+BEGIN { use_ok("IkiWiki::Render"); }
+
+%config=IkiWiki::defaultconfig();
+
+remove_tree("t/tmp");
+
+make_path("t/tmp/srcdir/a/b/c");
+make_path("t/tmp/srcdir/d/e/f");
+writefile("a/b/c/d.mdwn", "t/tmp/srcdir", "foo");
+writefile("d/e/f/g.mdwn", "t/tmp/srcdir", "foo");
+IkiWiki::prune("t/tmp/srcdir/d/e/f/g.mdwn");
+ok(-d "t/tmp/srcdir");
+ok(! -e "t/tmp/srcdir/d");
+IkiWiki::prune("t/tmp/srcdir/a/b/c/d.mdwn", "t/tmp/srcdir");
+ok(-d "t/tmp/srcdir");
+ok(! -e "t/tmp/srcdir/a");