I would like wiki to have the capability to create a [[link]] to a specific point inside another (or the same) article. This would be analogous to the HTML syntax as in... href="www.somewhere#specificPointInside". As a Wiki feature, this could support two ways to specify the #specificPointInside. (1) use a hidden anchor (as in HTML <a> tags), or (2) use a construct similar to XPointer, but using notation such as == or * to denote nodes. It would be great if this Wiki construct supported regular expressions and nesting.
For example, [[javaArticle#==history.*/*[2] ]], would mean: link to the 2nd bullet in the title starting with "history" of the javaArticle article. (Explanation: the # means that the following is a link to a point inside the article. The "==history" refers to the wiki title construct. The " .* " after hister is the regular expression code for "skip any number of characters to the end of the line." The "/" after that indicates that the following code is a narrowing navigation within the construct just seen on the left of the /. Finally, the "*[2]" means match the bullet "*" nodes and return the 2nd one found. )
This XPointer-like approach would make the links flexible and eliminate the need for a new article to edit an already-existing article just to put in a link to a point inside that article. This feature would be useful when long articles contain a number of key facts in a subject that new articles on the subject would like to reference conveniently.
Thanks in advance for any comment such as (1) it's already available, (2) how to get such things implemented by the Wiki developers, or (3) how to become a Wiki developer and so be able to implement it yourself, (4) why its a terrible idea.
John2000
On 5/31/05, John Prieur john2000@ijsolve.com wrote:
I would like wiki to have the capability to create a [[link]] to a specific point inside another (or the same) article. This would be analogous to the HTML syntax as in... href="www.somewhere#specificPointInside".
MediaWiki already provides this functionality. To link to a section within the current article, use "[[#Section]]". For a section within another article, use "[[Article#Section]]". For more, see
http://en.wikipedia.org/wiki/Wikipedia:Editing_help#Links_and_URLs
-- David Iberri
On 31/05/05, John Prieur john2000@ijsolve.com wrote:
(1) use a hidden anchor (as in HTML <a> tags), or (2) use a construct similar to XPointer, but using notation such as == or * to denote nodes. It would be great if this Wiki construct supported regular expressions and nesting.
As already mentionned, the simplest level of this is already available - every heading automatically has an HTML <a> element next to it, and internal links can be constructed to refer to these in the standard way ([[foo#bar]]).
The main problem with this is that in a wiki document, headings are subject to frequent change, so if the anchor is tied to the precise wording of a heading, links will frequently be invalidated (and become links to the top of the page instead). The XPointer-style approach you suggest just makes this more complicated - the regex might remain valid longer, but is still very dependent on the whims of editors, and creating anchors for points other than headings just multiplies the opportunities for links not behaving as intended.
A way round this would be to create some markup for "insert an anchor here" - giving users direct control over the content being a pretty fundamental concept in wikidom. Of course, there's also a *presentation* issue here - if you're dumped in the middle of a paragraph, you could be forgiven for thinking your browser had gone screwy, so it's probably best to stick to only having anchors on headings. Which, in a rather-long-winded-cos-I'm-tired way, is why I like the suggestion at http://bugzilla.wikimedia.org/show_bug.cgi?id=1521 to allow alternative anchors to be defined manually for a heading - which would allow invisible "sticky" anchors to outlast the wording or even *structure* of sections.
wikitech-l@lists.wikimedia.org