[Pmwiki-users] Re: Re: can pmwiki handle hierarchical content?
chr@home.se
chr
Mon Oct 18 16:01:01 CDT 2004
On Mon, 18 Oct 2004, Patrick R. Michaud wrote:
> [[./SoundCards]] does seem natural, but keep in mind that doing this is
> actually quite different from what we normally experience in URLs, HTML, and
> filesystems.
If I enter this URI in my browser (Opera):
http://www.md.kth.se/~chr/pmwiki/tree/Linux/./Hardware/
it ignores any './' inside the URI and simply gives me
http://www.md.kth.se/~chr/pmwiki/tree/Linux/Hardware/
This also seems to be the way it works from a wiki page, see here:
http://www.pmwiki.org/wiki/Test/LinkWithDots
where I find that: ThisGroup:./././././LinkWithDots is equivalent to
ThisGroup:./LinkWithDots.
So as long as you think of 'this page' as being your point of reference
you can argue that [[./SoundCards]] could naturally be considered a link
to ThisPage:./SoundCards, because that's how URIs (inter-links) already
work.
> Similarly, if I'm running a script called "/home/pmichaud/bin/myscript",
> and inside of that script I make reference to a file called "./data", the
> referenced file is "/home/pmichaud/bin/data" and not
> "/home/pmichaud/bin/myscript/data".
An observation: Your examples assume a path structure like this
directory/directory/directory/file
so to make it correspond to for instance a current page of
Linux/Hardware/SoundCards
we should interpret both 'Linux' and 'Hardware' as groups. (With the
consequence that it gets confusing if Linux/Hardware also is a page)
> I'm not necessarily saying that [[./SoundCards]] can't work, I'm just
> pointing out that it's at odds from what people experience in other
> contexts (e.g., authoring HTML documents) and therefore might be a source
> of confusion.
Well, it is a good point. One of the points I'm trying to make is that we
should have the same (or a similar) "arithmetic" for URIs as we have for
page paths, because it's URIs that normal authors use (and not file
systems).
> If I'm editing Linux.Hardware, it's entirely reasonable
> to expect [[./SoundCards]] to refer to Linux.SoundCards--i.e., the
> "SoundCards" page within the group of the current page (i.e., "Linux").
I agree, that is also a reasonable interpretation, especially if you are
used to working with file systems. Based on these two interpretations, we
can formalize a rule for how [[<some-path>]] should be interpreted:
* [[<some-path>]] becomes ThisPage:<some-path>
* [[<some-path>]] becomes ThisPage:../<some-path>
If the current page is Linux/Hardware, then (from a URI point of view)
ThisPage: = ThisWiki:/Linux/Hardware
Applied to the markup [[./SoundCards]], we get
* ThisWiki:/Linux/Hardware/./SoundCards = ThisWiki:/Linux/Hardware/SoundCards
* ThisWiki:/Linux/Hardware/../.SoundCards = ThisWiki:/Linux/SoundCards
So for both cases we can define the "arithmetic". However, for the second
case we may not use [[./SomePage]] if our current page is the root page.
In other words, if the URI of the current page is ThisWiki:, then
ThisWiki:.././SoundCards
might point outside the wiki.
/Christian
--
Christian Ridderstr?m, +46-8-768 39 44 http://www.md.kth.se/~chr
More information about the pmwiki-users
mailing list