# Level <hX> for HTML heading.
private fun hlvl: Int do return depth
- # Is `self` not displayed in the page.
- #
- # By default, empty elements are hidden.
- fun is_hidden: Bool do return is_empty
-
# A short, undecorated title that goes in the table of contents.
#
# By default, returns `html_title.to_s`, subclasses should redefine it.
- var toc_title: String is lazy, writable do return html_title.to_s
+ var html_toc_title: nullable String is lazy, writable do
+ if html_title == null then return toc_title
+ return html_title.write_to_string
+ end
# Is `self` hidden in the table of content?
var is_toc_hidden = false is writable
if is_toc_hidden then return
var content = new Template
- content.add new Link("#{html_id}", toc_title)
-
+ content.add new Link("#{html_id}", html_toc_title.to_s)
if not children.is_empty then
var sublst = new UnorderedList
sublst.css_classes.add "nav"
var tabs = new DocTabs("{html_id}.tabs", "")
for child in children do
if child.is_hidden then continue
- tabs.add_panel new DocTabPanel(child.html_tab_id, child.toc_title, child)
+ var title = child.html_toc_title or else child.toc_title or else ""
+ tabs.add_panel new DocTabPanel(child.html_tab_id, title, child)
end
addn tabs
end
redef class IndexArticle
redef var html_title = "Index"
- redef fun is_empty do
- return mmodules.is_empty and mclasses.is_empty and mprops.is_empty
- end
redef fun render_body do
addn "<div class='container-fluid'>"
redef class ConstructorsSection
redef var html_title = "Constructors"
redef var html_subtitle = null
- redef fun is_toc_hidden do return is_empty
+ redef fun is_toc_hidden do return is_hidden
end
redef class ConcernSection
redef var html_title is lazy do return "in {mentity.nitdoc_name}"
- redef fun is_toc_hidden do return is_empty
+ redef fun is_toc_hidden do return is_hidden
end
redef class ImportationListSection
redef class IntroArticle
redef var html_title = null
- redef var is_hidden = false
redef var is_toc_hidden = true
# Link to source to display if any.
end
for child in children do
if child.is_hidden then continue
- tabs.add_panel new DocTabPanel(child.html_tab_id, child.toc_title, child)
+ var title = child.html_toc_title or else child.toc_title or else ""
+ tabs.add_panel new DocTabPanel(child.html_tab_id, title, child)
end
var lnk = html_source_link
if lnk != null then
redef class ConcernsArticle
redef var html_title = "Concerns"
- redef fun is_hidden do return concerns.is_empty
redef fun render_body do add concerns.html_list
end
end
redef var html_subtitle is lazy do return mentity.html_namespace
- redef var toc_title is lazy do return mentity.html_name
+ redef var html_toc_title is lazy do return mentity.html_name
end
redef class DefinitionArticle
redef var html_title is lazy do return mentity.html_name
redef var html_subtitle is lazy do return mentity.html_declaration
- redef var is_hidden = false
# Does `self` display only it's title and no body?
#
end
for child in children do
if child.is_hidden then continue
- tabs.add_panel new DocTabPanel(child.html_tab_id, child.toc_title, child)
+ var title = child.html_toc_title or else child.toc_title or else ""
+ tabs.add_panel new DocTabPanel(child.html_tab_id, title, child)
end
var lnk = html_source_link
if lnk != null then
end
redef class HierarchyListArticle
- redef fun is_empty do return mentities.is_empty
redef var is_toc_hidden = true
redef fun render_body do
end
redef class IntrosRedefsListArticle
- redef fun is_hidden do return mentities.is_empty
redef var is_toc_hidden = true
redef fun render_body do
redef class DefinitionLinArticle
redef var html_title is lazy do return "Linearization"
- redef fun is_hidden do return mentities.is_empty
redef var is_toc_hidden = true
redef fun render_body do
redef class GraphArticle
redef var html_title = null
- redef var toc_title do return "Graph"
- redef var is_hidden = false
redef var is_toc_hidden = true
# HTML map used to display link.