Merge: Do not display test suite modules in Nitdoc
[nit.git] / src / doc / doc_pages.nit
index ae2dde5..38e6cdf 100644 (file)
@@ -166,7 +166,7 @@ class Nitdoc
 
        private fun modules do
                for mmodule in model.mmodules do
-                       if mmodule.is_fictive then continue
+                       if mmodule.is_fictive or mmodule.is_test_suite then continue
                        var page = new NitdocModule(ctx, model, mainmodule, mmodule)
                        page.render.write_to_file("{ctx.output_dir.to_s}/{page.page_url}")
                end
@@ -211,7 +211,7 @@ class QuickSearch
 
        init do
                for mmodule in model.mmodules do
-                       if mmodule.is_fictive then continue
+                       if mmodule.is_fictive or mmodule.is_test_suite then continue
                        add_result_for(mmodule.name, mmodule.full_name, mmodule.nitdoc_url)
                end
                for mclass in model.mclasses do
@@ -386,7 +386,7 @@ abstract class NitdocPage
                var source = ctx.opt_source.value
                if source == null then
                        var url = location.file.filename.simplify_path
-                       return "<a target='_blank' title='Show source' href=\"{url}\">View Source</a>"
+                       return "<a target='_blank' title='Show source' href=\"{url.html_escape}\">View Source</a>"
                end
                # THIS IS JUST UGLY ! (but there is no replace yet)
                var x = source.split_with("%f")
@@ -396,7 +396,7 @@ abstract class NitdocPage
                x = source.split_with("%L")
                source = x.join(location.line_end.to_s)
                source = source.simplify_path
-               return "<a target='_blank' title='Show source' href=\"{source.to_s}\">View Source</a>"
+               return "<a target='_blank' title='Show source' href=\"{source.to_s.html_escape}\">View Source</a>"
        end
 
        # MProject description template
@@ -518,7 +518,8 @@ abstract class NitdocPage
                else
                        var cls_url = mprop.intro.mclassdef.mclass.nitdoc_url
                        var def_url = "{cls_url}#{mprop.nitdoc_id}"
-                       var lnk = new TplLink.with_title(def_url, mprop.name, "Go to introduction")
+                       var lnk = new TplLink.with_title(def_url, mprop.nitdoc_name,
+                                       "Go to introduction")
                        title.add "redef "
                        title.add lnk
                end
@@ -542,8 +543,8 @@ abstract class NitdocPage
                                redef_article.title_classes.add "signature info"
                                redef_article.css_classes.add "nospace"
                                var redef_content = new Template
-                               if mpropdef.mdoc_or_fallback != null then
-                                       redef_content.add mpropdef.mdoc_or_fallback.tpl_comment
+                               if mpropdef.mdoc != null then
+                                       redef_content.add mpropdef.mdoc.tpl_comment
                                end
                                redef_article.content = redef_content
                                subarticle.add_child redef_article
@@ -666,7 +667,7 @@ class NitdocSearch
        private fun modules_list: Array[MModule] do
                var sorted = new Array[MModule]
                for mmodule in model.mmodule_importation_hierarchy do
-                       if mmodule.is_fictive then continue
+                       if mmodule.is_fictive or mmodule.is_test_suite then continue
                        sorted.add mmodule
                end
                name_sorter.sort(sorted)
@@ -932,7 +933,7 @@ class NitdocModule
                # Imports
                var lst = new Array[MModule]
                for dep in imports do
-                       if dep.is_fictive then continue
+                       if dep.is_fictive or dep.is_test_suite then continue
                        if dep == mmodule then continue
                        lst.add(dep)
                end
@@ -944,7 +945,7 @@ class NitdocModule
                # Clients
                lst = new Array[MModule]
                for dep in clients do
-                       if dep.is_fictive then continue
+                       if dep.is_fictive or dep.is_test_suite then continue
                        if dep == mmodule then continue
                        lst.add(dep)
                end
@@ -1023,10 +1024,10 @@ class NitdocModule
        fun tpl_dot(mmodules: Collection[MModule]): nullable TplArticle do
                var poset = new POSet[MModule]
                for mmodule in mmodules do
-                       if mmodule.is_fictive then continue
+                       if mmodule.is_fictive or mmodule.is_test_suite then continue
                        poset.add_node mmodule
                        for omodule in mmodules do
-                               if mmodule.is_fictive then continue
+                               if omodule.is_fictive or omodule.is_test_suite then continue
                                poset.add_node mmodule
                                if mmodule.in_importation < omodule then
                                        poset.add_edge(mmodule, omodule)
@@ -1126,7 +1127,7 @@ class NitdocClass
                        classes.add "inherit"
                        var cls_url = mprop.intro.mclassdef.mclass.nitdoc_url
                        var def_url = "{cls_url}#{mprop.nitdoc_id}"
-                       var lnk = new TplLink(def_url, mprop.name)
+                       var lnk = new TplLink(def_url, mprop.nitdoc_name)
                        var mdoc = mprop.intro.mdoc_or_fallback
                        if mdoc != null then lnk.title = mdoc.short_comment
                        var item = new Template