Finish scikit-image scraper

pull/481/head
Thibaut Courouble 9 years ago
parent 7f06c9c76e
commit 50f583246d

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

After

Width:  |  Height:  |  Size: 127 KiB

@ -1,7 +1,7 @@
[
[
"2016-09-05",
"New documentations: <a href=\"/fish/\">Fish</a> and <a href=\"/bottle/\">Bottle</a>"
"New documentations: <a href=\"/fish/\">Fish</a>, <a href=\"/bottle/\">Bottle</a> and <a href=\"/scikit_image/\">scikit-image</a>"
], [
"2016-08-07",
"New documentation: <a href=\"/docker/\">Docker</a>"

@ -494,6 +494,11 @@ credits = [
'2006-2016 Hampton Catlin, Nathan Weizenbaum, and Chris Eppstein',
'MIT',
'https://raw.githubusercontent.com/sass/sass/stable/MIT-LICENSE'
], [
'scikit-image',
'2011 the scikit-image team',
'BSD',
'http://scikit-image.org/docs/dev/license.html'
], [
'Sinon',
'2010-2016 Christian Johansen',

@ -117,6 +117,7 @@
._icon-modernizr:before { background-position: -3rem -6rem; }
._icon-bower:before { background-position: -4rem -6rem; }
._icon-fish:before { background-position: -5rem -6rem; @extend %darkIconFix !optional; }
._icon-scikit_image:before { background-position: -6rem -6rem; }
._icon-bottle:before { background-position: 0 -7rem; }
._icon-docker:before { background-position: -1rem -7rem; }
._icon-cakephp:before { background-position: -2rem -7rem; }

@ -1,11 +0,0 @@
module Docs
class ScikitImage
class CleanHtmlFilter < Filter
def call
css('h2').remove
css('h1 + table').remove
doc
end
end
end
end

@ -4,17 +4,27 @@ module Docs
def get_name
name = at_css('h1').content.strip
name.remove! "\u{00b6}"
name.remove! 'Module: '
name.remove! %r{ \(.*\)}
name.downcase!
if slug.start_with?('api')
name.remove! 'Module: '
name.remove! %r{ \(.*\)}
name.downcase!
end
name
end
def get_type
name.split('.').first
if slug.start_with?('api')
name.split('.').first
else
'Guide'
end
end
def additional_entries
return [] unless slug.start_with?('api')
entries = []
css('.class > dt[id]', '.exception > dt[id]', '.attribute > dt[id]').each do |node|
@ -30,8 +40,13 @@ module Docs
css('.function > dt[id]', '.method > dt[id]', '.classmethod > dt[id]').each do |node|
entries << [node['id'].remove('skimage.') + '()', node['id']]
end
entries
end
def include_default_entry?
slug != 'api/api'
end
end
end
end

@ -9,7 +9,7 @@ module Docs
node.remove
end
css('em.xref', 'tt').each do |node|
css('em.xref', 'tt', 'cite').each do |node|
node.name = 'code'
end

@ -3,22 +3,22 @@ module Docs
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.release = '0.12.3'
self.base_url = 'http://scikit-image.org/docs/0.12.x/'
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'
html_filters.push 'scikit_image/entries', 'sphinx/clean_html'
options[:container] = '.span9'
options[:skip] = %w(api_changes.html)
options[:only_patterns] = [/\Aapi/, /\Auser_guide/]
options[:attribution] = <<-HTML
&copy; 2011 the scikit-image development team<br>
Licensed under the scikit-image License.
&copy; 2011 the scikit-image team<br>
Licensed under the BSD 3-clause License.
HTML
end
end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 942 B

After

Width:  |  Height:  |  Size: 881 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Loading…
Cancel
Save