nitdoc: replace `article:` prefix id by `.article` suffix
[nit.git] / src / doc / doc_phases / doc_hierarchies.nit
index 39ad273..487f411 100644 (file)
@@ -26,7 +26,7 @@ class InheritanceListsPhase
        var name_sorter = new MEntityNameSorter
 
        redef fun apply do
-               for page in doc.pages do
+               for page in doc.pages.values do
                        if page isa MEntityPage then page.build_inh_list(self, doc)
                end
        end
@@ -40,45 +40,53 @@ end
 
 redef class MModulePage
        redef fun build_inh_list(v, doc) do
-               var section = new ImportationListSection(mentity)
+               var id = mentity.nitdoc_id
+               var section = new ImportationListSection("{id}.importation", mentity)
+               var group = new PanelGroup("group:list", "List")
                var imports = self.imports.to_a
                v.name_sorter.sort(imports)
-               section.add_child new HierarchyListArticle(mentity, "Imports", imports)
+               group.add_child new HierarchyListArticle("{id}.imports", mentity, "Imports", imports)
                var clients = self.clients.to_a
                v.name_sorter.sort(clients)
-               section.add_child new HierarchyListArticle(mentity, "Clients", clients)
-               root.children.insert(section, 1)
+               group.add_child new HierarchyListArticle("{id}.clients", mentity, "Clients", clients)
+               section.add_child group
+               section.parent = root.children.first
+               root.children.first.children.insert(section, 1)
        end
 end
 
 redef class MClassPage
        redef fun build_inh_list(v, doc) do
-               var section = new InheritanceListSection(mentity)
+               var id = mentity.nitdoc_id
+               var section = new InheritanceListSection("{id}.inheritance", mentity)
+               var group = new PanelGroup("group:list", "List")
                var parents = self.parents.to_a
                v.name_sorter.sort(parents)
-               section.add_child new HierarchyListArticle(mentity, "Parents", parents)
+               group.add_child new HierarchyListArticle("{id}.parents", mentity, "Parents", parents)
                var ancestors = self.ancestors.to_a
                v.name_sorter.sort(ancestors)
-               section.add_child new HierarchyListArticle(mentity, "Ancestors", ancestors)
+               group.add_child new HierarchyListArticle("{id}.ancestors", mentity, "Ancestors", ancestors)
                var children = self.children.to_a
                v.name_sorter.sort(children)
-               section.add_child new HierarchyListArticle(mentity, "Children", children)
+               group.add_child new HierarchyListArticle("{id}.children", mentity, "Children", children)
                var descendants = self.descendants.to_a
                v.name_sorter.sort(descendants)
-               section.add_child new HierarchyListArticle(mentity, "Descendants", descendants)
-               root.children.insert(section, 1)
+               group.add_child new HierarchyListArticle("{id}.descendants", mentity, "Descendants", descendants)
+               section.add_child group
+               section.parent = root.children.first
+               root.children.first.children.insert(section, 1)
        end
 end
 
 # FIXME diff hack
 class ImportationListSection
-       super DocSection
+       super TabbedGroup
        super MEntityComposite
 end
 
 # FIXME diff hack
 class InheritanceListSection
-       super DocSection
+       super TabbedGroup
        super MEntityComposite
 end