Opened 14 years ago
Last modified 11 years ago
#9947 new defect
Unexpected resolver result for TracLinks in wiki page within hierarchy
Reported by: | Steffen Hoffmann | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | next-major-releases |
Component: | wiki system | Version: | 0.12-stable |
Severity: | normal | Keywords: | wiki, documentation, traclinks |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description (last modified by )
Current wiki parser seems unable to translate links like
WikiPage
, [../WikiPage]
or even [wiki:WikiPage]
to the expected target, a least if used to reference an equally named page from within a wiki subpage:
See TranslationDe/TracWiki@1, where I tried to reference [wiki:TracWiki]
by typing just TracWiki at the top of the page but got the equivalent of [wiki:TranslationDe/TracWiki]
instead, what is plain wrong.
I tried all of the aforementioned syntax and came up with [/wiki/TracWiki]
as valid workaround to get the expected «top-hierarchy page» for a fixed revision in TranslationDe/TracWiki@2.
Attachments (0)
Change History (9)
comment:1 by , 14 years ago
Description: | modified (diff) |
---|
comment:2 by , 14 years ago
That's intentional. Wiki page links are "scoped", in that they are searched up from the current point in the hierarchy. This allows having several "copies" e.g. of the TracGuide under 0.11/
and 0.12/
(or TranslationDe/
), and to reference pages in the same "folder" simply with the page name. If you want to reference the top-level TracWiki
page, you should use [wiki:/TracWiki]
or possibly [wiki:../../TracWiki]
.
The [../WikiPage]
form (and actually any []
link without a scheme like wiki:
) is a relative link, not a wiki page link. There is no "default" scheme.
Worksforme?
comment:3 by , 14 years ago
I agree with Steffen that it's somewhat counter intuitive in the special case of referring to a toplevel page having the same name as the current page, having been bitten myself by this in the past. But making this a special case would be even worse than having to explain the rule. Do we explain this logic well enough in the TracLinks#Relativelinks section? If not, we should integrate Remy's comment:2 there.
follow-up: 5 comment:4 by , 14 years ago
Ok, thanks for the hint. I remember having read about it, but obviously not enough.
Why I need to write [../../TracWiki]
to go from within [wiki:/TranslationDe/TracWiki]
to [wiki:/TracWiki]
is still beyond the logic I understand intuitively, but at least it does follow the handling of siblings in wiki page hierarchies.
Seem like the current page is thought more like a folder than a document in those cases compared to similar structure at file system level. Maybe this particular idea could be made clearer in documentation, but I'll think about it, before I actually propose something or edit the wiki.
Anything else is already cleared now. I've just checked, that the related section in TracLinks is giving similar hints to Remy's comment, so nothing big to worry anymore from my side. - Worksforme now too.
follow-up: 6 comment:5 by , 14 years ago
Keywords: | documentation added |
---|
Replying to shoffmann:
Why I need to write
[../../TracWiki]
to go from within[wiki:/TranslationDe/TracWiki]
to[wiki:/TracWiki]
is still beyond the logic I understand intuitively, but at least it does follow the handling of siblings in wiki page hierarchies.Seem like the current page is thought more like a folder than a document in those cases compared to similar structure at file system level.
Exactly. Think of it this way:
[./SubPage]
links to a sub-page of the page containing the link.[../SiblingPage]
links to a sibling page, i.e. a page that has the same parent. So the target page is at the same level as the page containing the link.- So
[../../HigherPage]
links to a page that is one level higher than the page containing the link. - And for completeness,
[/TopLevelPage]
links to a top-level page.
(The same applies to wiki-scoped links, i.e. [wiki:./SubPage]
, [wiki:../SiblingPage]
, [wiki:../../HigherPage]
and [wiki:/TopLevelPage]
.)
I'm all for updating the documentation if this can be explained clearer.
comment:6 by , 14 years ago
Milestone: | → next-major-0.1X |
---|
Replying to rblank:
- And for completeness,
[/TopLevelPage]
links to a top-level page.
Heh, no. That's the point which is not intuitive about the whole thing. [wiki:/TopLevelPage]
would link to a top-level page, but [/TopLevelPage]
leads to the instance relative link, i.e. t.e.o/TopLevelPage (TopLevelPage). That's why Steffen came with the not so intuitive [/wiki/TopLevelPage]
link.
I think it would be too annoying to change that now, as this behavior for instance relative links [/...]
and site relative links [//...]
is well documented since 0.11 and it makes sense if you're trying to create such a link (e.g. the [/newticket?...]
ones). But for sure, when you "switch" your mental context to wiki references, you'd like to use that notation for toplevel wiki pages.
comment:7 by , 11 years ago
Keywords: | traclinks added; TracLinks removed |
---|
comment:8 by , 11 years ago
Keywords: | traclink added; traclinks removed |
---|
comment:9 by , 11 years ago
Keywords: | traclinks added; traclink removed |
---|
Turned out, that some more tweaking is required - with '/' the 'wiki:' prefix is no longer asumed automatically.