mirror of https://github.com/freeCodeCamp/devdocs
parent
4ed22db333
commit
f8b7cb738e
@ -0,0 +1,43 @@
|
|||||||
|
module Docs
|
||||||
|
class PointCloudLibrary
|
||||||
|
class EntriesFilter < Docs::EntriesFilter
|
||||||
|
def get_type
|
||||||
|
if slug.start_with?("group")
|
||||||
|
'Group'
|
||||||
|
else
|
||||||
|
'Others'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def additional_entries
|
||||||
|
return [] if root_page?
|
||||||
|
|
||||||
|
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 []
|
||||||
|
end
|
||||||
|
|
||||||
|
# Retrieve HREF link
|
||||||
|
first_link = node.css("a").first
|
||||||
|
if first_link.nil? then
|
||||||
|
return []
|
||||||
|
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 += "#"
|
||||||
|
end
|
||||||
|
|
||||||
|
[node.content, href, type]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def include_default_entry?
|
||||||
|
!at_css('.obsolete')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,32 @@
|
|||||||
|
module Docs
|
||||||
|
class PointCloudLibrary < UrlScraper
|
||||||
|
self.name = 'PointCloudLibrary'
|
||||||
|
self.type = 'point_cloud_library'
|
||||||
|
self.slug = 'point_cloud_library'
|
||||||
|
self.base_url = 'https://pointclouds.org/documentation/'
|
||||||
|
self.root_path = 'modules.html'
|
||||||
|
|
||||||
|
self.links = {
|
||||||
|
home: 'https://pointclouds.org/',
|
||||||
|
code: 'https://github.com/PointCloudLibrary/pcl'
|
||||||
|
}
|
||||||
|
|
||||||
|
html_filters.push 'point_cloud_library/entries'
|
||||||
|
|
||||||
|
# Remove the `clean_text` because Doxygen are actually creating empty
|
||||||
|
# anchor such as <a id="asd"></a> to do anchor link.. and that anchor
|
||||||
|
# will be removed by clean_text
|
||||||
|
self.text_filters = FilterStack.new
|
||||||
|
text_filters.push 'images', 'inner_html'
|
||||||
|
|
||||||
|
def get_latest_version(opts)
|
||||||
|
get_latest_github_release('PointCloudLibrary', 'pcl', opts)
|
||||||
|
end
|
||||||
|
|
||||||
|
options[:container] = '.contents'
|
||||||
|
|
||||||
|
# Skip source code since it doesn't provide any useful docs
|
||||||
|
options[:skip_patterns] = [/_source/]
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in new issue