]> sipb.mit.edu Git - ikiwiki.git/commitdiff
2/3 solution to map plugin sorting
authorchrysn <chrysn@web>
Fri, 16 Mar 2012 01:31:51 +0000 (21:31 -0400)
committeradmin <admin@branchable.com>
Fri, 16 Mar 2012 01:31:51 +0000 (21:31 -0400)
doc/todo/sort_parameter_for_map_plugin_and_directive.mdwn

index 3b4ec73ea14891931dd0563cc0587112605eb819..0ef8be97f28a526f62e9fbda4430830419970561 100644 (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]]