how sorting on maps might work

master
chrysn 2012-03-15 17:29:51 -04:00 committed by admin
parent dc2d560bba
commit 4ecf1c3fb8
1 changed files with 34 additions and 0 deletions

View File

@ -4,4 +4,38 @@ Having a `sort=` parameter for the map plugin/directive would be real nice; like
I may hack one in from `inline` if it seem within my skill level. 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]] [[!tag wishlist]]