Skip to content

Commit 9759b3b

Browse files
committed
Update NumPy documentation (1.20.1)
1 parent aebc4f8 commit 9759b3b

4 files changed

Lines changed: 19 additions & 3 deletions

File tree

assets/javascripts/templates/pages/about_tmpl.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ credits = [
573573
'https://raw.githubusercontent.com/npm/npm/master/LICENSE'
574574
], [
575575
'NumPy',
576-
'2005-2020 NumPy Developers',
576+
'2005-2021 NumPy Developers',
577577
'BSD',
578578
'https://raw.githubusercontent.com/numpy/numpy/master/LICENSE.txt'
579579
], [

lib/docs/filters/numpy/clean_html.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module Docs
22
class Numpy
33
class CleanHtmlFilter < Filter
44
def call
5-
at_css('#spc-section-body')
5+
at_css('#spc-section-body, main > div')
66
end
77
end
88
end

lib/docs/filters/numpy/entries.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ def get_name
1212
end
1313

1414
def get_type
15+
if version >= "1.20"
16+
if slug.start_with?('user')
17+
return 'User Guide'
18+
elsif slug.start_with?('dev')
19+
return 'Development'
20+
end
21+
li_a = css('nav li.active > a')
22+
return li_a.last.content if li_a
23+
end
24+
1525
nav_items = css('.nav.nav-pills.pull-left > li')
1626

1727
if nav_items[5]

lib/docs/scrapers/numpy.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,16 @@ class Numpy < FileScraper
2222
]
2323

2424
options[:attribution] = <<-HTML
25-
&copy; 2005&ndash;2020 NumPy Developers<br>
25+
&copy; 2005&ndash;2021 NumPy Developers<br>
2626
Licensed under the 3-clause BSD License.
2727
HTML
2828

29+
version '1.20' do
30+
self.release = '1.20.1'
31+
self.base_url = "https://numpy.org/doc/#{self.version}/"
32+
options[:container] = nil
33+
end
34+
2935
version '1.19' do
3036
self.release = '1.19.0'
3137
self.base_url = "https://numpy.org/doc/#{self.version}/"

0 commit comments

Comments
 (0)