Class: Marko::Markup::MTree
- Inherits:
-
Macro
- Object
- Macro
- Marko::Markup::MTree
show all
- Defined in:
- lib/marko/markup/macro.rb
Instance Method Summary
collapse
Methods inherited from Macro
#gsub!, #pattern, pattern
Instance Method Details
#subs(sample, node) ⇒ Object
90
91
92
93
94
95
96
|
# File 'lib/marko/markup/macro.rb', line 90
def subs(sample, node)
level = node.nesting_level + 1
node.to_a.drop(1)
.inject([]){|memo, n| memo << Decorator.new(n)}
.map{|n| "#{' ' * (n.nesting_level - level)}- #{n.ref}" }
.join(?\n) + ?\n
end
|