]> sipb.mit.edu Git - ikiwiki.git/commitdiff
changed my mind about how to disambiguate links, it seems to make more
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Thu, 21 Dec 2006 22:15:11 +0000 (22:15 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Thu, 21 Dec 2006 22:15:11 +0000 (22:15 +0000)
sense to start them with a /

IkiWiki.pm
basewiki/subpage/linkingrules.mdwn
debian/changelog
doc/bugs/linkingrules_should_document_how_to_link_to_page_at_root_if_non-root_page_exists.mdwn
doc/todo/latex.mdwn

index 54bb1826cfb4178ad82e84cb6125e1f870cb2569..9f6c3bb1f95557dfc0577e6d8fcf9a7ab759651e 100644 (file)
@@ -298,10 +298,9 @@ sub bestlink ($$) { #{{{
        my $link=shift;
        
        my $cwd=$page;
        my $link=shift;
        
        my $cwd=$page;
-
-       # relative links
-       while ($link=~s!(^|/)\.\./!!g) {
-               $cwd=~s!/?[^/]+$!!;
+       if ($link=~s/^\/+//) {
+               # absolute links
+               $cwd="";
        }
 
        do {
        }
 
        do {
index 1543801b328dec55a5a817ff4b13115638aeb6b3..c07a81387f537b514a6f921450277ab4d15cb7bf 100644 (file)
@@ -20,8 +20,8 @@ the only way to link to an unrelated [[SubPage]].
 You can use this to, for example, to link from BazBar to "FooBar/SubPage",
 or from BazBar/SubPage to "FooBar/SubPage".
 
 You can use this to, for example, to link from BazBar to "FooBar/SubPage",
 or from BazBar/SubPage to "FooBar/SubPage".
 
-You can also use ".." in a link, to specify exactly which page to link to,
-when there are multiple pages with similar names and the link goes to the
-wrong page by default. For example, linking from "FooBar/SubPage" to 
-".../OtherPage" will link to the "OtherPage" in the root of the wiki, even
-if there is a "FooBar/OtherPage".
+You can also use "/" at the start of a link, to specify exactly which page
+to link to, when there are multiple pages with similar names and the link
+goes to the wrong page by default. For example, linking from
+"FooBar/SubPage" to  "/OtherPage" will link to the "OtherPage" in the root
+of the wiki, even if there is a "FooBar/OtherPage".
index 5c64cd84c0d3be1bbd26a7917332a5e093d969dd..bc2a384dfa332bbaf95e657a34aae7560877f444 100644 (file)
@@ -18,9 +18,7 @@ ikiwiki (1.36) UNRELEASED; urgency=low
     like, if you want.
   * Patch from Emanuele Aina to fix modification time code in mercurual
     backend.
     like, if you want.
   * Patch from Emanuele Aina to fix modification time code in mercurual
     backend.
-  * Add support for links of the form [[../foo]], this links to the page
-    foo a level higher in the directory hierarchy than the one it would link
-    to by default.
+  * Add support for links of the form [[/foo]]
   * Fix code to make absolute urls for rss feeds, was missing some urls.
   * Fix double-escaping of html entities in titles etc in rss feeds
     that occured if escaped characters were present in the page filename.
   * Fix code to make absolute urls for rss feeds, was missing some urls.
   * Fix double-escaping of html entities in titles etc in rss feeds
     that occured if escaped characters were present in the page filename.
index b6dd51fc7d0ad0ca77139d94da62a80dd62bf4d9..27e07eb2ec14285da2e7eb902ceb25ea4d7791bd 100644 (file)
@@ -1,3 +1,3 @@
 The [[linking_rules|subpage/linkingrules]] should document how to link to a page at the root of the wiki when a normal, unadorned link would use a page of the same name further down the hierarchy.  For example, how should [[todo/latex]] link to [[logo]] rather than [[todo/logo|todo/logo]]?
 
 The [[linking_rules|subpage/linkingrules]] should document how to link to a page at the root of the wiki when a normal, unadorned link would use a page of the same name further down the hierarchy.  For example, how should [[todo/latex]] link to [[logo]] rather than [[todo/logo|todo/logo]]?
 
-> [[bugs/done]].. the syntax to use is ../logo --[[Joey]]
+> [[bugs/done]].. the syntax to use is "/logo" --[[Joey]]
index 940145dd7d13119697b8629a58704c68bca11521..e45db3aedb55039e1de4c6b58bf3a09cd86f3e39 100644 (file)
@@ -2,4 +2,4 @@ How about a plugin adding a
 [[preprocessor_directive|preprocessordirective]] to render some given LaTeX
 as a PNG via [[debpkg dvipng]] and include the resulting image in the page?
 Useful for mathematics, as well as for stuff like the LaTeX version of the
 [[preprocessor_directive|preprocessordirective]] to render some given LaTeX
 as a PNG via [[debpkg dvipng]] and include the resulting image in the page?
 Useful for mathematics, as well as for stuff like the LaTeX version of the
-ikiwiki [[../../logo]].
+ikiwiki [[/logo]].