require 'yatoc'
require 'kramdown'
s2=<<EOF
# Story 1345
The story of this is not important. Learn more from the text below.
## Foo
This is 1st paragraph
### Train
Work at something
### Travel By Bike
Travel by bike.
## Bar
This is 2nd paragraph
### Mary
Mary had a little lamb
#### Time
Take time to rest
### Weakness
Your weakness is my weakness
--------------
EOF
y = Yatoc.new(Kramdown::Document.new(s2).to_html)
#File.write '/tmp/foo.html', y.to_html
#puts Rexle.new(y.to_toc).xml pretty: true
puts y.to_html
The story of this is not important. Learn more from the text below.
This is 1st paragraph
Work at something
Travel by bike.
This is 2nd paragraph
Mary had a little lamb
Take time to rest
Your weakness is my weakness
html toc yatoc gem