module doc_base
import toolcontext
-import doc_model # FIXME maintain compatibility with old templates.
+import model_utils
+import model_ext
# The model of a Nitdoc documentation.
#
abstract class DocComposite
# Parent element.
- var parent: nullable DocComposite = null
+ var parent: nullable DocComposite = null is writable
# Does `self` have a `parent`?
fun is_root: Bool do return parent == null
# Add a `child` to `self`.
#
# Shortcut for `children.add`.
- fun add(child: DocComposite) do children.add child
+ fun add_child(child: DocComposite) do
+ child.parent = self
+ children.add child
+ end
end
# The `DocComposite` element that contains all the other.
# The title of the group, as displayed to the user.
var title: String
end
+
+redef class MEntity
+ # Name displayed in console for debug and tests.
+ fun nitdoc_name: String do return name.html_escape
+end
+
+redef class MClassDef
+ redef fun nitdoc_name do return mclass.nitdoc_name
+end
+
+redef class MPropDef
+ redef fun nitdoc_name do return mproperty.nitdoc_name
+end