History

Merge pull request #1680 from ardiya/add_pcl

Add PointCloudLibrary to devdocs

Simon Legner committed 4 years ago

Commit 6ca82ce2 parents 4ed22db a0e3b6f8 files · +106 −-2Browse files

Unified · Split

8 files
  1. assets/javascripts/news.json +4 −0
  2. assets/javascripts/templates/pages/about_tmpl.coffee +5 −0
  3. lib/docs/filters/point_cloud_library/clean_html.rb +12 −0
  4. lib/docs/filters/point_cloud_library/entries.rb +45 −0
  5. lib/docs/scrapers/point_cloud_library.rb +41 −0
  6. public/icons/docs/point_cloud_library/16.png +0 −0
  7. public/icons/docs/point_cloud_library/16@2x.png +0 −0
  8. public/icons/docs/point_cloud_library/SOURCE +1 −0
assets/javascripts/news.json+4−0
@@ -1,4 +1,8 @@
11 [
2+ [
3+ "2021-12-29",
4+ "New documentation: <a href=\"/point_cloud_library/\">PointCloudLibrary</a>"
5+ ],
26 [
37 "2021-12-27",
48 "New documentation: <a href=\"/zig/\">Zig</a>"
assets/javascripts/templates/pages/about_tmpl.coffee+5−0
@@ -657,6 +657,11 @@ credits = [ · 656 unmodified lines
657657 '2005-2017 Sebastian Bergmann',
658658 'CC BY',
659659 'https://creativecommons.org/licenses/by/3.0/'
660+ ], [
661+ 'PointCloudLibrary',
662+ '2009–2012, Willow Garage, Inc.<br>&copy; 2012–, Open Perception, Inc.',
663+ 'BSD',
664+ 'https://raw.githubusercontent.com/PointCloudLibrary/pcl/master/LICENSE.txt'
660665 ], [
661666 'Pony',
662667 '2016-2020, The Pony Developers & 2014-2015, Causality Ltd.',
lib/docs/filters/point_cloud_library/clean_html.rb+12−0
@@ -0,0 +1,12 @@
1+module Docs
2+ class PointCloudLibrary
3+ class CleanHtmlFilter < Filter
4+ def call
5+ @doc = at_css('.contents')
6+ css('.dynheader.closed').remove
7+ css('.permalink').remove
8+ doc
9+ end
10+ end
11+ end
12+end
lib/docs/filters/point_cloud_library/entries.rb+45−0
@@ -0,0 +1,45 @@
1+module Docs
2+ class PointCloudLibrary
3+ class EntriesFilter < Docs::EntriesFilter
4+ def get_type
5+ group = at_css('.title .ingroups')
6+ return group.content unless group.nil?
7+ name = get_name
8+ return 'pcl' unless name.match(/^pcl::.*::/)
9+ name.gsub(/^pcl::/, '').gsub(/::.*/, '')
10+ end
11+
12+ def get_name
13+ at_css('.title').content.gsub(/[<(].*/, '')
14+ end
15+
16+ def additional_entries
17+ # Only add additional_entries from PointCloudLibrary modules (group__*.html)
18+ return [] if not slug.include?("group")
19+ entries = []
20+
21+ css('table.memberdecls td.memItemRight').map do |node|
22+ href = node.at_css("a").attr('href')
23+ if href.index("#").nil? then
24+ href += "#"
25+ end
26+
27+ # Skip page that's not crawled
28+ # TODO: Sync this with options[:skip_patterns] in point_cloud_library.rb
29+ if href.include?("namespace") || href.include?("structsvm") || href.include?("classopenni") then
30+ next
31+ end
32+
33+ # Only add function and classes documentation
34+ doxygen_type = node.parent.parent.at_css("tr.heading").text.strip
35+ if not(doxygen_type == "Functions" || doxygen_type == "Classes") then
36+ next
37+ end
38+
39+ entries << [node.content, href]
40+ end
41+ entries
42+ end
43+ end
44+ end
45+end
lib/docs/scrapers/point_cloud_library.rb+41−0
@@ -0,0 +1,41 @@
1+module Docs
2+ class PointCloudLibrary < UrlScraper
3+ self.name = 'PointCloudLibrary'
4+ self.type = 'point_cloud_library'
5+ self.slug = 'point_cloud_library'
6+ self.base_url = 'https://pointclouds.org/documentation/'
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+ ]
12+ self.release = '1.12.1'
13+
14+ self.links = {
15+ home: 'https://pointclouds.org/',
16+ code: 'https://github.com/PointCloudLibrary/pcl'
17+ }
18+
19+ html_filters.push 'point_cloud_library/entries', 'point_cloud_library/clean_html'
20+
21+ # Remove the `clean_text` because Doxygen are actually creating empty
22+ # anchor such as <a id="asd"></a> to do anchor link.. and that anchor
23+ # will be removed by clean_text
24+ self.text_filters = FilterStack.new
25+ text_filters.push 'images', 'inner_html', 'attribution'
26+
27+ def get_latest_version(opts)
28+ get_latest_github_release('PointCloudLibrary', 'pcl', opts)[4..]
29+ end
30+
31+ options[:attribution] = <<-HTML
32+ &copy; 2009–2012, Willow Garage, Inc.<br>
33+ &copy; 2012–, Open Perception, Inc.<br>
34+ Licensed under the BSD License.
35+ HTML
36+
37+ # Skip source code since it doesn't provide any useful docs
38+ options[:skip_patterns] = [/_source/, /namespace/, /h\.html/, /structsvm/, /struct_/, /classopenni/, /class_/]
39+
40+ end
41+end
public/icons/docs/point_cloud_library/16.png+0−0

Binary file not shown.

public/icons/docs/point_cloud_library/16@2x.png+0−0

Binary file not shown.

public/icons/docs/point_cloud_library/SOURCE+1−0
@@ -0,0 +1 @@
1+https://github.com/PointCloudLibrary/pcl/blob/master/pcl.png