mirror of
https://github.com/freeCodeCamp/devdocs
synced 2024-11-16 19:48:10 +01:00
Statsmodels support
This commit is contained in:
parent
721adf8e21
commit
06f5faeb18
6 changed files with 75 additions and 0 deletions
18
lib/docs/filters/statsmodels/clean_html.rb
Normal file
18
lib/docs/filters/statsmodels/clean_html.rb
Normal 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
|
30
lib/docs/filters/statsmodels/entries.rb
Normal file
30
lib/docs/filters/statsmodels/entries.rb
Normal 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
|
26
lib/docs/scrapers/statsmodels.rb
Normal file
26
lib/docs/scrapers/statsmodels.rb
Normal 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
|
||||
© 2009–2012 Statsmodels Developers<br>
|
||||
© 2006–2008 Scipy Developers<br>
|
||||
© 2006 Jonathan E. Taylor<br>
|
||||
Licensed under the 3-clause BSD License.
|
||||
HTML
|
||||
|
||||
end
|
||||
end
|
BIN
public/icons/docs/statsmodels/16.png
Normal file
BIN
public/icons/docs/statsmodels/16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 832 B |
BIN
public/icons/docs/statsmodels/16@2x.png
Normal file
BIN
public/icons/docs/statsmodels/16@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.2 KiB |
1
public/icons/docs/statsmodels/SOURCE
Normal file
1
public/icons/docs/statsmodels/SOURCE
Normal file
|
@ -0,0 +1 @@
|
|||
http://statsmodels.sourceforge.net/_static/statsmodels_hybi_favico.ico
|
Loading…
Reference in a new issue