]> sipb.mit.edu Git - ikiwiki.git/blobdiff - doc/todo/allow_plugins_to_add_sorting_methods.mdwn
what about a SortSpec rather than a sort-hook?
[ikiwiki.git] / doc / todo / allow_plugins_to_add_sorting_methods.mdwn
index 21800f4ded3f2d4098e25b099f325aa16be3f3c1..5bfe102ac04a06596cf6e3dee48d141cde78cc79 100644 (file)
@@ -40,6 +40,8 @@ NIH'd sorting mechanisms:
   interpret `sort="x -y z(w)"` as sorting by (pseudocode)
   `{ $cmp_x->($a, $b) || (-$cmp_y->($a, $b)) || $cmp_z->($a, $b, "w") }`?
 
+>> I wonder if IkiWiki would benefit from the concept of a "sortspec", like a [[ikiwiki/PageSpec]] but dedicated to sorting lists of pages rather than defining lists of pages?  Rather than defining a sort-hook, define a SortSpec class, and enable people to add their own sort methods as functions defined inside that class, similarly to the way they can add their own pagespec definitions. --[[KathrynAndersen]]
+
 ## Documentation extracted from the branch
 
 ### sort hook (added to [[plugins/write]])