to_s
with hyper-links.By default, linkto_text(v, to_s)
is used, c.f. see linkto_text
.
For some complex entities, like generic types, multiple <a>
and <span>
elements can be generated.
E.g. Array[Int]
might become <a>Array</a>[<a>Int</a>]
with the correct href
attributes
provided by v.hrefto
.
# A HTML version of `to_s` with hyper-links.
#
# By default, `linkto_text(v, to_s)` is used, c.f. see `linkto_text`.
#
# For some complex entities, like generic types, multiple `<a>` and `<span>` elements can be generated.
# E.g. `Array[Int]` might become `<a>Array</a>[<a>Int</a>]` with the correct `href` attributes
# provided by `v.hrefto`.
fun linkto(v: HtmlightVisitor): HTMLTag do return linkto_text(v, to_s)
src/htmlight.nit:443,2--450,71
redef fun linkto(v)
do
var res = new HTMLTag("span")
var first = true
if not mparameters.is_empty then
res.append "("
for p in mparameters do
if first then
first = false
else
res.append ", "
end
res.append p.name
res.append ": "
res.add p.mtype.linkto(v)
end
res.append ")"
end
var ret = return_mtype
if ret != null then
res.append ": "
res.add ret.linkto(v)
end
return res
end
src/htmlight.nit:657,2--681,4