redef class MProject
redef fun nitdoc_name do return name.html_escape
redef fun nitdoc_id do return nitdoc_name
- redef fun nitdoc_url do return "project_{name}.html"
+ redef fun nitdoc_url do return root.nitdoc_url
redef fun mdoc do
if root != null then
end
return tpl
end
-
- redef fun tpl_css_classes do return ["public"]
end
redef class MModule
return tpl
end
- redef fun tpl_title do
- var title = new Template
- title.add tpl_icon
- title.add tpl_namespace
- return title
- end
-
redef fun tpl_css_classes do return ["public"]
end
# Clickable graphviz image using dot format
# return null if no graph for this page
- fun tpl_graph(dot: FlatBuffer, name: String, title: String): nullable TplArticle do
+ fun tpl_graph(dot: FlatBuffer, name: String, title: nullable String): nullable TplArticle do
if ctx.opt_nodot.value then return null
var output_dir = ctx.output_dir
var file = new OFStream.open("{output_dir}/{name}.dot")
var map = fmap.read_all
fmap.close
- var article = new TplArticle.with_title("graph", title)
+ var article = new TplArticle("graph")
+ if title != null then article.title = title
+ article.css_classes.add "text-center"
var content = new Template
content.add "<img src='{name}.png' usemap='#{name}' style='margin:auto' alt='{title}'/>"
content.add map
redef fun tpl_content do
tpl_sidebar_mclasses
var top = tpl_intro
- tpl_concerns(top)
tpl_inheritance(top)
+ tpl_concerns(top)
tpl_mclasses(top)
tpl_page.add_section top
end
end
end
op.append("\}\n")
- return tpl_graph(op, name, "Dependency graph")
+ return tpl_graph(op, name, null)
end
private fun sort_by_mclass(mclassdefs: Collection[MClassDef]): Map[MClass, Set[MClassDef]] do
end
private fun tpl_concerns(parent: TplSection) do
+ # intro title
+ var section = new TplSection.with_title("intro", "Introduction")
+ section.summary_title = "Introduction"
+ section.add_child tpl_mclassdef_article(mclass.intro)
+ parent.add_child section
+ # concerns
if concerns.is_empty then return
parent.add_child new TplArticle.with_content("concerns", "Concerns", concerns.to_tpl)
end
title.add "in "
title.add mentity.tpl_namespace
section.title = title
- section.summary_title = "In {mentity.nitdoc_name}"
+ section.summary_title = "in {mentity.nitdoc_name}"
# properties
var mprops = mmodules2mprops[mentity]
redef fun tpl_content do
tpl_sidebar_properties
var top = tpl_intro
- tpl_concerns(top)
tpl_inheritance(top)
+ tpl_concerns(top)
tpl_properties(top)
tpl_page.add_section top
end
end
end
op.append("\}\n")
- return tpl_graph(op, name, "Inheritance graph")
+ return tpl_graph(op, name, null)
end
end
super TplSectionElt
redef fun rendering do
- add "<section id='{id}'>"
+ add "<section id='{id}' class='{css_classes.join(" ")}'>"
if title != null then
var lvl = hlvl
- add "<h{lvl}>"
+ if lvl == 2 then title_classes.add "well well-sm"
+ add "<h{lvl} class='{title_classes.join(" ")}'>"
add title.as(not null)
add "</h{lvl}>"
end
self.content = content
end
- # CSS classes to apply on the article title heading element
- var title_classes = new Array[String]
-
redef fun render_summary(parent) do
if is_empty then return
var title = summary_title
redef fun rendering do
if is_empty then return
- add "<article id='{id}'>"
+ add "<article id='{id}' class='{css_classes.join(" ")}'>"
if title != null then
var lvl = hlvl
+ if lvl == 2 then title_classes.add "well well-sm"
add "<h{lvl} class='{title_classes.join(" ")}'>"
add title.as(not null)
add "</h{lvl}>"