tpl.title = "Index"
# modules list
for mmodule in modules_list(v, doc) do
- tpl.modules.add mmodule.tpl_link
+ tpl.modules.add mmodule.html_link
end
# classes list
for mclass in classes_list(v, doc) do
- tpl.classes.add mclass.tpl_link
+ tpl.classes.add mclass.html_link
end
# properties list
for mproperty in mprops_list(v, doc) do
var m = new Template
- m.add mproperty.intro.tpl_link
+ m.add mproperty.intro.html_link
m.add " ("
- m.add mproperty.intro.mclassdef.mclass.tpl_link
+ m.add mproperty.intro.mclassdef.mclass.html_link
m.add ")"
tpl.props.add m
end
end
var lnk = new Template
lnk.add new TplLabel.with_classes(classes)
- lnk.add def.tpl_link
+ lnk.add def.html_link
return new TplListItem.with_content(lnk)
end
end
end
var lnk = new Template
lnk.add new TplLabel.with_classes(classes)
- lnk.add def.tpl_link
+ lnk.add def.html_link
return new TplListItem.with_content(lnk)
end
end
title.add mprop.tpl_icon
title.add "<span id='{mpropdef.nitdoc_id}'></span>"
if mpropdef.is_intro then
- title.add mprop.tpl_link
+ title.add mprop.html_link
title.add mprop.intro.tpl_signature
else
var cls_url = mprop.intro.mclassdef.mclass.nitdoc_url
import doc_base
import doc_down
import html_components
+import html::bootstrap
import ordered_tree
redef class Location
# * MPropdef: `foo(e)`
var html_name: String is lazy do return name.html_escape
- # A template link to the mentity `nitdoc_id`
- fun tpl_anchor: TplLink do
- var tpl = new TplLink("#{nitdoc_id}", html_name)
+ # Returns a Link to the mentity `html_url`.
+ #
+ # Example: `<a href="html_url" title="mdoc.short_comment">html_short_name</a>
+ var html_link: Link is lazy do
+ var tpl = new Link(nitdoc_url, html_name)
var mdoc = mdoc_or_fallback
if mdoc != null then
tpl.title = mdoc.short_comment
return tpl
end
- # A template link to the mentity `nitdoc_url`
- fun tpl_link: TplLink do
- var tpl = new TplLink(nitdoc_url, html_name)
+ # A template link to the mentity `nitdoc_id`
+ fun tpl_anchor: TplLink do
+ var tpl = new TplLink("#{nitdoc_id}", html_name)
var mdoc = mdoc_or_fallback
if mdoc != null then
tpl.title = mdoc.short_comment
fun tpl_list_item: TplListItem do
var lnk = new Template
lnk.add new TplLabel.with_classes(tpl_css_classes)
- lnk.add tpl_link
+ lnk.add html_link
var mdoc = mdoc_or_fallback
if mdoc != null then
lnk.add ": "
redef fun tpl_declaration do
var tpl = new Template
tpl.add "<span>project "
- tpl.add tpl_link
+ tpl.add html_link
tpl.add "</span>"
return tpl
end
- redef fun tpl_namespace do return tpl_link
+ redef fun tpl_namespace do return html_link
redef fun tpl_definition do
var tpl = new TplDefinition
tpl.add mproject.tpl_namespace
if mproject.root != self then
tpl.add "::"
- tpl.add tpl_link
+ tpl.add html_link
end
return tpl
end
redef fun tpl_declaration do
var tpl = new Template
tpl.add "<span>group "
- tpl.add tpl_link
+ tpl.add html_link
tpl.add "</span>"
return tpl
end
tpl.add mgroup.tpl_namespace
tpl.add "::"
end
- tpl.add tpl_link
+ tpl.add html_link
return tpl
end
var tpl = new Template
tpl.add intro_mmodule.mgroup.mproject.tpl_namespace
tpl.add "::<span>"
- tpl.add tpl_link
+ tpl.add html_link
tpl.add "</span>"
return tpl
end
redef fun tpl_title do
var title = new Template
title.add tpl_icon
- title.add tpl_link
+ title.add html_link
return title
end
var tpl = new Template
tpl.add mmodule.tpl_namespace
tpl.add "::<span>"
- tpl.add mclass.tpl_link
+ tpl.add mclass.html_link
tpl.add "</span>"
return tpl
end
redef fun tpl_title do
var title = new Template
title.add tpl_icon
- title.add tpl_link
+ title.add html_link
return title
end
redef fun tpl_declaration do
var tpl = new Template
tpl.add tpl_modifiers
- tpl.add tpl_link
+ tpl.add html_link
tpl.add tpl_signature
return tpl
end
var tpl = new Template
tpl.add intro_mclassdef.mclass.tpl_namespace
tpl.add "::<span>"
- tpl.add intro.tpl_link
+ tpl.add intro.html_link
tpl.add "</span>"
return tpl
end
var tpl = new Template
tpl.add mclassdef.tpl_namespace
tpl.add "::"
- tpl.add tpl_link
+ tpl.add html_link
return tpl
end
tpl.summary_title = "in {mclassdef.html_name}"
var title = new Template
title.add "in "
- title.add mclassdef.tpl_link
+ title.add mclassdef.html_link
tpl.title = title
tpl.subtitle = tpl_declaration
var mdoc = mdoc_or_fallback
redef fun tpl_declaration do
var tpl = new Template
tpl.add tpl_modifiers
- tpl.add tpl_link
+ tpl.add html_link
tpl.add tpl_signature
return tpl
end
redef fun tpl_list_item do
var lnk = new Template
lnk.add new TplLabel.with_classes(tpl_css_classes.to_a)
- var anchor = tpl_link
- anchor.href = "{mclassdef.mclass.nitdoc_url}#{mproperty.nitdoc_id}"
+ var atext = html_link.text
+ var ahref = "{mclassdef.mclass.nitdoc_url}#{mproperty.nitdoc_id}"
+ var atitle = html_link.title
+ var anchor = new Link.with_title(ahref, atext, atitle)
lnk.add anchor
var mdoc = mdoc_or_fallback
if mdoc != null then
lnk.add new TplLabel.with_classes(tpl_css_classes.to_a)
lnk.add mclassdef.mmodule.tpl_namespace
lnk.add "::"
- var anchor = mclassdef.tpl_link
- anchor.href = "{mclassdef.mclass.nitdoc_url}#{mproperty.nitdoc_id}"
+ var atext = mclassdef.html_link.text
+ var ahref = "{mclassdef.mclass.nitdoc_url}#{mproperty.nitdoc_id}"
+ var atitle = mclassdef.html_link.title
+ var anchor = new Link.with_title(ahref, atext, atitle)
lnk.add anchor
var mdoc = mdoc_or_fallback
if mdoc != null then
end
redef class MVirtualTypeProp
- redef fun tpl_link do return mvirtualtype.tpl_link
- redef fun tpl_signature do return tpl_link
+ redef fun html_link do return mvirtualtype.html_link
+ redef fun tpl_signature do return html_link
end
redef class MVirtualTypeDef
end
redef class MClassType
- redef fun tpl_link do return mclass.tpl_link
- redef fun tpl_signature do return tpl_link
+ redef fun html_link do return mclass.html_link
+ redef fun tpl_signature do return html_link
end
redef class MNullableType
redef class MGenericType
redef fun tpl_signature do
+ var lnk = html_link
var tpl = new Template
- var lnk = tpl_link
- lnk.text = mclass.name.html_escape
- tpl.add lnk
+ tpl.add new Link.with_title(lnk.href, mclass.name.html_escape, lnk.title)
tpl.add "["
for i in [0..arguments.length[ do
tpl.add arguments[i].tpl_signature
end
redef class MParameterType
- redef fun tpl_link do
- return new TplLink.with_title("{mclass.nitdoc_url}#FT_{name.to_cmangle}", name, "formal type")
+ redef fun html_link do
+ return new Link.with_title("{mclass.nitdoc_url}#FT_{name.to_cmangle}", name, "formal type")
end
- redef fun tpl_signature do return tpl_link
+ redef fun tpl_signature do return html_link
end
redef class MVirtualType
- redef fun tpl_link do return mproperty.intro.tpl_link
- redef fun tpl_signature do return tpl_link
+ redef fun html_link do return mproperty.intro.html_link
+ redef fun tpl_signature do return html_link
end
redef class MSignature
for part in parts do
if part.target != null then
- tpl.add part.target.as(not null).tpl_link
+ tpl.add part.target.as(not null).html_link
else
tpl.add part.text.html_escape
end
redef fun nitdoc_url do return inner.nitdoc_url
redef fun tpl_anchor do return inner.tpl_anchor
- redef fun tpl_link do return inner.tpl_link
+ redef fun html_link do return inner.html_link
redef fun tpl_signature do return inner.tpl_signature
redef fun tpl_definition do