Restructuring entries, duplicated items removed.

pull/1717/head
xjkdev 3 years ago
parent 44ae69e842
commit b4a1491c4e

@ -7,34 +7,33 @@ module Docs
title = get_title() title = get_title()
downtitle = title.downcase downtitle = title.downcase
name = get_name name = get_name
# Remove Empty pages.
if content.include?('TODO: write this dox page!') || if content.include?('TODO: write this dox page!') ||
content.blank? || content.empty? content.blank? || content.empty?
return nil return nil
end end
if slug.include?('unsupported') if slug.include?('unsupported')
return 'Unsupported' return 'Unsupported'
elsif title.end_with?('module')
return name
elsif not group.nil? and not group.children[-1].nil? and group.children[-1].content != 'Reference'
if group.children[-1].content.end_with?('module') || group.content.include?('Reference')
return group.children[-1].content
else
return 'Chapter: ' + group.children[-1].content
end
elsif slug.start_with?('Topic') || downtitle.end_with?("topics") elsif slug.start_with?('Topic') || downtitle.end_with?("topics")
return 'Topics' return 'Topics'
elsif downtitle.end_with?("class template reference") || downtitle.end_with?("class reference") || downtitle.end_with?("struct reference") elsif downtitle.end_with?("class template reference") || downtitle.end_with?("class reference")
return 'Classes' return 'Classes'
elsif downtitle.end_with?("struct reference")
return 'Structs'
elsif downtitle.end_with?("typedefs") elsif downtitle.end_with?("typedefs")
return 'Typedefs' return 'Typedefs'
elsif downtitle.end_with?("namespace reference") elsif downtitle.end_with?("namespace reference")
return 'Namespaces' return 'Namespaces'
elsif name.match(/^Eigen::.*::/) elsif not group.nil? and group.content.include?('Reference') and (downtitle.end_with?("module") || downtitle.end_with?("modules"))
return name.gsub(/^Eigen::/, '').gsub(/::.*/, '') return "Modules"
elsif not group.nil? and not group.children[0].nil? elsif not group.nil?
return 'Chapter: ' + group.children[0].content if group.children.length > 0
# elsif slug.downcase.include?('tutorial') return 'Chapter: ' + group.children[-1].content
# return nil else
return 'Chapter: ' + group.content
end
else else
return 'Eigen' return 'Eigen'
end end
@ -67,11 +66,13 @@ module Docs
doxygen_type = table.at_css("tr.heading").text.strip doxygen_type = table.at_css("tr.heading").text.strip
case doxygen_type case doxygen_type
when "Functions" when "Functions"
type = name == 'Eigen' ? "Functions" : nil type = "Functions"
when "Public Member Functions", "Static Public Member Functions" when "Public Member Functions", "Static Public Member Functions"
type = nil type = nil
when "Classes", "Typedefs" when "Classes"
type = "Classes" type = "Classes"
when "Typedefs"
type = "Typedefs"
when "Variables" when "Variables"
type = "Variables" type = "Variables"
else else
@ -88,12 +89,17 @@ module Docs
end end
href = node.at_css("a").attr('href') href = node.at_css("a").attr('href')
if href.index("#").nil? then
href += "#" if not href.include?("#") and (name == 'Eigen' || type = "Classes") then
end
if slug.include?('unsupported') and not href.include?('unsupported')
next next
end end
if slug.include?('unsupported')
if not (href.include?('unsupported') || href.include?('#'))
next
elsif href.include?('#') and not href.include?('unsupported')
href = 'unsupported/' + href
end
end
content = node.content content = node.content
if doxygen_type == "Typedefs" if doxygen_type == "Typedefs"

Loading…
Cancel
Save