+ redef fun menu do
+ super
+ append("<li><a href='index.html'>Overview</a></li>")
+ var public_owner = mclass.public_owner
+ if public_owner == null then
+ append("<li>")
+ mclass.intro_mmodule.html_link(self)
+ append("</li>")
+ else
+ append("<li>")
+ public_owner.html_link(self)
+ append("</li>")
+ end
+ append("<li class='current'>{mclass.html_name}</li>")
+ append("<li><a href='search.html'>Search</a></li>")
+ end
+
+ redef fun content do
+ append("<div class='sidebar'>")
+ properties_column
+ inheritance_column
+ append("</div>")
+ append("<div class='content'>")
+ class_doc
+ append("</div>")
+ end
+
+ private fun properties_column do
+ var sorter = new MPropDefNameSorter
+ append("<nav class='properties filterable'>")
+ append("<h3>Properties</h3>")
+ # virtual types
+ if vtypes.length > 0 then
+ var vts = new Array[MVirtualTypeDef]
+ vts.add_all(vtypes)
+ sorter.sort(vts)
+ append("<h4>Virtual Types</h4>")
+ append("<ul>")
+ for mprop in vts do
+ mprop.html_sidebar_item(self)
+ end
+ append("</ul>")
+ end
+ # constructors
+ if consts.length > 0 then
+ var cts = new Array[MMethodDef]
+ cts.add_all(consts)
+ sorter.sort(cts)
+ append("<h4>Constructors</h4>")
+ append("<ul>")
+ for mprop in cts do
+ if mprop.mproperty.name == "init" and mprop.mclassdef.mclass != mclass then continue
+ mprop.html_sidebar_item(self)
+ end
+ append("</ul>")
+ end
+ # methods
+ if meths.length > 0 then
+ var mts = new Array[MMethodDef]
+ mts.add_all(meths)
+ sorter.sort(mts)
+ append("<h4>Methods</h4>")
+ append("<ul>")
+ for mprop in mts do
+ mprop.html_sidebar_item(self)
+ end
+ append("</ul>")
+ end
+ append("</nav>")
+ end
+
+ private fun inheritance_column do
+ var sorted = new Array[MClass]
+ var sorterp = new MClassNameSorter
+ append("<nav>")
+ append("<h3>Inheritance</h3>")
+ var greaters = mclass.in_hierarchy(ctx.mainmodule).greaters.to_a
+ if greaters.length > 1 then
+ ctx.mainmodule.linearize_mclasses(greaters)
+ append("<h4>Superclasses</h4>")
+ append("<ul>")
+ for sup in greaters do
+ if sup == mclass then continue
+ append("<li>")
+ sup.html_link(self)
+ append("</li>")
+ end
+ append("</ul>")
+ end
+ var smallers = mclass.in_hierarchy(ctx.mainmodule).smallers.to_a
+ var direct_smallers = mclass.in_hierarchy(ctx.mainmodule).direct_smallers.to_a
+ if smallers.length <= 1 then
+ append("<h4>No Known Subclasses</h4>")
+ else if smallers.length <= 100 then
+ ctx.mainmodule.linearize_mclasses(smallers)
+ append("<h4>Subclasses</h4>")
+ append("<ul>")
+ for sub in smallers do
+ if sub == mclass then continue
+ append("<li>")
+ sub.html_link(self)
+ append("</li>")
+ end
+ append("</ul>")
+ else if direct_smallers.length <= 100 then
+ ctx.mainmodule.linearize_mclasses(direct_smallers)
+ append("<h4>Direct Subclasses Only</h4>")
+ append("<ul>")
+ for sub in direct_smallers do
+ if sub == mclass then continue
+ append("<li>")
+ sub.html_link(self)
+ append("</li>")
+ end
+ append("</ul>")
+ else
+ append("<h4>Too much Subclasses to list</h4>")
+ end
+ append("</nav>")
+ end
+
+ private fun class_doc do
+ # title
+ append("<h1>{mclass.html_name}{mclass.html_short_signature}</h1>")
+ append("<div class='subtitle info'>")
+ if mclass.visibility < public_visibility then append("{mclass.visibility.to_s} ")
+ append("{mclass.kind.to_s} ")
+ mclass.html_namespace(self)
+ append("{mclass.html_short_signature}</div>")
+ # comment
+ mclass.html_comment(self)
+ process_generate_dot
+ # concerns
+ var concern2meths = new ArrayMap[MModule, Array[MMethodDef]]
+ var sorted_meths = new Array[MMethodDef]
+ var sorted = new Array[MModule]
+ sorted_meths.add_all(meths)
+ ctx.mainmodule.linearize_mpropdefs(sorted_meths)
+ for meth in meths do
+ if inherited.has(meth) then continue
+ var mmodule = meth.mclassdef.mmodule
+ if not concern2meths.has_key(mmodule) then
+ sorted.add(mmodule)
+ concern2meths[mmodule] = new Array[MMethodDef]
+ end
+ concern2meths[mmodule].add(meth)
+ end
+ var sections = new ArrayMap[MModule, Array[MModule]]
+ for mmodule in concern2meths.keys do
+ var owner = mmodule.public_owner
+ if owner == null then owner = mmodule
+ if not sections.has_key(owner) then sections[owner] = new Array[MModule]
+ if owner != mmodule then sections[owner].add(mmodule)
+ end
+ append("<section class='concerns'>")
+ append("<h2 class='section-header'>Concerns</h2>")
+ append("<ul>")
+ for owner, mmodules in sections do
+ var nowner = ctx.mbuilder.mmodule2nmodule[owner]
+ append("<li>")
+ if nowner.short_comment.is_empty then
+ append("<a href=\"#{owner.anchor}\">{owner.html_name}</a>")
+ else
+ append("<a href=\"#{owner.anchor}\">{owner.html_name}</a>: {nowner.short_comment}")
+ end
+ if not mmodules.is_empty then
+ append("<ul>")
+ for mmodule in mmodules do
+ var nmodule = ctx.mbuilder.mmodule2nmodule[mmodule]
+ if nmodule.short_comment.is_empty then
+ append("<li><a href=\"#{mmodule.anchor}\">{mmodule.html_name}</a></li>")
+ else
+ append("<li><a href=\"#{mmodule.anchor}\">{mmodule.html_name}</a>: {nmodule.short_comment}</li>")