From 56c323653642ea2012c9e010b63131a34024babc Mon Sep 17 00:00:00 2001 From: Phil Scherer Date: Sun, 13 Dec 2020 05:21:25 -0500 Subject: [PATCH] Update scikit-learn documentation (0.23.2) --- .../templates/pages/about_tmpl.coffee | 2 +- lib/docs/filters/scikit_learn/clean_html.rb | 15 ++++++++------- lib/docs/scrapers/scikit_learn.rb | 19 +++++++++++-------- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index 5c83e92b..bf65a3db 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -743,7 +743,7 @@ credits = [ 'http://scikit-image.org/docs/dev/license.html' ], [ 'scikit-learn', - '2007-2018 The scikit-learn developers', + '2007-2020 The scikit-learn developers', 'BSD', 'https://raw.githubusercontent.com/scikit-learn/scikit-learn/master/COPYING' ], [ diff --git a/lib/docs/filters/scikit_learn/clean_html.rb b/lib/docs/filters/scikit_learn/clean_html.rb index 200a31a1..ca95d7f4 100644 --- a/lib/docs/filters/scikit_learn/clean_html.rb +++ b/lib/docs/filters/scikit_learn/clean_html.rb @@ -3,22 +3,23 @@ module Docs class CleanHtmlFilter < Filter def call if root_page? - at_css('h1').content = 'scikit-learn' - - css('.row-fluid').each do |node| + css('.row').each do |node| html = '
' - node.css('.span4').each do |n| - html += "
#{n.first_element_child.inner_html}
" - html += "
#{n.last_element_child.inner_html}
" + node.css('.card-body').each do |n| + html += '
' + html += "#{n.at_css('h4').content}" + html += '
' + html += "
#{n.css('.card-text').to_html}
" end html += '
' node.replace(html) end end + css('.sphx-glr-signature').remove + doc end end end end - diff --git a/lib/docs/scrapers/scikit_learn.rb b/lib/docs/scrapers/scikit_learn.rb index 933484f0..f211d7a5 100644 --- a/lib/docs/scrapers/scikit_learn.rb +++ b/lib/docs/scrapers/scikit_learn.rb @@ -3,25 +3,28 @@ module Docs self.name = 'scikit-learn' self.slug = 'scikit_learn' self.type = 'sphinx' - self.release = '0.20.0' - self.base_url = 'http://scikit-learn.org/stable/' - self.root_path = 'documentation.html' + self.release = '0.23.2' + self.base_url = 'https://scikit-learn.org/0.23/' + self.root_path = 'index.html' self.force_gzip = true self.links = { - home: 'http://scikit-learn.org/', + home: 'https://scikit-learn.org/', code: 'https://github.com/scikit-learn/scikit-learn' } - html_filters.push 'scikit_learn/entries', 'scikit_learn/clean_html', 'sphinx/clean_html' + html_filters.push 'scikit_learn/entries', 'scikit_learn/clean_html', 'sphinx/clean_html', 'title' - options[:container] = ->(filter) { filter.root_page? ? '.container-index' : '.body' } - options[:skip] = %w(tutorial/statistical_inference/finding_help.html) + options[:container] = ->(filter) { filter.root_page? ? 'body > .container' : '.section' } + options[:skip] = %w(modules/generated/sklearn.experimental.enable_iterative_imputer.html + modules/generated/sklearn.experimental.enable_hist_gradient_boosting.html) options[:only_patterns] = [/\Amodules/, /\Adatasets/, /\Atutorial/, /\Aauto_examples/] options[:skip_patterns] = [/\Adatasets\/(?!index)/] + options[:title] = false + options[:root_title] = 'scikit-learn' options[:max_image_size] = 256_000 options[:attribution] = <<-HTML - © 2007–2018 The scikit-learn developers
+ © 2007–2020 The scikit-learn developers
Licensed under the 3-clause BSD License. HTML