# Does `self` have `children`?
fun is_empty: Bool do return children.is_empty
+ # Title used in table of content if any.
+ var toc_title: nullable String is writable, lazy do return title
+
# Add a `child` to `self`.
#
# Shortcut for `children.add`.
title.add mentity.html_signature
html_title = title
html_subtitle = mentity.html_namespace
- toc_title = mentity.html_name
+ html_toc_title = mentity.html_name
end
super
end
var mentity = self.mentity
if page isa MGroupPage then
html_title = null
- toc_title = mentity.html_name
+ html_toc_title = mentity.html_name
is_toc_hidden = false
else if page.mentity isa MModule and mentity isa MModule then
var title = new Template
if mentity == page.mentity then
title.add "in "
- toc_title = "in {mentity.html_name}"
+ html_toc_title = "in {mentity.html_name}"
else
title.add "from "
- toc_title = "from {mentity.html_name}"
+ html_toc_title = "from {mentity.html_name}"
end
title.add mentity.html_namespace
html_title = title
title.add "in "
title.add mentity.html_namespace
html_title = title
- toc_title = "in {mentity.html_name}"
+ html_toc_title = "in {mentity.html_name}"
end
super
end
title.add mentity.html_icon
title.add mentity.html_namespace
html_title = title
- toc_title = mentity.html_name
+ html_toc_title = mentity.html_name
if mentity isa MModule then
html_source_link = v.html_source_link(mentity.location)
end
title.add mentity.mmodule.html_namespace
html_title = mentity.html_declaration
html_subtitle = title
- toc_title = "in {mentity.html_name}"
+ html_toc_title = "in {mentity.html_name}"
html_source_link = v.html_source_link(mentity.location)
if page isa MEntityPage and mentity.is_intro and mentity.mmodule != page.mentity then
is_short_comment = true
title.add mentity.html_declaration
html_title = title
html_subtitle = mentity.html_namespace
- toc_title = mentity.html_name
+ html_toc_title = mentity.html_name
else
var title = new Template
title.add "in "
title.add mentity.mclassdef.html_link
html_title = title
- toc_title = "in {mentity.mclassdef.html_name}"
+ html_toc_title = "in {mentity.mclassdef.html_name}"
end
html_source_link = v.html_source_link(mentity.location)
end
redef fun init_html_render(v, doc, page) do
if v.ctx.opt_custom_title.value != null then
self.html_title = v.ctx.opt_custom_title.value.to_s
- self.toc_title = v.ctx.opt_custom_title.value.to_s
+ self.html_toc_title = v.ctx.opt_custom_title.value.to_s
end
self.content = v.ctx.opt_custom_intro.value
super
# The linearized list to display.
var mentities: Array[MEntity]
+
+ redef var toc_title = "Linearization"
end
# 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
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 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
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 GraphArticle
redef var html_title = null
- redef var toc_title do return "Graph"
redef var is_hidden = false
redef var is_toc_hidden = true