nitc :: MarkdownMetrics :: _headings_counter
Count heading levelsnitc :: MarkdownMetrics :: defaultinit
nitc :: MarkdownMetrics :: headings_counter=
Count heading levelsnitc :: MarkdownMetrics :: nodes_counter=
Count nodesnitc $ MarkdownMetrics :: SELF
Type of this instance, automatically specialized in every classnitc :: MarkdownMetrics :: _headings_counter
Count heading levelscore :: Object :: class_factory
Implementation used byget_class
to create the specific class.
nitc :: MarkdownMetrics :: defaultinit
core :: Object :: defaultinit
markdown2 :: MdVisitor :: defaultinit
nitc :: MarkdownMetrics :: headings_counter=
Count heading levelscore :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
core :: Object :: native_class_name
The class name of the object in CString format.nitc :: MarkdownMetrics :: nodes_counter=
Count nodescore :: Object :: output_class_name
Display class name on stdout (debug only).
# A Markdown decorator that collects metrics about a Readme content
class MarkdownMetrics
super MdVisitor
# Count nodes
var nodes_counter = new Counter[String]
# Count heading levels
var headings_counter = new Counter[Int]
redef fun visit(node) do
nodes_counter.inc node.class_name
if node isa MdHeading then
headings_counter.inc node.level
end
node.visit_all self
end
end
src/metrics/readme_metrics.nit:49,1--66,3