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