+
+redef class MModule
+ redef fun write_extra_doc(view, stream)
+ do
+ # Introduced classes
+ var class_intros = collect_intro_mclasses(view).to_a
+ if class_intros.not_empty then
+ alpha_comparator.sort class_intros
+ stream.write line_separator*2
+ stream.write "## Introduced classes"
+
+ for c in class_intros do
+ stream.write line_separator
+ stream.write "* {c.name}"
+ var doc = c.intro.mdoc
+ if doc != null then stream.write ": {doc.content.first}"
+ end
+ end
+
+ # Introduced properties
+ var prop_intros = new Array[MPropDef]
+ for c in mclassdefs do
+ prop_intros.add_all c.collect_intro_mpropdefs(view)
+ end
+
+ if prop_intros.not_empty then
+ alpha_comparator.sort prop_intros
+ stream.write line_separator*2
+ stream.write "## Introduced properties"
+ stream.write line_separator
+
+ for p in prop_intros do
+ p.mproperty.write_synopsis(view.mainmodule, stream)
+ end
+ end
+ end
+end
+
+redef class MProperty
+ private fun write_synopsis(mainmodule: MModule, stream: Writer)
+ do
+ if visibility == public_visibility then
+ stream.write "+ "
+ else stream.write "~ " # protected_visibility
+
+ if self isa MMethod then
+ if is_new and name != "new" then
+ stream.write "new "
+ else if is_init and name != "init" then
+ stream.write "init "
+ end
+ end
+
+ stream.write name
+
+ if self isa MMethod then
+ var intro = intro
+ assert intro isa MMethodDef
+ var msignature = intro.msignature
+ if msignature != null then
+ stream.write msignature.to_s
+ end
+ end
+
+ var mdoc = intro.mdoc
+ if mdoc != null then
+ stream.write " # "
+ stream.write mdoc.content.first
+ end
+ stream.write line_separator
+ end
+end