# The documentation associated to the entity
var mdoc: nullable MDoc is writable
+ # The documentation associated to the entity or their main nested entity.
+ #
+ # MProject fall-back to their root MGroup
+ # MGroup fall-back to their default_mmodule
+ # Other entities do not fall-back
+ #
+ # One may use `MDoc::original_mentity` to retrieve the original
+ # source of the documentation.
+ fun mdoc_or_fallback: nullable MDoc do return mdoc
+
# Is the entity deprecated?
#
# Used for warnings and in documentation.
# Return `null` if the group has no default module or if the default
# module is not loaded.
var default_mmodule: nullable MModule = null
+
+ redef fun mdoc_or_fallback
+ do
+ if mdoc != null then return mdoc
+ if default_mmodule == null then return null
+ return default_mmodule.mdoc_or_fallback
+ end
end
# A Nit module is usually associated with a Nit source file.
import model_base
private import more_collections
import poset
+import mdoc
# A Nit project, that encompass a product
class MProject
# MProject are always roots of the concerns hierarchy
redef fun parent_concern do return null
+
+ redef fun mdoc_or_fallback
+ do
+ if mdoc != null then return mdoc
+ return root.mdoc_or_fallback
+ end
end
# A group of modules in a project