Simplify entries to just from PointCloudLibrary modules (group__*.html)

pull/1680/head
Aditya Ardiya 3 years ago
parent f8b7cb738e
commit 46d2fd2ba0

@ -2,41 +2,51 @@ module Docs
class PointCloudLibrary
class EntriesFilter < Docs::EntriesFilter
def get_type
if slug.start_with?("group")
'Group'
if slug.include?("group__") then
tmp = slug.dup
tmp.sub! "group__", ""
tmp.sub! "__", " "
tmp
else
'Others'
""
end
end
def get_name
type = get_type()
if type == ""
slug
else
"Module " + type
end
end
def additional_entries
return [] if root_page?
# Only add additional_entries from PointCloudLibrary modules (group__*.html)
return [] if not slug.include?("group")
entries = []
css('table.memberdecls td.memItemRight').map do |node|
# Get the type of the entry from Doxygen table heading
type = node.parent.parent.css("tr.heading").text.strip
if type == 'Additional Inherited Members' then
return []
href = node.at_css("a").attr('href')
if href.index("#").nil? then
href += "#"
end
# Retrieve HREF link
first_link = node.css("a").first
if first_link.nil? then
return []
# Skip page that's not crawled
# TODO: Sync this with options[:skip_patterns] in point_cloud_library.rb
if href.include?("namespace") || href.include?("structsvm") || href.include?("classopenni") then
next
end
href = first_link['href']
if href.index("#").nil? then
# If it doesn't have #, it means it's linking to other page.
# So append # at the end to make it work
href += "#"
# Only add function and classes documentation
doxygen_type = node.parent.parent.at_css("tr.heading").text.strip
if not(doxygen_type == "Functions" || doxygen_type == "Classes") then
next
end
[node.content, href, type]
entries << [node.content, href]
end
end
def include_default_entry?
!at_css('.obsolete')
entries
end
end
end

@ -5,6 +5,10 @@ module Docs
self.slug = 'point_cloud_library'
self.base_url = 'https://pointclouds.org/documentation/'
self.root_path = 'modules.html'
# Add hierarchy.html to crawl all classes*.html that's not reachable from modules.html
self.initial_paths = [
"https://pointclouds.org/documentation/hierarchy.html"
]
self.links = {
home: 'https://pointclouds.org/',
@ -26,7 +30,7 @@ module Docs
options[:container] = '.contents'
# Skip source code since it doesn't provide any useful docs
options[:skip_patterns] = [/_source/]
options[:skip_patterns] = [/_source/, /namespace/, /h\.html/, /structsvm/, /struct_/, /classopenni/, /class_/]
end
end

Loading…
Cancel
Save