Class: Mdtoc::FileNode
- Inherits:
-
Node
- Object
- Node
- Mdtoc::FileNode
show all
- Defined in:
- lib/mdtoc/node.rb
Instance Method Summary
collapse
Methods inherited from Node
for_path, #initialize, #label
Constructor Details
This class inherits a constructor from Mdtoc::Node
Instance Method Details
59
60
61
62
63
64
65
|
# File 'lib/mdtoc/node.rb', line 59
def
parser = Markdown::Parser.new(@depth, @path)
= parser.(File.foreach(@path))
return if [0]&.top_level?(@depth)
.unshift(Mdtoc::Markdown::Header.new(@depth, label, @path))
end
|