# Build the dependencies tab
fun build_dependencies(doc: DocModel) do
var summary = new CardSummary
var model = doc.model
var mainmodule = doc.mainmodule
var filter = doc.filter
if not doc.no_dot then
var gq = new CmdInheritanceGraph(model, mainmodule, filter, mentity)
gq.init_command
var graph = gq.graph
if graph != null then
graph.draw(2, 2)
dep_tab.content.add new CardGraph(mentity, graph)
end
end
# No inheritance lists for `Object`
if mentity isa MClass and mentity.name == "Object" then return
var inh = new HashMap[String, CmdEntityList]
inh["Ancestors"] = new CmdAncestors(model, mainmodule, filter, mentity, parents = false)
inh["Parents"] = new CmdParents(model, mainmodule, filter, mentity)
inh["Children"] = new CmdChildren(model, mainmodule, filter, mentity)
inh["Descendants"] = new CmdDescendants(model, mainmodule, filter, mentity, children = false)
for title, cmd in inh do
cmd.init_command
var results = cmd.results
if results == null or results.is_empty then continue
var section = new CardSection(3, title)
dep_tab.content.add section
summary.cards.add section
var list = new CardList("inh", "Inheritance")
for mentity in results do
var card = new CardMEntity(mentity)
list.cards.add card
summary.cards.add card
end
dep_tab.content.add list
end
if summary.cards.not_empty then
dep_tab.sidebar.cards.add summary
end
end
src/doc/static/static_structure.nit:114,2--161,4