Statsmodels support

This commit is contained in:
japborst 2016-10-02 18:31:55 +02:00 committed by Thibaut Courouble
parent 721adf8e21
commit 06f5faeb18
6 changed files with 75 additions and 0 deletions

View file

@ -0,0 +1,18 @@
module Docs
class Statsmodels
class CleanHtmlFilter < Filter
def call
@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
end
doc
end
end
end
end

View file

@ -0,0 +1,30 @@
module Docs
class Statsmodels
class EntriesFilter < Docs::EntriesFilter
def get_name
if subpath.start_with?('generated')
name = at_css('dt').content.strip
name.sub! %r{\(.*}, '()' # Remove method arguments
name.remove! %r{[\=\[].*} # Remove "[source]"
name.remove! %r{\A(class(method)?) (statsmodels\.)?}
else
name = at_css('h1').content.strip
end
name.remove! "\u{00B6}" # Remove ¶
name
end
def get_type
if subpath.start_with?('generated')
# '> text()' doesn't include children's text in type naming
at_xpath('//div[@class="related"]//li[not(@class="right")][7]/a/text()').content
elsif subpath.start_with?('examples')
'Examples'
else
'Manual'
end
end
end
end
end

View file

@ -0,0 +1,26 @@
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.root_path = 'index.html'
self.links = {
home: 'http://statsmodels.sourceforge.net/',
code: 'https://github.com/statsmodels/statsmodels/'
}
html_filters.push 'statsmodels/entries', 'statsmodels/clean_html', 'sphinx/clean_html'
options[:skip] = %w(about.html)
options[:skip_patterns] = [/\Arelease/, /\Adev/, /\A_modules/, /\Adatasets/]
options[:attribution] = <<-HTML
&copy; 2009&ndash;2012 Statsmodels Developers<br>
&copy; 2006&ndash;2008 Scipy Developers<br>
&copy; 2006 Jonathan E. Taylor<br>
Licensed under the 3-clause BSD License.
HTML
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 832 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

@ -0,0 +1 @@
http://statsmodels.sourceforge.net/_static/statsmodels_hybi_favico.ico