]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - doc/todo/Bestdir_along_with_bestlink_in_IkiWiki.pm.mdwn
web commit by http://camrdale.myopenid.com/: Add new wishlist item for parsing debian...
[git.ikiwiki.info.git] / doc / todo / Bestdir_along_with_bestlink_in_IkiWiki.pm.mdwn
index 1c09143365617ea2823cb204802957a2e03feef2..37660a7b8fbd78a02f708f15d9a2e83d8985a318 100644 (file)
@@ -1,44 +1,46 @@
 This patch adds function bestdir() which returns best directory from the directory structure. This is in addition to the bestlink() function which is there in IkiWiki.pm 
 This patch adds function bestdir() which returns best directory from the directory structure. This is in addition to the bestlink() function which is there in IkiWiki.pm 
--------
-Index: IkiWiki.pm
-===================================================================
---- IkiWiki.pm  (revision 9)
-+++ IkiWiki.pm  (working copy)
-@@ -391,6 +391,35 @@
-        return "";
- } #}}}
 
 
-+sub bestdir ($$) { #{{{
-+    my $page=shift;
-+       my $link=shift;
-+       my $cwd=$page;
-+
-+       if ($link=~s/^\/+//) {
-+               $cwd="";
-+       }
-+
-+       do {
-+               my $l=$cwd;
-+               $l.="/" if length $l;
-+               $l.=$link;
-+               if (-d "$config{srcdir}/$l") {
-+                       return $l;
-+               }
-+       } while $cwd=~s!/?[^/]+$!!;
-+
-+       if (length $config{userdir}) {
-+               my $l = "$config{userdir}/".lc($link);
-+
-+               if (-d $l) {
-+                       return $l;
-+               }
-+       }
-+
-+       return "";
-+} #}}}
-+
- sub isinlinableimage ($) { #{{{
-        my $file=shift;
+-------
 
 
+    Index: IkiWiki.pm
+    ===================================================================
+    --- IkiWiki.pm  (revision 9)
+    +++ IkiWiki.pm  (working copy)
+    @@ -391,6 +391,35 @@
+            return "";
+     } #}}}
+    
+    +sub bestdir ($$) { #{{{
+    +    my $page=shift;
+    +       my $link=shift;
+    +       my $cwd=$page;
+    +
+    +       if ($link=~s/^\/+//) {
+    +               $cwd="";
+    +       }
+    +
+    +       do {
+    +               my $l=$cwd;
+    +               $l.="/" if length $l;
+    +               $l.=$link;
+    +               if (-d "$config{srcdir}/$l") {
+    +                       return $l;
+    +               }
+    +       } while $cwd=~s!/?[^/]+$!!;
+    +
+    +       if (length $config{userdir}) {
+    +               my $l = "$config{userdir}/".lc($link);
+    +
+    +               if (-d $l) {
+    +                       return $l;
+    +               }
+    +       }
+    +
+    +       return "";
+    +} #}}}
+    +
+     sub isinlinableimage ($) { #{{{
+            my $file=shift;
+    
 ---- 
 -[[users/arpitjain]]
\ No newline at end of file
 ---- 
 -[[users/arpitjain]]
\ No newline at end of file