Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
var sarticle = mproject.tpl_article
sarticle.subtitle = mproject.html_declaration
sarticle.content = mproject.tpl_definition
var sarticle = mproject.tpl_article
sarticle.subtitle = mproject.html_declaration
sarticle.content = mproject.tpl_definition
- var mdoc = mproject.mdoc_or_fallback
- if mdoc != null then
- sarticle.content = mdoc.tpl_short_comment
+ var comment = mproject.html_short_comment
+ if comment != null then
+ sarticle.content = comment
end
ssection.add_child sarticle
end
end
ssection.add_child sarticle
end
if mentity isa MPropDef then
article.source_link = v.tpl_showsource(mentity.location)
end
if mentity isa MPropDef then
article.source_link = v.tpl_showsource(mentity.location)
end
- if not mentity isa MVirtualTypeProp then
- # article.content = mentity.tpl_comment
- end
end
for child in children do
child.render(v, doc, page, article)
end
for child in children do
child.render(v, doc, page, article)
article.title_classes.add "signature"
article.summary_title = "{mprop.html_name}"
article.subtitle = mpropdef.html_namespace
article.title_classes.add "signature"
article.summary_title = "{mprop.html_name}"
article.subtitle = mpropdef.html_namespace
- if mpropdef.mdoc_or_fallback != null then
- article.content = mpropdef.mdoc_or_fallback.tpl_comment
+ var comment = mpropdef.html_comment
+ if comment != null then
+ article.content = comment
end
# TODO move in its own phase? let's see after doc_template refactoring.
# Add linearization
end
# TODO move in its own phase? let's see after doc_template refactoring.
# Add linearization
# A template article that briefly describe the entity
fun tpl_short_article: TplArticle do
var tpl = tpl_article
# A template article that briefly describe the entity
fun tpl_short_article: TplArticle do
var tpl = tpl_article
- var mdoc = mdoc_or_fallback
- if mdoc != null then
- tpl.content = mdoc.tpl_short_comment
+ var comment = html_short_comment
+ if comment != null then
+ tpl.content = comment
var lnk = new Template
lnk.add new TplLabel.with_classes(tpl_css_classes)
lnk.add html_link
var lnk = new Template
lnk.add new TplLabel.with_classes(tpl_css_classes)
lnk.add html_link
- var mdoc = mdoc_or_fallback
- if mdoc != null then
+ var comment = html_short_comment
+ if comment != null then
- lnk.add mdoc.tpl_short_comment
end
return new TplListItem.with_content(lnk)
end
end
return new TplListItem.with_content(lnk)
end
private fun tpl_concern_item: TplListItem do
var lnk = new Template
lnk.add html_link_to_anchor
private fun tpl_concern_item: TplListItem do
var lnk = new Template
lnk.add html_link_to_anchor
- var mdoc = mdoc_or_fallback
- if mdoc != null then
+ var comment = html_short_comment
+ if comment != null then
- lnk.add mdoc.tpl_short_comment
end
return new TplListItem.with_content(lnk)
end
end
return new TplListItem.with_content(lnk)
end
redef class MProject
redef fun tpl_definition do
var tpl = new TplDefinition
redef class MProject
redef fun tpl_definition do
var tpl = new TplDefinition
- var mdoc = mdoc_or_fallback
- if mdoc != null then
- tpl.comment = mdoc.tpl_comment
+ var comment = html_comment
+ if comment != null then
+ tpl.comment = comment
redef class MGroup
redef fun tpl_definition do
var tpl = new TplDefinition
redef class MGroup
redef fun tpl_definition do
var tpl = new TplDefinition
- var mdoc = mdoc_or_fallback
- if mdoc != null then
- tpl.comment = mdoc.tpl_comment
+ var comment = html_comment
+ if comment != null then
+ tpl.comment = comment
redef class MModule
redef fun tpl_definition do
var tpl = new TplClassDefinition
redef class MModule
redef fun tpl_definition do
var tpl = new TplClassDefinition
- var mdoc = mdoc_or_fallback
- if mdoc != null then
- tpl.comment = mdoc.tpl_comment
+ var comment = html_comment
+ if comment != null then
+ tpl.comment = comment
title.add "in "
title.add mmodule.html_namespace
tpl.subtitle = title
title.add "in "
title.add mmodule.html_namespace
tpl.subtitle = title
- var mdoc = mdoc_or_fallback
- if mdoc != null then
- tpl.content = mdoc.tpl_comment
+ var comment = html_comment
+ if comment != null then
+ tpl.content = comment
redef fun tpl_definition do
var tpl = new TplClassDefinition
redef fun tpl_definition do
var tpl = new TplClassDefinition
- var mdoc = mdoc_or_fallback
- if mdoc != null then
- tpl.comment = mdoc.tpl_comment
+ var comment = html_comment
+ if comment != null then
+ tpl.comment = comment
title.add mclassdef.html_link
tpl.title = title
tpl.subtitle = html_declaration
title.add mclassdef.html_link
tpl.title = title
tpl.subtitle = html_declaration
- var mdoc = mdoc_or_fallback
- if mdoc != null then
- tpl.content = mdoc.tpl_comment
+ var comment = html_comment
+ if comment != null then
+ tpl.content = comment
end
return tpl
end
redef fun tpl_definition do
var tpl = new TplDefinition
end
return tpl
end
redef fun tpl_definition do
var tpl = new TplDefinition
- var mdoc = mdoc_or_fallback
- if mdoc != null then
- tpl.comment = mdoc.tpl_comment
+ var comment = html_comment
+ if comment != null then
+ tpl.comment = comment
var atitle = html_link.title
var anchor = new Link.with_title(ahref, atext, atitle)
lnk.add anchor
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
+ var comment = html_short_comment
+ if comment != null then
- lnk.add mdoc.tpl_short_comment
end
return new TplListItem.with_content(lnk)
end
end
return new TplListItem.with_content(lnk)
end
var atitle = mclassdef.html_link.title
var anchor = new Link.with_title(ahref, atext, atitle)
lnk.add anchor
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
+ var comment = html_short_comment
+ if comment != null then
- lnk.add mdoc.tpl_short_comment
end
var li = new TplListItem.with_content(lnk)
li.css_classes.add "signature"
end
var li = new TplListItem.with_content(lnk)
li.css_classes.add "signature"
redef class MInnerClassDef
redef fun tpl_definition do
var tpl = new TplClassDefinition
redef class MInnerClassDef
redef fun tpl_definition do
var tpl = new TplClassDefinition
- var mdoc = mdoc_or_fallback
- if mdoc != null then
- tpl.comment = mdoc.tpl_comment
+ var comment = html_comment
+ if comment != null then
+ tpl.comment = comment
# * MProperty: `mclass::mprop`
# * MPropdef: `mclassdef:mpropdef`
fun html_namespace: Template is abstract
# * MProperty: `mclass::mprop`
# * MPropdef: `mclassdef:mpropdef`
fun html_namespace: Template is abstract
+
+ # Returns the comment of this MEntity formatted as HTML.
+ var html_comment: nullable Writable is lazy do
+ var mdoc = mdoc_or_fallback
+ if mdoc == null then return null
+ return mdoc.tpl_comment
+ end
+
+ # Returns the comment of this MEntity formatted as HTML.
+ var html_short_comment: nullable Writable is lazy do
+ var mdoc = mdoc_or_fallback
+ if mdoc == null then return null
+ return mdoc.tpl_short_comment
+ end