- Add version 1 of pandas, add new filters for this version - Pandas' web page changed but the page for older version is the same, for that reason new filters are added and the name old ones are changed
Unified · Split
| @@ -573,7 +573,7 @@ credits = [ · 572 unmodified lines | ||
| 573 | 573 | 'https://raw.githubusercontent.com/padrino/padrino-framework/master/padrino/LICENSE.txt' |
| 574 | 574 | ], [ |
| 575 | 575 | 'pandas', |
| 576 | − '2008-2012, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team', | |
| 576 | + '2008-2020, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team', | |
| 577 | 577 | 'BSD', |
| 578 | 578 | 'https://raw.githubusercontent.com/pydata/pandas/master/LICENSE' |
| 579 | 579 | ], [ |
| @@ -2,16 +2,22 @@ module Docs · 1 unmodified line | ||
| 2 | 2 | class Pandas |
| 3 | 3 | class CleanHtmlFilter < Filter |
| 4 | 4 | def call |
| 5 | − @doc = at_css('.body') | |
| 6 | 5 | |
| 7 | − if root_page? | |
| 8 | − css('a[href$=".zip"]', 'a[href$=".pdf"]', '.toctree-wrapper').remove | |
| 9 | − at_css('h1').content = 'pandas' | |
| 10 | − end | |
| 6 | + css('#navbar-main').remove | |
| 11 | 7 | |
| 12 | − css('h2 > a.reference', 'h3 > a.reference').each do |node| | |
| 13 | − node.before(node.children).remove | |
| 14 | − end | |
| 8 | + css('form').remove | |
| 9 | + | |
| 10 | + # sidebar | |
| 11 | + css('ul.nav.bd-sidenav').remove | |
| 12 | + | |
| 13 | + # title side symbol | |
| 14 | + css('.headerlink').remove | |
| 15 | + | |
| 16 | + # next and previous section buttons | |
| 17 | + css('next-link').remove | |
| 18 | + css('prev-link').remove | |
| 19 | + | |
| 20 | + css('footer').remove | |
| 15 | 21 | |
| 16 | 22 | doc |
| 17 | 23 | end |
| @@ -0,0 +1,20 @@ | ||
| 1 | +module Docs | |
| 2 | + class Pandas | |
| 3 | + class CleanHtmlOldFilter < Filter | |
| 4 | + def call | |
| 5 | + @doc = at_css('.body') | |
| 6 | + | |
| 7 | + if root_page? | |
| 8 | + css('a[href$=".zip"]', 'a[href$=".pdf"]', '.toctree-wrapper').remove | |
| 9 | + at_css('h1').content = 'pandas' | |
| 10 | + end | |
| 11 | + | |
| 12 | + css('h2 > a.reference', 'h3 > a.reference').each do |node| | |
| 13 | + node.before(node.children).remove | |
| 14 | + end | |
| 15 | + | |
| 16 | + doc | |
| 17 | + end | |
| 18 | + end | |
| 19 | + end | |
| 20 | +end | |
| @@ -1,29 +1,29 @@ | ||
| 1 | 1 | module Docs |
| 2 | 2 | class Pandas |
| 3 | 3 | class EntriesFilter < Docs::EntriesFilter |
| 4 | + | |
| 4 | 5 | def get_name |
| 5 | − if subpath.start_with?('generated') || (subpath.include?('reference') && !subpath.include?('reference/index')) | |
| 6 | − name_node = at_css('dt') | |
| 7 | − name_node = at_css('h1') if name_node.nil? | |
| 8 | − name = name_node.content.strip | |
| 9 | − name.sub! %r{\(.*}, '()' | |
| 10 | − name.remove! %r{\s=.*} | |
| 11 | − name.remove! %r{\A(class(method)?) (pandas\.)?} | |
| 12 | − else | |
| 13 | − name = at_css('h1').content.strip | |
| 14 | − name.prepend "#{css('.toctree-l1 > a:not([href^="http"])').to_a.index(at_css('.toctree-l1.current > a')) + 1}. " | |
| 15 | − end | |
| 16 | − name.remove! "\u{00B6}" | |
| 17 | − name | |
| 6 | + at_css('h1').content | |
| 18 | 7 | end |
| 19 | 8 | |
| 20 | 9 | def get_type |
| 21 | − if subpath.start_with?('generated') || (subpath.include?('reference') && !subpath.include?('reference/index')) | |
| 22 | − css('.toctree-l2.current > a').last.content.remove(/\s\(.+?\)/) | |
| 23 | − else | |
| 24 | − 'Manual' | |
| 25 | − end | |
| 10 | + return 'Manual' if slug.include?('user_guide') | |
| 11 | + return 'General utility functions' if slug.match?('option|assert|errors|types|show_versions') | |
| 12 | + return 'Extensions' if slug.match?(/extensions|check_array/) | |
| 13 | + return 'Style' if slug.match?(/style/) | |
| 14 | + return 'Input/output' if slug.match?(/read|io|HDFStore/) | |
| 15 | + return 'Series' if slug.match?(/Series/) | |
| 16 | + return 'GroupBy' if slug.match?(/groupby|Grouper/) | |
| 17 | + return 'DataFrame' if slug.match?(/DataFrame|frame/) | |
| 18 | + return 'Window' if slug.match?(/window|indexers/) | |
| 19 | + return 'Index Objects' if slug.match?(/Index|indexing/) | |
| 20 | + return 'Data offsets' if slug.match?(/offsets?/) | |
| 21 | + return 'Resampling' if slug.match?(/resample/) | |
| 22 | + return 'Plotting' if slug.match?(/plotting/) | |
| 23 | + return 'Pandas arrays' if slug.match?(/arrays?|Timestamp|Datetime|Timedelta|Period|Interval|Categorical|Dtype/) | |
| 24 | + 'General functions' | |
| 26 | 25 | end |
| 26 | + | |
| 27 | 27 | end |
| 28 | 28 | end |
| 29 | 29 | end |
| @@ -0,0 +1,29 @@ | ||
| 1 | +module Docs | |
| 2 | + class Pandas | |
| 3 | + class EntriesOldFilter < Docs::EntriesFilter | |
| 4 | + def get_name | |
| 5 | + if subpath.start_with?('generated') || (subpath.include?('reference') && !subpath.include?('reference/index')) | |
| 6 | + name_node = at_css('dt') | |
| 7 | + name_node = at_css('h1') if name_node.nil? | |
| 8 | + name = name_node.content.strip | |
| 9 | + name.sub! %r{\(.*}, '()' | |
| 10 | + name.remove! %r{\s=.*} | |
| 11 | + name.remove! %r{\A(class(method)?) (pandas\.)?} | |
| 12 | + else | |
| 13 | + name = at_css('h1').content.strip | |
| 14 | + name.prepend "#{css('.toctree-l1 > a:not([href^="http"])').to_a.index(at_css('.toctree-l1.current > a')) + 1}. " | |
| 15 | + end | |
| 16 | + name.remove! "\u{00B6}" | |
| 17 | + name | |
| 18 | + end | |
| 19 | + | |
| 20 | + def get_type | |
| 21 | + if subpath.start_with?('generated') || (subpath.include?('reference') && !subpath.include?('reference/index')) | |
| 22 | + css('.toctree-l2.current > a').last.content.remove(/\s\(.+?\)/) | |
| 23 | + else | |
| 24 | + 'Manual' | |
| 25 | + end | |
| 26 | + end | |
| 27 | + end | |
| 28 | + end | |
| 29 | +end | |
| @@ -4,61 +4,117 @@ module Docs · 3 unmodified lines | ||
| 4 | 4 | self.type = 'sphinx' |
| 5 | 5 | self.root_path = 'index.html' |
| 6 | 6 | self.links = { |
| 7 | − home: 'http://pandas.pydata.org/', | |
| 7 | + home: 'https://pandas.pydata.org/', | |
| 8 | 8 | code: 'https://github.com/pydata/pandas' |
| 9 | 9 | } |
| 10 | 10 | |
| 11 | − html_filters.push 'pandas/entries', 'pandas/clean_html', 'sphinx/clean_html' | |
| 12 | − | |
| 13 | − # Cannot take only the body, as the sidebar gives info about the type. | |
| 14 | − options[:container] = '.document' | |
| 11 | + html_filters.push 'pandas/clean_html', 'pandas/entries' | |
| 15 | 12 | |
| 16 | 13 | options[:skip] = %w(internals.html release.html contributing.html whatsnew.html) |
| 17 | 14 | options[:skip_patterns] = [/whatsnew\//] |
| 18 | 15 | |
| 19 | 16 | options[:attribution] = <<-HTML |
| 20 | − © 2008–2012, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team<br> | |
| 17 | + © 2008–2020, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team<br> | |
| 21 | 18 | Licensed under the 3-clause BSD License. |
| 22 | 19 | HTML |
| 23 | 20 | |
| 21 | + version '1' do | |
| 22 | + self.release = '1.1.4' | |
| 23 | + self.base_url = "https://pandas.pydata.org/pandas-docs/version/#{self.release}/" | |
| 24 | + | |
| 25 | + html_filters.push 'pandas/clean_html', 'pandas/entries' | |
| 26 | + | |
| 27 | + options[:skip_patterns] = [ | |
| 28 | + /development/, | |
| 29 | + /getting_started/, | |
| 30 | + /whatsnew/ | |
| 31 | + ] | |
| 32 | + | |
| 33 | + options[:skip] = [ | |
| 34 | + 'panel.html', | |
| 35 | + 'pandas.pdf', | |
| 36 | + 'pandas.zip', | |
| 37 | + 'ecosystem.html' | |
| 38 | + ] | |
| 39 | + | |
| 40 | + end | |
| 41 | + | |
| 24 | 42 | version '0.25' do |
| 25 | 43 | self.release = '0.25.0' |
| 26 | 44 | self.base_url = "https://pandas.pydata.org/pandas-docs/version/#{self.release}/" |
| 45 | + | |
| 46 | + html_filters.push 'pandas/entries_old', 'pandas/clean_html_old', 'sphinx/clean_html' | |
| 47 | + | |
| 48 | + options[:container] = '.document' | |
| 49 | + | |
| 27 | 50 | end |
| 28 | 51 | |
| 29 | 52 | version '0.24' do |
| 30 | 53 | self.release = '0.24.2' |
| 31 | 54 | self.base_url = "https://pandas.pydata.org/pandas-docs/version/#{self.release}/" |
| 55 | + | |
| 56 | + html_filters.push 'pandas/entries_old', 'pandas/clean_html_old', 'sphinx/clean_html' | |
| 57 | + options[:container] = '.document' | |
| 58 | + | |
| 32 | 59 | end |
| 33 | 60 | |
| 34 | 61 | version '0.23' do |
| 35 | 62 | self.release = '0.23.4' |
| 36 | 63 | self.base_url = "https://pandas.pydata.org/pandas-docs/version/#{self.release}/" |
| 64 | + | |
| 65 | + html_filters.push 'pandas/entries_old', 'pandas/clean_html_old', 'sphinx/clean_html' | |
| 66 | + options[:container] = '.document' | |
| 67 | + | |
| 37 | 68 | end |
| 38 | 69 | |
| 39 | 70 | version '0.22' do |
| 40 | 71 | self.release = '0.22.0' |
| 41 | 72 | self.base_url = "https://pandas.pydata.org/pandas-docs/version/#{self.release}/" |
| 73 | + | |
| 74 | + html_filters.push 'pandas/entries_old', 'pandas/clean_html_old', 'sphinx/clean_html' | |
| 75 | + | |
| 76 | + options[:container] = '.document' | |
| 77 | + | |
| 42 | 78 | end |
| 43 | 79 | |
| 44 | 80 | version '0.21' do |
| 45 | 81 | self.release = '0.21.1' |
| 46 | 82 | self.base_url = "https://pandas.pydata.org/pandas-docs/version/#{self.release}/" |
| 83 | + | |
| 84 | + html_filters.push 'pandas/entries_old', 'pandas/clean_html_old', 'sphinx/clean_html' | |
| 85 | + | |
| 86 | + options[:container] = '.document' | |
| 87 | + | |
| 47 | 88 | end |
| 48 | 89 | |
| 49 | 90 | version '0.20' do |
| 50 | 91 | self.release = '0.20.3' |
| 51 | 92 | self.base_url = "https://pandas.pydata.org/pandas-docs/version/#{self.release}/" |
| 93 | + | |
| 94 | + html_filters.push 'pandas/entries_old', 'pandas/clean_html_old', 'sphinx/clean_html' | |
| 95 | + | |
| 96 | + options[:container] = '.document' | |
| 97 | + | |
| 52 | 98 | end |
| 53 | 99 | |
| 54 | 100 | version '0.19' do |
| 55 | 101 | self.release = '0.19.2' |
| 56 | 102 | self.base_url = "https://pandas.pydata.org/pandas-docs/version/#{self.release}/" |
| 103 | + | |
| 104 | + html_filters.push 'pandas/entries_old', 'pandas/clean_html_old', 'sphinx/clean_html' | |
| 105 | + | |
| 106 | + options[:container] = '.document' | |
| 107 | + | |
| 57 | 108 | end |
| 58 | 109 | |
| 59 | 110 | version '0.18' do |
| 60 | 111 | self.release = '0.18.1' |
| 61 | 112 | self.base_url = "https://pandas.pydata.org/pandas-docs/version/#{self.release}/" |
| 113 | + | |
| 114 | + html_filters.push 'pandas/entries_old', 'pandas/clean_html_old', 'sphinx/clean_html' | |
| 115 | + | |
| 116 | + options[:container] = '.document' | |
| 117 | + | |
| 62 | 118 | end |
| 63 | 119 | |
| 64 | 120 | def get_latest_version(opts) |
Binary file not shown.
Binary file not shown.
| @@ -1 +1 @@ | ||
| 1 | −http://pandas.pydata.org/_static/pandas_logo.png | |
| 1 | +https://commons.wikimedia.org/wiki/File:Pandas_mark.svg | |