Method: Utils#detect_sections_from_html
- Defined in:
- lib/utils.rb
#detect_sections_from_html(html_file) ⇒ Object
250 251 252 253 254 255 256 257 |
# File 'lib/utils.rb', line 250 def detect_sections_from_html(html_file) sections = [] html = Nokogiri::HTML.parse(File.open(html_file).read) html.search('h2').each do |node| sections << {:title=>node.text,:page_num=>node['id']} end sections end |