Finish Statsmodels scraper

pull/511/head
Thibaut Courouble 8 years ago
parent 06f5faeb18
commit 4847917e61

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB

After

Width:  |  Height:  |  Size: 133 KiB

@ -1,7 +1,7 @@
[
[
"2016-10-10",
"New documentation: <a href=\"/scikit_learn/\">scikit-learn</a>"
"New documentations: <a href=\"/scikit_learn/\">scikit-learn</a> and <a href=\"/statsmodels/\">Statsmodels</a>"
], [
"2016-09-18",
"New documentations: <a href=\"/pandas/\">pandas</a> and <a href=\"/twig/\">Twig</a>"

@ -519,6 +519,11 @@ credits = [
'2014-2015 Automattic',
'MIT',
'https://raw.githubusercontent.com/Automattic/socket.io/master/LICENSE'
], [
'Statsmodels',
'2009-2012 Statsmodels Developers<br>&copy; 2006-2008 Scipy Developers<br>&copy; 2006 Jonathan E. Taylor',
'BSD',
'https://raw.githubusercontent.com/statsmodels/statsmodels/master/LICENSE.txt'
], [
'Symfony',
'2004-2016 Fabien Potencier',

@ -88,6 +88,7 @@
._icon-knockout:before { background-position: -5rem -3rem; }
._icon-moment:before { background-position: -6rem -3rem; @extend %darkIconFix !optional; }
._icon-c:before { background-position: -7rem -3rem; }
._icon-statsmodels:before { background-position: -8rem -3rem; }
._icon-yii:before,
._icon-yii1:before { background-position: -9rem -3rem; }
._icon-cpp:before { background-position: 0 -4rem; }

@ -13,8 +13,6 @@ module Docs
node.before(node.children).remove
end
css('.anchor-link').remove
doc
end
end

@ -2,7 +2,7 @@ module Docs
class Sphinx
class CleanHtmlFilter < Filter
def call
css('.headerlink', 'hr', '#contents .topic-title', '#topics .topic-title', 'colgroup', '.line-block').remove
css('.headerlink', 'hr', '#contents .topic-title', '#topics .topic-title', 'colgroup', '.line-block', '.anchor-link').remove
css('.contents > ul:first-child:last-child.simple > li:first-child:last-child').each do |node|
node.parent.before(node.at_css('> ul')) if node.at_css('> ul')

@ -5,10 +5,10 @@ module Docs
@doc = at_css('.body')
if root_page?
at_css('h1').content = 'Statsmodels'
at_css('#basic-documentation').remove
at_css('#table-of-contents').remove
at_css('#indices-and-tables').remove
at_css('h1').content = 'Statsmodels'
at_css('#basic-documentation').remove
at_css('#table-of-contents').remove
at_css('#indices-and-tables').remove
end
doc

@ -6,9 +6,12 @@ module Docs
name = at_css('dt').content.strip
name.sub! %r{\(.*}, '()' # Remove method arguments
name.remove! %r{[\=\[].*} # Remove "[source]"
name.remove! %r{\A(class(method)?) (statsmodels\.)?}
name.remove! %r{\A(class(method)?) }
name.remove! %r{\Astatsmodels\.}
else
name = at_css('h1').content.strip
name.prepend 'Manual: ' if type == 'Manual'
name.prepend 'Example: ' if type == 'Examples'
end
name.remove! "\u{00B6}" # Remove ¶
name

@ -1,9 +1,8 @@
module Docs
class Statsmodels < UrlScraper
self.name = 'Statsmodels'
self.type = 'sphinx'
self.release = '0.6.1'
self.base_url = "http://statsmodels.sourceforge.net/stable/"
self.base_url = 'http://statsmodels.sourceforge.net/stable/'
self.root_path = 'index.html'
self.links = {
home: 'http://statsmodels.sourceforge.net/',
@ -12,7 +11,7 @@ module Docs
html_filters.push 'statsmodels/entries', 'statsmodels/clean_html', 'sphinx/clean_html'
options[:skip] = %w(about.html)
options[:skip] = %w(about.html search.html genindex.html)
options[:skip_patterns] = [/\Arelease/, /\Adev/, /\A_modules/, /\Adatasets/]
options[:attribution] = <<-HTML

Binary file not shown.

Before

Width:  |  Height:  |  Size: 832 B

After

Width:  |  Height:  |  Size: 571 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Loading…
Cancel
Save