]> sipb.mit.edu Git - ikiwiki.git/blobdiff - doc/todo/inline:_numerical_ordering_by_title.mdwn
applied
[ikiwiki.git] / doc / todo / inline:_numerical_ordering_by_title.mdwn
index d500f21172d785f4b87161217048b6e1636158c5..3d7424b3f606a21b3318b8e19dc11544815392b1 100644 (file)
@@ -1,6 +1,8 @@
 Could you please add numerical ordering by title to [[inline|plugins/inline]]
 plugin? Now I can do only alphabetical order by title, but sometime it's not enough.
 
+> Implemented, see [[natural_sorting]] [[!tag done]] --[[Joey]] 
+
 BTW, it seems that ordering by title is rather ordering by filename of page.
 For me "title" means title of page I can set using `title` parameter
 of [[meta|plugins/meta]] plugin :)
@@ -23,6 +25,10 @@ Do you have any idea how to workaround that issue? --[[Paweł|ptecza]]
 > Delete all files. Add files back one at a time, committing after adding
 > each file. Sort by date. --[[Joey]]
 
+>> The simplest solutions are the best :D Thanks for the hint! I didn't
+>> want to do it before, because I was affaid that my Subversion keeps
+>> old date of creation of file. --[[Paweł|ptecza]]
+
 > Maybe you can rename `9.mdwn` to `09.mdwn`? See `rename(1)`, it renames multiple files
 > in one go. --[[buo]]
 
@@ -52,10 +58,14 @@ I have also 2 considerations for inline sorting:
 
 1. Maybe changing name of `sort` parameter to `sortby` or `sortkey` will
    be good idea?
+
    > No, that would break existing wikis. --[[Joey]]
+   >> It's no problem. You just have `ikiwiki-transition` utility :D --[[Paweł|ptecza]]
+
 1. Maybe you should use `title` sort key for title from meta plugin and `name`, 
    `filename`, `page` or `pagename` for page names? In the future you can also
    sort by meta author, license or another key.
+
    > There are many places in ikiwiki that do not use meta title info and
    > could. I'd prefer to deal with that issue as a whole, not here,
    > --[[Joey]]
@@ -95,6 +105,8 @@ I have also 2 considerations for inline sorting:
 > or by date, etc. Adding a separate "sorttype" value is thus fairly
 > confusing. --[[Joey]]
 
+>> OK. I will be more careful when I play with inline plugin :) --[[Paweł|ptecza]]
+
 ---
 
 Joey, have you forgotten about that request? ;) --[[Paweł|ptecza]]
@@ -145,11 +157,11 @@ Joey, have you forgotten about that request? ;) --[[Paweł|ptecza]]
                       %config %links %pagestate %renderedfiles
                       %pagesources %destsources);
      our $VERSION = 2.00; # plugin interface version, next is ikiwiki version
-    @@ -835,6 +835,42 @@ sub titlepage ($) { #{{{
+    @@ -835,6 +835,42 @@ sub titlepage ($) {
        return $title;
-     } #}}}
+     }
      
-    +sub titlecmp ($$) { #{{{
+    +sub titlecmp ($$) {
     +  my $titleA=shift;
     +  my $titleB=shift;
     +  
@@ -183,29 +195,29 @@ Joey, have you forgotten about that request? ;) --[[Paweł|ptecza]]
     +  return -1 if (@listB);
     +  
     +  return 0;
-    +} #}}}
+    +}
     +
-     sub linkpage ($) { #{{{
+     sub linkpage ($) {
        my $link=shift;
        my $chars = defined $config{wiki_file_chars} ? $config{wiki_file_chars} : "-[:alnum:]+/.:_";
     diff --git a/IkiWiki/Plugin/brokenlinks.pm b/IkiWiki/Plugin/brokenlinks.pm
     index 37752dd..ccaa399 100644
     --- a/IkiWiki/Plugin/brokenlinks.pm
     +++ b/IkiWiki/Plugin/brokenlinks.pm
-    @@ -59,7 +59,7 @@ sub preprocess (@) { #{{{
+    @@ -59,7 +59,7 @@ sub preprocess (@) {
                        map {
                                "<li>$_</li>"
                        }
     -                  sort @broken)
     +                  sort titlecmp @broken)
                ."</ul>\n";
-     } # }}}
+     }
      
     diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm
     index 8efef3f..263e7a6 100644
     --- a/IkiWiki/Plugin/inline.pm
     +++ b/IkiWiki/Plugin/inline.pm
-    @@ -192,7 +192,7 @@ sub preprocess_inline (@) { #{{{
+    @@ -192,7 +192,7 @@ sub preprocess_inline (@) {
        }
      
        if (exists $params{sort} && $params{sort} eq 'title') {
@@ -218,20 +230,20 @@ Joey, have you forgotten about that request? ;) --[[Paweł|ptecza]]
     index b910758..10a1d87 100644
     --- a/IkiWiki/Plugin/orphans.pm
     +++ b/IkiWiki/Plugin/orphans.pm
-    @@ -56,7 +56,7 @@ sub preprocess (@) { #{{{
+    @@ -56,7 +56,7 @@ sub preprocess (@) {
                                htmllink($params{page}, $params{destpage}, $_,
                                         noimageinline => 1).
                                "</li>"
     -                  } sort @orphans).
     +                  } sort titlecmp @orphans).
                "</ul>\n";
-     } # }}}
+     }
      
     diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm
     index ceb7c84..00798e1 100644
     --- a/IkiWiki/Render.pm
     +++ b/IkiWiki/Render.pm
-    @@ -89,7 +89,7 @@ sub genpage ($$) { #{{{
+    @@ -89,7 +89,7 @@ sub genpage ($$) {
                $template->param(have_actions => 1);
        }