private var ctx: NitdocContext
private var model: Model
+ private var name_sorter = new MEntityNameSorter
init(ctx: NitdocContext) do
self.ctx = ctx
if mmodule.name == "<main>" then continue
sorted.add mmodule
end
- var sorter = new MModuleNameSorter
- sorter.sort(sorted)
+ name_sorter.sort(sorted)
return sorted
end
if mclass.visibility < ctx.min_visibility then continue
sorted.add mclass
end
- var sorter = new MClassNameSorter
- sorter.sort(sorted)
+ name_sorter.sort(sorted)
return sorted
end
if mproperty isa MAttribute then continue
sorted.add mproperty
end
- var sorter = new MPropertyNameSorter
- sorter.sort(sorted)
+ name_sorter.sort(sorted)
return sorted
end
end
if clients.length > 10 then clients = mmodule.in_importation.direct_smallers
# Display lists
- var sorter = new MModuleNameSorter
var section = new TplSection.with_title("inheritance", "Inheritance")
# Graph
# nested modules
if not nested.is_empty then
var lst = nested.to_a
- sorter.sort lst
+ name_sorter.sort lst
section.add_child tpl_list("nesting", "Nested modules", lst)
end
lst.add(dep)
end
if not lst.is_empty then
- sorter.sort lst
+ name_sorter.sort lst
section.add_child tpl_list("imports", "Imports", lst)
end
lst.add(dep)
end
if not lst.is_empty then
- sorter.sort lst
+ name_sorter.sort lst
section.add_child tpl_list("clients", "Clients", lst)
end
end
private fun tpl_mclasses(parent: TplSection) do
- var sorter = new MClassNameSorter
var mclassdefs = new HashSet[MClassDef]
mclassdefs.add_all mmodule.in_nesting_intro_mclassdefs(ctx.min_visibility)
mclassdefs.add_all mmodule.in_nesting_redef_mclassdefs(ctx.min_visibility)
var mclasses2mdefs = sort_by_mclass(mclassdefs)
var sorted_mclasses = mclasses2mdefs.keys.to_a
- sorter.sort sorted_mclasses
+ name_sorter.sort sorted_mclasses
# intros
var section = new TplSection.with_title("intros", "Introductions")
var intros = mmodule.in_nesting_intro_mclasses(ctx.min_visibility)
var sorted_intros = intros.to_a
- sorter.sort(sorted_intros)
+ name_sorter.sort(sorted_intros)
for mclass in sorted_intros do
if not mclasses2mdefs.has_key(mclass) then continue
section.add_child tpl_mclass_article(mclass, mclasses2mdefs[mclass].to_a)
# redefs
section = new TplSection.with_title("redefs", "Refinements")
var redefs = mmodule.in_nesting_redef_mclasses(ctx.min_visibility).to_a
- sorter.sort(redefs)
+ name_sorter.sort(redefs)
for mclass in redefs do
if intros.has(mclass) then continue
if not mclasses2mdefs.has_key(mclass) then continue
tpl_sidebar.boxes.add new TplSideBox.with_content("All properties", summary)
end
- var mprop_sorter = new MPropertyNameSorter
-
private fun tpl_sidebar_list(name: String, mprops: Array[MProperty], summary: TplList) do
if mprops.is_empty then return
- mprop_sorter.sort(mprops)
+ name_sorter.sort(mprops)
var entry = new TplListItem.with_content(name)
var list = new TplList.with_classes(["list-unstyled", "list-labeled"])
for mprop in mprops do
if not owners.is_empty then
var article = new TplArticle.with_title("concerns", "Concerns")
- var module_sorter = new MModuleNameSorter
- module_sorter.sort owners
+ name_sorter.sort owners
var list = new TplList.with_classes(["list-unstyled", "list-definition"])
for owner in owners do
var li = new Template
var smmodules = owner_map[owner].to_a
#if not smmodules.length >= 1 then
var slist = new TplList.with_classes(["list-unstyled", "list-definition"])
- module_sorter.sort smmodules
+ name_sorter.sort smmodules
for mmodule in smmodules do
if mmodule == owner then continue
var sli = new Template
end
# Display lists
- var sorter = new MClassNameSorter
var section = new TplSection.with_title("inheritance", "Inheritance")
# Graph
# parents
if not hparents.is_empty then
var lst = hparents.to_a
- sorter.sort lst
+ name_sorter.sort lst
section.add_child tpl_list("parents", "Parents", lst)
end
# ancestors
if not hancestors.is_empty then
var lst = hancestors.to_a
- sorter.sort lst
+ name_sorter.sort lst
section.add_child tpl_list("ancestors", "Ancestors", lst)
end
# children
if not hchildren.is_empty and hchildren.length < 15 then
var lst = hchildren.to_a
- sorter.sort lst
+ name_sorter.sort lst
section.add_child tpl_list("children", "Children", lst)
end
# descendants
if not hdescendants.is_empty and hchildren.length < 15 then
var lst = hdescendants.to_a
- sorter.sort lst
+ name_sorter.sort lst
section.add_child tpl_list("descendants", "Descendants", lst)
end
for mmodule in owner_map[owner] do
# properties
var mprops = mod_map[mmodule]
- var sorter = new MPropertyNameSorter
var kind_map = sort_by_kind(mprops)
# virtual types
var elts = kind_map["type"].to_a
- sorter.sort(elts)
+ name_sorter.sort(elts)
for elt in elts do
var defs = mprops2mdefs[elt].to_a
section.add_child tpl_mprop_article(elt, defs)
# constructors
elts = kind_map["init"].to_a
- sorter.sort(elts)
+ name_sorter.sort(elts)
for elt in elts do
var defs = mprops2mdefs[elt].to_a
section.add_child tpl_mprop_article(elt, defs)
# methods
elts = kind_map["fun"].to_a
- sorter.sort(elts)
+ name_sorter.sort(elts)
for elt in elts do
var defs = mprops2mdefs[elt].to_a
section.add_child tpl_mprop_article(elt, defs)