2/3 solution to map plugin sorting

master
chrysn 2012-03-15 21:31:51 -04:00 committed by admin
parent c877488f52
commit 02aab1da90
1 changed files with 12 additions and 0 deletions

View File

@ -38,4 +38,16 @@ I may hack one in from `inline` if it seem within my skill level.
>
> --[[chrysn]]
------
> i now do have two thirds of the solution:
>
> * i've patched the map plugin to accept a sort parameter (as usual in pagespec directives) and a strategy parameter, which is used to choose how the tree should be sorted. it turned out that the changes required were minimal; even precautions for having to display a node's parents although they are not supposed to be shown by themselves are present (they're decorated with the mapparent css class).
> * i've implemented algorithms for the described strategies, but in python -- i tried in perl, but i'm not versed well enough in perl for such things. the "force" strategy works in perl but i'm afraid it depends on more than the perl sort algorithm to be just stable.
> * if someone could port the three strategies implemented in python to perl, we'd have a complete patch for this.
>
> when comparing the implementation to my notes above, you'll see that there is a minor difference in the "force" algorithm -- my code doesn't generate the "parent" entries (**c** (c/1) a b c **a** (a/1) **c** (c/2) in the example), but they're generated by the already existing output code.
>
> the code can be found at [[incomplete_patch]] and [[python_algorithms]]. --[[chrysn]]
[[!tag wishlist]]