[dokuwiki] Re: New Pagemove Plugin (Brainstorming)

  • From: Michael Klier <chi@xxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Mon, 22 Mar 2010 23:58:56 +0100

On Mon, Mar 22, 2010 at 08:51:33PM +0100, Stefan Waidele wrote:
>> Also, people wouldn't notice any inconstency when you fix pages which are 
>> part
>> of the move queue at the time they're visited - because they get repaired
>> before the users sees the content. So there's no need to do everything in one
>> go. I hope this makes sense ;).
>
> Not sure ;)
>
> It is not the _visited page_ that is listed in the move queue.
> A page needs fixing if it _links to a moved page_.

I think you didn't understand what I meant. The queue will not contain the
moved pages, but pages that link to moved pages and need fixing.

Say you want to move page :foo and pages :bar :baz are linking to :foo. :foo
will be moved, :bar :baz will be put in the queue. When you know visit page
:bar the plugin sees that it's listed in the queue to be fixed relative to the
moved page :foo and will fix all "old" links to the original page :foo bevor
you get to see the content of page :bar.

> If you determine which pages need to be fixed, then most of the work is  
> already done and you might as well fix it right away.

No, determining the pages which need to be fixed makes like maybe 5% of the
work and is the easiest part of the whole process ;).

> So checking before displaying a page would require to check if there are  
> links to moved pages each and every time a page is rendered -> costs  
> every time.

This is just one extra file read operation, which is cheap compared to doing
everything at once. You could go further and only check if the timestamp of
the pagemove queue is newer than the page itself before doing an actual read
of the queue file - but I partly agree, this could be optimized.

> An addition to link-syntax would probably also come in hand, to prevent  
> links from being "fixed". (Like the $-sign in spreadsheet 
> cell-references)

I don't like that, too specialized. It's either a fix it all or leave it be
thing. Everything else is not what you (or in this case I) would like to
implement ;).

Thanks for all the input so far!

Regards,
        Michael

-- 
Michael Klier

www:    http://www.chimeric.de
jabber: chi@xxxxxxxxxxxxxxxxxx
key:    http://downloads.chimeric.de/chi.asc
key-id: 0x8308F551

Other related posts: