+ dctx.add("<div class=\"menu\">\n")
+
+ var mods = new Array[MMModule]
+ mods = self.mhe.greaters.to_a
+ dctx.sort(mods)
+
+ dctx.open_stage
+ dctx.stage("<nav>\n")
+ dctx.stage("<h3>Module Hierarchy</h3>\n")
+ dctx.stage("<h4>All dependencies</h4>\n")
+ dctx.stage("<ul>\n")
+ for mod in mods do
+ if not mod.require_doc(dctx) then continue
+ if self.mnhe <= mod then continue # do not want nested stuff
+ if mod.direct_owner != null and not mod.direct_owner.mnhe <= self then continue # not in the right nesting
+ dctx.add("<li>{mod.html_link(dctx)}</li>")
+ end
+ dctx.stage("</ul>\n")
+
+ mods = self.mhe.smallers.to_a
+ dctx.sort(mods)
+ dctx.stage("<h4>All clients</h4>\n")
+ dctx.stage("<ul>\n")
+ for mod in mods do
+ if not mod.require_doc(dctx) then continue
+ if self.mnhe <= mod then continue # do not want nested stuff
+ if mod.direct_owner != null and not mod.direct_owner.mnhe <= self then continue # not in the right nesting
+ dctx.add("<li>{mod.html_link(dctx)}</li>")
+ end
+ dctx.stage("</ul>\n")
+ dctx.stage("</nav>\n")
+ dctx.close_stage
+
+ if not dctx.public_only then
+ mods = self.mnhe.direct_greaters.to_a
+ dctx.sort(mods)
+ dctx.open_stage
+ dctx.stage("<nav>\n")
+ dctx.stage("<h3>Nested Modules</h3><ul>\n")
+ for mod in mods do
+ if not mod.require_doc(dctx) then continue
+ dctx.add("<li>{mod.html_link(dctx)}</li>")
+ end
+ dctx.stage("</ul></nav>\n")
+ dctx.close_stage
+ end
+
+ dctx.add("</div>") # metadata
+
+ dctx.add("<div class=\"content\">\n")
+ dctx.add("<h1>{name}</h1>\n")
+ dctx.add("<div class='subtitle'>module ")
+ for m in mnhe.smallers do
+ dctx.add("{m.html_link(dctx)}::")
+ end
+ dctx.add("{self.name}</div>\n")
+
+ dctx.add("<section class='description'>\n")
+
+ var doc = doc
+ if doc != null then
+ dctx.add("<div id=\"description\">\n")
+ dctx.add("<pre>{doc.to_html}</pre>\n")
+ dctx.add("</div>\n")
+ end
+
+ var op = new Buffer
+ op.append("digraph {name} \{ rankdir=BT; node[shape=none,margin=0,width=0,height=0,fontsize=10]; edge[dir=none,color=gray]; ranksep=0.2; nodesep=0.1;\n")
+ var ms = new Array[nullable MMModule]
+ do
+ var m0: nullable MMModule = self
+ while m0 != null do
+ m0 = m0.direct_owner
+ ms.add(m0)
+ end
+ end
+ var cla = new HashSet[MMModule]
+ cla.add(self)
+ for m0 in self.mhe.greaters do
+ if not m0.require_doc(dctx) then continue
+ if self.visibility_for(m0) <= 1 then continue # private or hidden
+ if self.mnhe <= m0 then continue # do not want nested stuff
+ if m0.direct_owner != null and not m0.direct_owner.mnhe <= self then continue # not in the right nesting
+ cla.add(m0)
+ end
+ for m0 in self.mhe.smallers do
+ if not m0.require_doc(dctx) then continue
+ if m0.visibility_for(self) <= 1 then continue # private or hidden
+ if m0.direct_owner != null and not m0.direct_owner.mnhe <= self then continue # not in the right nesting
+ cla.add(m0)
+ end
+ for m0 in self.mnhe.smallers do
+ cla.add(m0)
+ end
+ ms = ms.reversed
+ for m0 in ms do
+ if m0 != null then
+ op.append("subgraph \"cluster_{m0.name}\"\{\n")
+ end
+ for c in cla do
+ if c.direct_owner != m0 then continue
+ if c == self then
+ op.append("\"{c.name}\"[shape=box,margin=0.03];\n")
+ else
+ op.append("\"{c.name}\"[URL=\"{c.html_name}.html\"];\n")
+ end
+ end
+ if m0 != null then
+ op.append("\"{m0.name}\"[URL=\"{m0.html_name}.html\"];\n")
+ for c in m0.mhe.direct_greaters do
+ if not cla.has(c) then continue
+ op.append("\"{m0.name}\"->\"{c.name}\";\n")
+ end
+ end
+ end
+ for m0 in ms do
+ # Close the nesting subgraph
+ if m0 != null then
+ op.append("\}\n")
+ end
+ end
+ for c in cla do
+ for c2 in c.tmhe.direct_greaters do
+ if not cla.has(c2) then continue
+ op.append("\"{c.name}\"->\"{c2.name}\";\n")
+ end
+ end
+ op.append("\}\n")
+ dctx.gen_dot(op.to_s, name.to_s, "Dependency graph for module {name}")
+ dctx.add("</section>")
+
+ var clas = new Array[MMLocalClass]
+ var props = new HashMap[MMGlobalProperty, Array[MMLocalProperty]]
+ var gprops = new Array[MMLocalProperty]
+ do
+ var m = self
+ for g in m.global_classes do
+ var lc = m[g]
+ if not lc.require_doc(dctx) then continue
+ var im = g.intro.mmmodule
+ if self.visibility_for(im) <= 1 then continue # private import or invisible import
+ var keep = false
+ for lc2 in lc.crhe.greaters_and_self do
+ if not lc2 isa MMSrcLocalClass then continue
+ if not self.mnhe <= lc2.mmmodule then continue # not introduced/redefined here/stolen
+ keep = true
+ end
+ if not keep then continue
+ clas.add(self[g])
+ for gp in lc.global_properties do
+ if self.visibility_for(gp.intro.local_class.mmmodule) <= 1 then continue # private import or invisible import
+ var lp = lc[gp]
+ var mp = lp.local_class.mmmodule
+ if not self.mnhe <= mp then continue # not introduced/redefined here/stolen
+ lp = self[g][gp]
+ if not lp.require_doc(dctx) then continue
+ if props.has_key(lp.global) then
+ if not props[lp.global].has(lp) then
+ props[lp.global].add(lp)
+ end
+ else
+ props[lp.global] = [lp]
+ gprops.add(lp.global.intro)
+ end
+ end
+ end
+ end
+ dctx.add("<section class=\"module\">\n")
+ dctx.open_stage
+ dctx.stage("<article class=\"classes filterable\">\n")
+ dctx.stage("<h2>Classes</h2>\n")
+ dctx.sort(clas)
+ dctx.stage("<ul>\n")
+ for lc in clas do
+ if self.mnhe <= lc.global.intro.mmmodule then
+ dctx.add("<li class='intro'><span title='introduced in this module'>I</span> ")
+ else
+ dctx.add("<li class='redef'><span title='refined in this module'>R</span> ")
+ end
+ dctx.add("{lc.html_link(dctx)}</li>\n")
+ end
+ dctx.stage("</ul></article>\n")
+ dctx.close_stage
+
+ dctx.open_stage
+ dctx.stage("<article class=\"properties filterable\">\n")
+ dctx.stage("<h2>Properties</h2>\n")
+ dctx.sort(gprops)
+ dctx.stage("<ul>\n")
+ for lgp in gprops do
+ var gp = lgp.global
+ var lps = props[gp]
+
+ if gp.intro isa MMAttribute then continue
+
+ var lpi = self[gp.intro.local_class.global][gp]
+
+ if lps.has(lpi) then
+ dctx.add("<li class='intro'><span title='introduction in an other module'>I</span> {lpi.html_open_link(dctx)}{lpi} ({lpi.local_class})</a></li>\n")
+ lps.remove(lpi)
+ else
+ dctx.add("<li class='intro'><span title='introduction in this module'>I</span> {lpi}")
+ dctx.add(" ({lpi.local_class})</li>\n")
+ end
+ if lps.length >= 1 then
+ dctx.sort(lps)
+ for lp in lps do
+ dctx.add("<li class='redef'><span title='redefinition'>R</span> {lp.html_open_link(dctx)}{lp} ({lp.local_class})</a></li>")
+ end
+ end
+ end
+ dctx.stage("</ul></article>\n")
+ dctx.close_stage
+ dctx.add("</section>\n")
+ dctx.add("</div>\n")