From: Stefan Lage Date: Thu, 4 Jul 2013 18:39:18 +0000 (-0400) Subject: ni_nitdoc: Sort concerns modules in class pages X-Git-Tag: v0.6.1~73^2~5^2~72^2~1 X-Git-Url: http://nitlanguage.org ni_nitdoc: Sort concerns modules in class pages Signed-off-by: Stefan Lage --- diff --git a/src/ni_nitdoc.nit b/src/ni_nitdoc.nit index 2db5723..dfae10f 100644 --- a/src/ni_nitdoc.nit +++ b/src/ni_nitdoc.nit @@ -840,6 +840,10 @@ class NitdocMClasses end fun content do + var sorted = new Array[MModule] + sorted.add_all(mclass.concerns.keys) + var sorterp = new ComparableSorter[MModule] + sorterp.sort(sorted) var subtitle = "" var lmmodule = new List[MModule] # Insert the subtitle part @@ -857,12 +861,18 @@ class NitdocMClasses open("section").add_class("concerns") add("h2").add_class("section-header").text("Concerns") open("ul") - for owner, childs in mclass.concerns do + for owner in sorted do + var childs = mclass.concerns[owner] open("li") add_html("{owner.name}: {owner.amodule.short_comment}") if not childs is null then open("ul") - for child in childs.as(not null) do add_html("
  • {child.name}: {child.amodule.short_comment}
  • ") + var sortedc = childs.to_a + var sorterpc = new ComparableSorter[MModule] + sorterpc.sort(sortedc) + for child in sortedc.as(not null) do + add_html("
  • {child.name}: {child.amodule.short_comment}
  • ") + end close("ul") end close("li")