mirror of https://github.com/freeCodeCamp/devdocs
+ Scraper definition sourcing from http://scikit-image.org/docs/0.12.x/api/ + Entries filter Added clean_html and scikit_image iconspull/481/head
parent
df2a82f77c
commit
7f06c9c76e
@ -0,0 +1,11 @@
|
|||||||
|
module Docs
|
||||||
|
class ScikitImage
|
||||||
|
class CleanHtmlFilter < Filter
|
||||||
|
def call
|
||||||
|
css('h2').remove
|
||||||
|
css('h1 + table').remove
|
||||||
|
doc
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,37 @@
|
|||||||
|
module Docs
|
||||||
|
class ScikitImage
|
||||||
|
class EntriesFilter < Docs::EntriesFilter
|
||||||
|
def get_name
|
||||||
|
name = at_css('h1').content.strip
|
||||||
|
name.remove! "\u{00b6}"
|
||||||
|
name.remove! 'Module: '
|
||||||
|
name.remove! %r{ \(.*\)}
|
||||||
|
name.downcase!
|
||||||
|
name
|
||||||
|
end
|
||||||
|
|
||||||
|
def get_type
|
||||||
|
name.split('.').first
|
||||||
|
end
|
||||||
|
|
||||||
|
def additional_entries
|
||||||
|
entries = []
|
||||||
|
|
||||||
|
css('.class > dt[id]', '.exception > dt[id]', '.attribute > dt[id]').each do |node|
|
||||||
|
entries << [node['id'].remove('skimage.'), node['id']]
|
||||||
|
end
|
||||||
|
|
||||||
|
css('.data > dt[id]').each do |node|
|
||||||
|
if node['id'].split('.').last.upcase!
|
||||||
|
entries << [node['id'].remove('skimage.'), node['id']]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
css('.function > dt[id]', '.method > dt[id]', '.classmethod > dt[id]').each do |node|
|
||||||
|
entries << [node['id'].remove('skimage.') + '()', node['id']]
|
||||||
|
end
|
||||||
|
entries
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,24 @@
|
|||||||
|
module Docs
|
||||||
|
class ScikitImage < UrlScraper
|
||||||
|
self.name = 'scikit-image'
|
||||||
|
self.slug = 'scikit_image'
|
||||||
|
self.type = 'sphinx'
|
||||||
|
self.release = '0.12.2'
|
||||||
|
self.base_url = 'http://scikit-image.org/docs/0.12.x/api/'
|
||||||
|
self.root_path = 'api.html'
|
||||||
|
|
||||||
|
self.links = {
|
||||||
|
home: 'http://scikit-image.org/',
|
||||||
|
code: 'https://github.com/scikit-image/scikit-image'
|
||||||
|
}
|
||||||
|
|
||||||
|
html_filters.push 'scikit_image/entries', 'scikit_image/clean_html', 'sphinx/clean_html'
|
||||||
|
|
||||||
|
options[:container] = '.span9'
|
||||||
|
|
||||||
|
options[:attribution] = <<-HTML
|
||||||
|
© 2011 the scikit-image development team<br>
|
||||||
|
Licensed under the scikit-image License.
|
||||||
|
HTML
|
||||||
|
end
|
||||||
|
end
|
After Width: | Height: | Size: 942 B |
After Width: | Height: | Size: 2.7 KiB |
@ -0,0 +1 @@
|
|||||||
|
https://github.com/scikit-image/scikit-image/blob/master/doc/source/themes/scikit-image/static/img/favicon.ico
|
Loading…
Reference in new issue