History

Finish Statsmodels scraper

Thibaut Courouble committed 10 years ago

Commit 48479171 parent 06f5fae12 files · +14 −8Browse files

Unified · Split

12 files
  1. assets/images/docs.png +0 −0
  2. assets/images/docs@2x.png +0 −0
  3. assets/javascripts/news.json +1 −1
  4. assets/javascripts/templates/pages/about_tmpl.coffee +5 −0
  5. assets/stylesheets/global/_icons.scss +1 −0
  6. lib/docs/filters/pandas/clean_html.rb +0 −2
  7. lib/docs/filters/sphinx/clean_html.rb +1 −1
  8. lib/docs/filters/statsmodels/clean_html.rb +4 −4
  9. lib/docs/filters/statsmodels/entries.rb +4 −1
  10. lib/docs/scrapers/statsmodels.rb +2 −3
  11. public/icons/docs/statsmodels/16.png +0 −0
  12. public/icons/docs/statsmodels/16@2x.png +0 −0
assets/images/docs.png+0−0

Binary file not shown.

assets/images/docs@2x.png+0−0

Binary file not shown.

assets/javascripts/news.json+1−1
@@ -1,7 +1,7 @@
11 [
22 [
33 "2016-10-10",
4− "New documentation: <a href=\"/scikit_learn/\">scikit-learn</a>"
4+ "New documentations: <a href=\"/scikit_learn/\">scikit-learn</a> and <a href=\"/statsmodels/\">Statsmodels</a>"
55 ], [
66 "2016-09-18",
77 "New documentations: <a href=\"/pandas/\">pandas</a> and <a href=\"/twig/\">Twig</a>"
assets/javascripts/templates/pages/about_tmpl.coffee+5−0
@@ -519,6 +519,11 @@ credits = [ · 518 unmodified lines
519519 '2014-2015 Automattic',
520520 'MIT',
521521 'https://raw.githubusercontent.com/Automattic/socket.io/master/LICENSE'
522+ ], [
523+ 'Statsmodels',
524+ '2009-2012 Statsmodels Developers<br>&copy; 2006-2008 Scipy Developers<br>&copy; 2006 Jonathan E. Taylor',
525+ 'BSD',
526+ 'https://raw.githubusercontent.com/statsmodels/statsmodels/master/LICENSE.txt'
522527 ], [
523528 'Symfony',
524529 '2004-2016 Fabien Potencier',
assets/stylesheets/global/_icons.scss+1−0
@@ -88,6 +88,7 @@ · 87 unmodified lines
8888 ._icon-knockout:before { background-position: -5rem -3rem; }
8989 ._icon-moment:before { background-position: -6rem -3rem; @extend %darkIconFix !optional; }
9090 ._icon-c:before { background-position: -7rem -3rem; }
91+._icon-statsmodels:before { background-position: -8rem -3rem; }
9192 ._icon-yii:before,
9293 ._icon-yii1:before { background-position: -9rem -3rem; }
9394 ._icon-cpp:before { background-position: 0 -4rem; }
lib/docs/filters/pandas/clean_html.rb+0−2
@@ -13,8 +13,6 @@ module Docs · 12 unmodified lines
1313 node.before(node.children).remove
1414 end
1515
16− css('.anchor-link').remove
17−
1816 doc
1917 end
2018 end
lib/docs/filters/sphinx/clean_html.rb+1−1
@@ -2,7 +2,7 @@ module Docs · 1 unmodified line
22 class Sphinx
33 class CleanHtmlFilter < Filter
44 def call
5− css('.headerlink', 'hr', '#contents .topic-title', '#topics .topic-title', 'colgroup', '.line-block').remove
5+ css('.headerlink', 'hr', '#contents .topic-title', '#topics .topic-title', 'colgroup', '.line-block', '.anchor-link').remove
66
77 css('.contents > ul:first-child:last-child.simple > li:first-child:last-child').each do |node|
88 node.parent.before(node.at_css('> ul')) if node.at_css('> ul')
lib/docs/filters/statsmodels/clean_html.rb+4−4
@@ -5,10 +5,10 @@ module Docs · 4 unmodified lines
55 @doc = at_css('.body')
66
77 if root_page?
8− at_css('h1').content = 'Statsmodels'
9− at_css('#basic-documentation').remove
10− at_css('#table-of-contents').remove
11− at_css('#indices-and-tables').remove
8+ at_css('h1').content = 'Statsmodels'
9+ at_css('#basic-documentation').remove
10+ at_css('#table-of-contents').remove
11+ at_css('#indices-and-tables').remove
1212 end
1313
1414 doc
lib/docs/filters/statsmodels/entries.rb+4−1
@@ -6,9 +6,12 @@ module Docs · 5 unmodified lines
66 name = at_css('dt').content.strip
77 name.sub! %r{\(.*}, '()' # Remove method arguments
88 name.remove! %r{[\=\[].*} # Remove "[source]"
9− name.remove! %r{\A(class(method)?) (statsmodels\.)?}
9+ name.remove! %r{\A(class(method)?) }
10+ name.remove! %r{\Astatsmodels\.}
1011 else
1112 name = at_css('h1').content.strip
13+ name.prepend 'Manual: ' if type == 'Manual'
14+ name.prepend 'Example: ' if type == 'Examples'
1215 end
1316 name.remove! "\u{00B6}" # Remove ¶
1417 name
lib/docs/scrapers/statsmodels.rb+2−3
@@ -1,9 +1,8 @@
11 module Docs
22 class Statsmodels < UrlScraper
3− self.name = 'Statsmodels'
43 self.type = 'sphinx'
54 self.release = '0.6.1'
6− self.base_url = "http://statsmodels.sourceforge.net/stable/"
5+ self.base_url = 'http://statsmodels.sourceforge.net/stable/'
76 self.root_path = 'index.html'
87 self.links = {
98 home: 'http://statsmodels.sourceforge.net/',
@@ -12,7 +11,7 @@ module Docs · 2 unmodified lines
1211
1312 html_filters.push 'statsmodels/entries', 'statsmodels/clean_html', 'sphinx/clean_html'
1413
15− options[:skip] = %w(about.html)
14+ options[:skip] = %w(about.html search.html genindex.html)
1615 options[:skip_patterns] = [/\Arelease/, /\Adev/, /\A_modules/, /\Adatasets/]
1716
1817 options[:attribution] = <<-HTML
public/icons/docs/statsmodels/16.png+0−0

Binary file not shown.

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

Binary file not shown.