src/web: use full_name instead of html_raw_namespace
[nit.git] / src / web / web_views.nit
index 5f49f84..7273187 100644 (file)
@@ -55,7 +55,7 @@ class HtmlResultPage
                var list = new UnorderedList
                for mentity in results do
                        var link = mentity.html_link
-                       link.text = mentity.html_raw_namespace
+                       link.text = mentity.html_full_name
                        list.add_li new ListItem(link)
                end
                tpl.add list
@@ -119,3 +119,29 @@ class HtmlDocPage
                return tpl
        end
 end
+
+# Display the source for each mentities
+class HtmlDotPage
+       super NitView
+
+       # Dot to process.
+       var dot: Text
+
+       # Page title.
+       var title: String
+
+       redef fun render(srv) do
+               var tpl = new Template
+               tpl.add new Header(1, title)
+               tpl.add render_dot
+               return tpl
+       end
+
+       private fun render_dot: String do
+               var proc = new ProcessDuplex("dot", "-Tsvg", "-Tcmapx")
+               var svg = proc.write_and_read(dot)
+               proc.close
+               proc.wait
+               return svg
+       end
+end