lib/markdown: merge processor and emitter
[nit.git] / src / doc / html_templates / html_templates.nit
index 2f893da..a7a5b9a 100644 (file)
@@ -449,7 +449,7 @@ redef class IntroArticle
        redef fun render_body do
                var tabs = new DocTabs("{html_id}.tabs", "")
                var comment = mentity.html_documentation
-               if mentity isa MProject then
+               if mentity isa MPackage then
                        comment = mentity.html_synopsis
                end
                if comment != null then
@@ -506,7 +506,7 @@ redef class DefinitionArticle
                var tabs = new DocTabs("{html_id}.tabs", "")
                if not is_no_body then
                        var comment
-                       if is_short_comment or mentity isa MProject then
+                       if is_short_comment or mentity isa MPackage then
                                comment = mentity.html_synopsis
                        else
                                comment = mentity.html_documentation
@@ -563,23 +563,22 @@ end
 redef class GraphArticle
        redef var html_title = null
 
-       # HTML map used to display link.
+       # Graph in SVG with clickable map.
        #
        # This attribute is set by the `doc_render` phase who knows the context.
-       var map: String is noinit, writable
+       var svg: nullable String = null is writable
 
        redef fun render_body do
                addn "<div class=\"text-center\">"
-               addn " <img src='{graph_id}.png' usemap='#{graph_id}' style='margin:auto'"
-               addn "  alt='{title or else ""}'/>"
-               add map
+               var svg = self.svg
+               if svg != null then add svg
                addn "</div>"
        end
 end
 
 redef class ReadmeSection
        redef var html_id is lazy do
-               return markdown_processor.emitter.decorator.strip_id(html_title.as(not null).to_s)
+               return markdown_processor.decorator.strip_id(html_title.as(not null).to_s)
        end
 
        redef var html_title is lazy do