src/doc/templates: move `html_list_item` to `static_cards`
authorAlexandre Terrasa <alexandre@moz-code.org>
Sun, 10 Jun 2018 23:03:33 +0000 (19:03 -0400)
committerAlexandre Terrasa <alexandre@moz-code.org>
Fri, 22 Jun 2018 03:42:10 +0000 (23:42 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

src/doc/static/static_cards.nit
src/doc/templates/templates_html.nit

index e589ca6..9b706c5 100644 (file)
@@ -282,10 +282,21 @@ class CardInheritance
                addn "<h4 id='{id}'>{title}</h4>"
                addn "<ul class='list-unstyled'>"
                for mentity in mentities do
-                       addn mentity.html_list_item
+                       addn html_list_item(mentity)
                end
                addn "</ul>"
        end
+
+       private fun html_list_item(mentity: MEntity): ListItem do
+               var tpl = new Template
+               tpl.add mentity.html_namespace
+               var comment = mentity.mdoc_or_fallback
+               if comment != null then
+                       tpl.add ": "
+                       tpl.add comment.html_synopsis
+               end
+               return new ListItem(tpl)
+       end
 end
 
 # A card about the linearization of a MEntity
index 4a2100d..77e3980 100644 (file)
@@ -86,18 +86,6 @@ redef class MEntity
        # An icon representative of the mentity
        fun html_icon: BSIcon do return new BSIcon("tag", ["text-muted"])
 
-       # A li element that can go in a `HTMLList`
-       fun html_list_item: ListItem do
-               var tpl = new Template
-               tpl.add html_namespace
-               var comment = mdoc_or_fallback
-               if comment != null then
-                       tpl.add ": "
-                       tpl.add comment.html_synopsis
-               end
-               return new ListItem(tpl)
-       end
-
        # CSS classes used to decorate `self`
        #
        # Mainly used for icons.