# It is used to refer to some specific entities when generating links.
# If `null` is returned, then no link are generated and `<a>` elements become `<span>`.
#
- # Clients are encouraged to redefine the method in a subclass to control where entities should link to.
- fun hrefto(entitiy: MEntity): nullable String
- do
- return entitiy.href
- end
+ # By default, `null` is returned.
+ # Clients are therefore encouraged to redefine the method in a subclass to control where entities should link to.
+ fun hrefto(entitiy: MEntity): nullable String do return null
init
do
var stack = new Array[Prod]
var line = 0
var c: nullable Token = first_token
- var hv = new HighlightVisitor
+ var hv = self
while c != null do
var starting
end
return (new HTMLTag("a")).attr("href", href).text(text)
end
-
- # Default link
- private fun href: nullable String do return null
end
redef class MModule
return res
end
- # The module HTML page
- redef fun href: String
- do
- return c_name + ".html"
- end
-
redef fun linkto(v) do return linkto_text(v, name)
end
if mdoc == null then mdoc = mclass.intro.mdoc
if mdoc != null then mdoc.fill_infobox(res)
+ var in_hierarchy = self.in_hierarchy
if in_hierarchy == null then return res
if in_hierarchy.greaters.length > 1 then
end
return res
end
-
- # The class HTML page (an anchor in the module page)
- redef fun href: String
- do
- return mmodule.href + "#" + to_s
- end
end
redef class MPropDef
var res = new HInfoBox(v, to_s)
res.href = v.hrefto(self)
if self isa MMethodDef then
+ var msignature = self.msignature
if msignature != null then res.new_field("fun").append(mproperty.name).add msignature.linkto(v)
else if self isa MAttributeDef then
+ var static_mtype = self.static_mtype
if static_mtype != null then res.new_field("fun").append(mproperty.name).add static_mtype.linkto(v)
else if self isa MVirtualTypeDef then
+ var bound = self.bound
if bound != null then res.new_field("add").append(mproperty.name).add bound.linkto(v)
else
res.new_field("wat?").append(mproperty.name)
return res
end
-
- # The property HTML page (an anchor in the module page)
- redef fun href: String
- do
- return self.mclassdef.mmodule.href + "#" + self.to_s
- end
end
redef class MClassType
redef fun decorate_tag(v, res, token)
do
if token != n_id then return null
+ var parent = self.parent
+ if parent == null then return null
return parent.decorate_tag(v, res, token)
end
end
redef fun decorate_tag(v, res, token)
do
if token != n_id then return null
+ var parent = self.parent
+ if parent == null then return null
return parent.decorate_tag(v, res, token)
end
end
redef class Token
# Produce an HTMLTag with the correct contents and CSS classes
# Subclasses can redefine it to decorate the tag
- redef fun make_tag(v: HighlightVisitor): HTMLTag
+ redef fun make_tag(v): HTMLTag
do
var res = new HTMLTag("span")
res.text(text)
redef class ASendExpr
redef fun decorate_tag(v, res, token)
do
+ var callsite = self.callsite
if callsite == null then return null
return callsite.infobox(v)
end
redef class ANewExpr
redef fun decorate_tag(v, res, token)
do
+ var callsite = self.callsite
if callsite == null then return null
return callsite.infobox(v)
end
redef class AModuleName
redef fun decorate_tag(v, res, token)
do
- return parent.decorate_tag(v, res, token)
+ var p = parent
+ if p == null then return null
+ return p.decorate_tag(v, res, token)
end
end
do
if not token isa TClassid then return null
res.add_class("nc_vt")
+ var mtype = self.mtype
if mtype == null then return null
return mtype.infobox(v)
end