This method is deprecated or moved on the latest stable version.
The last existing version (v1_8_7_330) is shown here.
extract_sections(flow, sections)
private
Given an array of flow items and an array of section names, extract those
sections from the flow which have headings corresponding to a section name
in the list. Return them in the order of names in the sections
array.
# File lib/rdoc/usage.rb, line 165
def RDoc.extract_sections(flow, sections)
result = []
sections.each do |name|
name = name.downcase
copy_upto_level = nil
flow.each do |item|
case item
when SM::Flow::H
if copy_upto_level && item.level >= copy_upto_level
copy_upto_level = nil
else
if item.text.downcase == name
result << item
copy_upto_level = item.level
end
end
else
if copy_upto_level
result << item
end
end
end
end
if result.empty?
puts "Note to developer: requested section(s) [#{sections.join(', ')}] " +
"not found"
result = flow
end
result
end