require 'nokogiri' module RstSemantic def get_toc(raw) doc = Nokogiri::HTML(raw) return doc.css("div.contents").to_s.gsub(/
  • .*Summary<\/a><\/li>/, '') end def get_content(raw) doc = Nokogiri::HTML(raw) return doc.css("div.document > div.section")[1..-1] end def get_summary(raw) doc = Nokogiri::HTML(raw) return doc.css("div.section").first.to_s.gsub(/

    .*<\/h1>/, '') end end