]> sipb.mit.edu Git - ikiwiki.git/blobdiff - doc/todo/sort_parameter_for_map_plugin_and_directive.mdwn
how sorting on maps might work
[ikiwiki.git] / doc / todo / sort_parameter_for_map_plugin_and_directive.mdwn
index 3ecc6a241e336e7ee091a910e678d71e1eed914c..3b4ec73ea14891931dd0563cc0587112605eb819 100644 (file)
@@ -3,3 +3,39 @@
 Having a `sort=` parameter for the map plugin/directive would be real nice; like `inline`'s parameter, with `age`, `title`, etc.
 
 I may hack one in from `inline` if it seem within my skill level.
+
+> this could leverage the [[sorting mechanism|ikiwiki/pagespec/sorting]] already in place. as it's not sorting a flat list, there's a number of different ways to sort, which should be configurable imo.
+>
+> as an example, i'll consider pages created in the sequence c/1, a, b, c, a/1, c/2.
+>
+> sorting could:
+>
+> * sort within each level:
+>
+>   sorting order of child nodes would only matter internally in the groups
+>
+>   that would create a (a/1) b c (c/1 c/2) sequence in our example.
+>
+> * sort by maximum
+>
+>   the highest ranking page in a group would pull the parent to its own position
+>
+>   that would create b a (a/1) c (c/1 c/2).
+>
+> * sort by minimum
+>
+>   the lowest ranking page in a group would pull the parent to its own position
+>
+>   here, that would give c (c/1 c/2) a (a/1) b
+>
+> * forced sequence
+>
+>   all deepest-level items are forced to their positions, even if that means their parents are repeated at positions where they wouldn't occur naturally. parent nodes that don't have child nodes that occur directly before or after them are shown without the child nodes.
+>
+>   that'd be c (c/1) a b c a (a/1) c (c/2) in our example.
+>
+>   admittedly, the use cases for that are not too obvious, but think of a travel diary, for example, where you'd have the entries chronologically but grouped by the country you've visited. when you visit the same country twice, it should show up twice too.
+>
+> --[[chrysn]]
+
+[[!tag wishlist]]