nitc :: MDoc :: defaultinit
# Structured documentation of a `MEntity` object
class MDoc
# Raw content, line by line
# The starting `#` and first space are stripped.
# The trailing `\n` are chomped.
var content = new Array[String]
# The entity where the documentation is originally attached to.
# This gives some context to resolve identifiers or to run examples.
var original_mentity: nullable MEntity = null is writable
# The original location of the doc for error messages
var location: Location
# The comment first line
var synopsis: String is lazy do return content.first
# All comment lines except for the synopsis
var comment: String is lazy do
var lines = content.to_a
if not lines.is_empty then lines.shift
return lines.join("\n")
end
# Full comment
var documentation: String is lazy do return content.join("\n")
end
src/model/mdoc.nit:21,1--47,3