foo
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Fri, 10 Mar 2006 07:00:09 +0000 (07:00 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Fri, 10 Mar 2006 07:00:09 +0000 (07:00 +0000)
doc/bugs.mdwn [new file with mode: 0644]
doc/todo.mdwn
ikiwiki

diff --git a/doc/bugs.mdwn b/doc/bugs.mdwn
new file mode 100644 (file)
index 0000000..235f06f
--- /dev/null
@@ -0,0 +1,6 @@
+* Has bugs updating things if the bestlink of a page changes due to
+  adding/removing a page. For example, if Foo/Bar links to "Baz", which is
+  Foo/Baz, and Foo/Bar/Baz gets added, it will update the links in Foo/Bar
+  to point to it, but will forget to update the linkbacks in Foo/Baz.
+  And if Foo/Bar/Baz is then removed, it forgets to update Foo/Bar to link
+  back to Foo/Baz.
index 1a0dd6fb4aa9c42b1d4f96e2e03c8bf93b800500..b7b23ef564a3a3e83d587cbbeb3d946304c499ba 100644 (file)
@@ -50,3 +50,5 @@ Being case insensative is handy, but it does make the [[BackLinks]] a bit
 ugly compared to other links. It should be possible to support pagenames
 that have uppercase, while still allowing them to be linked to using any
 case.
 ugly compared to other links. It should be possible to support pagenames
 that have uppercase, while still allowing them to be linked to using any
 case.
+
+## [[Bugs]]
diff --git a/ikiwiki b/ikiwiki
index 2808ccc78eab6074c2c8d1a23f8d2f775cee2f91..f42be3b01d8e9a74ac15485314c81749cce3063d 100755 (executable)
--- a/ikiwiki
+++ b/ikiwiki
@@ -154,7 +154,7 @@ sub bestlink ($$) {
                }
        } while $cwd=~s!/?[^/]+$!!;
 
                }
        } while $cwd=~s!/?[^/]+$!!;
 
-       print STDERR "warning: page $page, broken link: $link\n";
+       #print STDERR "warning: page $page, broken link: $link\n";
        return "";
 }
 
        return "";
 }
 
@@ -173,7 +173,9 @@ sub htmllink ($$) {
        return $link if $page eq $bestlink;
        
        # TODO BUG: %renderedfiles may not have it, if the linked to page
        return $link if $page eq $bestlink;
        
        # TODO BUG: %renderedfiles may not have it, if the linked to page
-       # was also added and isn't yet rendered!
+       # was also added and isn't yet rendered! Note that this bug is
+       # masked by the bug mentioned below that makes all new files
+       # be rendered twice.
        if (! grep { $_ eq $bestlink } values %renderedfiles) {
                $bestlink=htmlpage($bestlink);
        }
        if (! grep { $_ eq $bestlink } values %renderedfiles) {
                $bestlink=htmlpage($bestlink);
        }
@@ -385,7 +387,7 @@ sub refresh () {
        # if any files were added or removed, check to see if each page
        # needs an update due to linking to them
        # TODO: inefficient; pages may get rendered above and again here;
        # if any files were added or removed, check to see if each page
        # needs an update due to linking to them
        # TODO: inefficient; pages may get rendered above and again here;
-       # problem is the bestlink may have changes and we won't know until
+       # problem is the bestlink may have changed and we won't know until
        # now
        if (@add || @del) {
 FILE:          foreach my $file (@files) {
        # now
        if (@add || @del) {
 FILE:          foreach my $file (@files) {
@@ -408,7 +410,7 @@ FILE:               foreach my $file (@files) {
        # pages it links to
        # TODO: inefficient; pages may get rendered above and again here;
        # problem is the linkbacks could be wrong in the first pass render
        # pages it links to
        # TODO: inefficient; pages may get rendered above and again here;
        # problem is the linkbacks could be wrong in the first pass render
-       # above.
+       # above
        if (%rendered) {
                my %linkchanged;
                foreach my $file (keys %rendered, @del) {
        if (%rendered) {
                my %linkchanged;
                foreach my $file (keys %rendered, @del) {