Showing the changes to lib/docs (2 of 2 files). Show all
Unified · Split
| @@ -2,41 +2,51 @@ module Docs · 1 unmodified line | ||
| 2 | 2 | class PointCloudLibrary |
| 3 | 3 | class EntriesFilter < Docs::EntriesFilter |
| 4 | 4 | def get_type |
| 5 | − if slug.start_with?("group") | |
| 6 | − 'Group' | |
| 5 | + if slug.include?("group__") then | |
| 6 | + tmp = slug.dup | |
| 7 | + tmp.sub! "group__", "" | |
| 8 | + tmp.sub! "__", " " | |
| 9 | + tmp | |
| 7 | 10 | else |
| 8 | − 'Others' | |
| 11 | + "" | |
| 12 | + end | |
| 13 | + end | |
| 14 | + | |
| 15 | + def get_name | |
| 16 | + type = get_type() | |
| 17 | + if type == "" | |
| 18 | + slug | |
| 19 | + else | |
| 20 | + "Module " + type | |
| 9 | 21 | end |
| 10 | 22 | end |
| 11 | 23 | |
| 12 | 24 | def additional_entries |
| 13 | − return [] if root_page? | |
| 25 | + # Only add additional_entries from PointCloudLibrary modules (group__*.html) | |
| 26 | + return [] if not slug.include?("group") | |
| 27 | + entries = [] | |
| 14 | 28 | |
| 15 | 29 | css('table.memberdecls td.memItemRight').map do |node| |
| 16 | − # Get the type of the entry from Doxygen table heading | |
| 17 | − type = node.parent.parent.css("tr.heading").text.strip | |
| 18 | − if type == 'Additional Inherited Members' then | |
| 19 | − return [] | |
| 30 | + href = node.at_css("a").attr('href') | |
| 31 | + if href.index("#").nil? then | |
| 32 | + href += "#" | |
| 20 | 33 | end |
| 21 | 34 | |
| 22 | − # Retrieve HREF link | |
| 23 | − first_link = node.css("a").first | |
| 24 | − if first_link.nil? then | |
| 25 | − return [] | |
| 35 | + # Skip page that's not crawled | |
| 36 | + # TODO: Sync this with options[:skip_patterns] in point_cloud_library.rb | |
| 37 | + if href.include?("namespace") || href.include?("structsvm") || href.include?("classopenni") then | |
| 38 | + next | |
| 26 | 39 | end |
| 27 | − href = first_link['href'] | |
| 28 | − if href.index("#").nil? then | |
| 29 | − # If it doesn't have #, it means it's linking to other page. | |
| 30 | − # So append # at the end to make it work | |
| 31 | − href += "#" | |
| 40 | + | |
| 41 | + # Only add function and classes documentation | |
| 42 | + doxygen_type = node.parent.parent.at_css("tr.heading").text.strip | |
| 43 | + if not(doxygen_type == "Functions" || doxygen_type == "Classes") then | |
| 44 | + next | |
| 32 | 45 | end |
| 33 | 46 | |
| 34 | − [node.content, href, type] | |
| 47 | + entries << [node.content, href] | |
| 35 | 48 | end |
| 36 | − end | |
| 37 | − | |
| 38 | − def include_default_entry? | |
| 39 | − !at_css('.obsolete') | |
| 49 | + entries | |
| 40 | 50 | end |
| 41 | 51 | end |
| 42 | 52 | end |
| @@ -5,6 +5,10 @@ module Docs · 4 unmodified lines | ||
| 5 | 5 | self.slug = 'point_cloud_library' |
| 6 | 6 | self.base_url = 'https://pointclouds.org/documentation/' |
| 7 | 7 | self.root_path = 'modules.html' |
| 8 | + # Add hierarchy.html to crawl all classes*.html that's not reachable from modules.html | |
| 9 | + self.initial_paths = [ | |
| 10 | + "https://pointclouds.org/documentation/hierarchy.html" | |
| 11 | + ] | |
| 8 | 12 | |
| 9 | 13 | self.links = { |
| 10 | 14 | home: 'https://pointclouds.org/', |
| @@ -26,7 +30,7 @@ module Docs · 15 unmodified lines | ||
| 26 | 30 | options[:container] = '.contents' |
| 27 | 31 | |
| 28 | 32 | # Skip source code since it doesn't provide any useful docs |
| 29 | − options[:skip_patterns] = [/_source/] | |
| 33 | + options[:skip_patterns] = [/_source/, /namespace/, /h\.html/, /structsvm/, /struct_/, /classopenni/, /class_/] | |
| 30 | 34 | |
| 31 | 35 | end |
| 32 | 36 | end |