X-Git-Url: http://nitlanguage.org
diff --git a/src/test_markdown.nit b/src/test_markdown.nit
index 3b65f7c..76a5180 100644
--- a/src/test_markdown.nit
+++ b/src/test_markdown.nit
@@ -21,37 +21,38 @@ import markdown
redef class ModelBuilder
fun test_markdown(page: HTMLTag, mmodule: MModule)
do
- page.add_raw_html ""
- page.add_raw_html "
module {mmodule}
"
- if mmodule2nmodule.has_key(mmodule) then
- do
- var mdoc = mmodule.mdoc
- if mdoc == null then break label x
+ page.add_raw_html "module {mmodule}"
+ var mdoc = mmodule.mdoc
+ if mdoc != null then
+ page.add mdoc.full_markdown
+ end
+ for mclassdef in mmodule.mclassdefs do
+ mdoc = mclassdef.mdoc
+ if mdoc != null then
+ page.add_raw_html "class {mclassdef}"
page.add mdoc.full_markdown
- end label x
- for mclassdef in mmodule.mclassdefs do
- do
- var mdoc = mclassdef.mdoc
- if mdoc != null then
- if mclassdef.mclass.intro == mclassdef then page.add_raw_html ""
- page.add_raw_html "class {mclassdef}
"
- page.add mdoc.full_markdown
- end
- end
- for mpropdef in mclassdef.mpropdefs do
- var mdoc = mpropdef.mdoc
- if mdoc != null then
- if mpropdef.mproperty.intro == mpropdef then page.add_raw_html ""
-
- page.add_raw_html "prop {mpropdef}
"
- page.add mdoc.full_markdown
- end
+ end
+ for mpropdef in mclassdef.mpropdefs do
+ mdoc = mpropdef.mdoc
+ if mdoc != null then
+ page.add_raw_html "prop {mpropdef}
"
+ page.add mdoc.full_markdown
end
end
end
end
end
+redef class MModule
+ redef fun href do return "#{to_s}"
+end
+redef class MClassDef
+ redef fun href do return "#{to_s}"
+end
+redef class MPropDef
+ redef fun href do return "#{to_s}"
+end
+
var toolcontext = new ToolContext
var opt_full = new OptionBool("Process also imported modules", "--full")
@@ -94,13 +95,28 @@ border-radius: 3px;
.rawcode[title] {
border-color: red;
}
+h5 {font-weight:bold;}
{{{hv.css_content}}}
"""
if opt_full.value then
- for m in model.mmodules do
- modelbuilder.test_markdown(page, m)
+ for p in model.mprojects do
+ page.add_raw_html "project {p.name}"
+ var mdoc = p.mdoc
+ if mdoc != null then
+ page.add mdoc.full_markdown
+ end
+ for g in p.mgroups do
+ mdoc = g.mdoc
+ if mdoc != null then
+ page.add_raw_html "group {g.full_name}
"
+ page.add mdoc.full_markdown
+ end
+ for m in g.mmodules do
+ modelbuilder.test_markdown(page, m)
+ end
+ end
end
else
for m in mmodules do