Update NumPy documentation (1.23.0)

This commit is contained in:
Simon Legner 2022-10-03 22:35:59 +02:00
parent 6745e65a84
commit 526cc1a80a
3 changed files with 21 additions and 11 deletions

View file

@ -623,7 +623,7 @@ credits = [
'https://raw.githubusercontent.com/npm/npm/master/LICENSE' 'https://raw.githubusercontent.com/npm/npm/master/LICENSE'
], [ ], [
'NumPy', 'NumPy',
'2005-2021 NumPy Developers', '2005-2022 NumPy Developers',
'BSD', 'BSD',
'https://raw.githubusercontent.com/numpy/numpy/master/LICENSE.txt' 'https://raw.githubusercontent.com/numpy/numpy/master/LICENSE.txt'
], [ ], [

View file

@ -5,9 +5,9 @@ module Docs
if dt = at_css('dt') if dt = at_css('dt')
name = dt_to_name(dt) name = dt_to_name(dt)
else else
name = at_css('h1').content.strip name = at_xpath('//h1/text()').text.strip
end end
name.remove! "\u{00B6}" name.remove! %r{#\Z}
name name
end end
@ -18,8 +18,12 @@ module Docs
elsif slug.start_with?('dev') elsif slug.start_with?('dev')
return 'Development' return 'Development'
end end
li_a = css('nav li.active > a') if css('nav li.toctree-l2.active .toctree-l3').length > 7
return li_a.last.content if li_a && li_a.last li_a = css('nav li.toctree-l2.active > a')
else
li_a = css('nav li.toctree-l1.active > a')
end
return li_a.last.xpath('./text()').text.remove('( )').strip if li_a && li_a.last
end end
nav_items = css('.nav.nav-pills.pull-left > li') nav_items = css('.nav.nav-pills.pull-left > li')
@ -29,8 +33,8 @@ module Docs
elsif nav_items[4] && nav_items[4].content !~ /Manual|Reference/ elsif nav_items[4] && nav_items[4].content !~ /Manual|Reference/
type = nav_items[4].content type = nav_items[4].content
else else
type = at_css('h1').content.strip type = at_xpath('//h1/text()').text.strip
type.remove! "\u{00B6}" type.remove! %r{#\Z}
# Handle some edge cases that aren't properly categorized in the docs # Handle some edge cases that aren't properly categorized in the docs
if type.start_with?('numpy.polynomial.') || type.start_with?('numpy.poly1d.') if type.start_with?('numpy.polynomial.') || type.start_with?('numpy.poly1d.')
@ -90,7 +94,7 @@ module Docs
name.remove! %r{[\=\[].*} name.remove! %r{[\=\[].*}
name.remove! %r{\A(class(method)?|exception) } name.remove! %r{\A(class(method)?|exception) }
name.remove! %r{\s—.*} name.remove! %r{\s—.*}
name.remove! '¶' name.remove! %r{#\Z}
end end
end end
end end

View file

@ -22,18 +22,24 @@ module Docs
] ]
options[:attribution] = <<-HTML options[:attribution] = <<-HTML
&copy; 2005&ndash;2021 NumPy Developers<br> &copy; 2005&ndash;2022 NumPy Developers<br>
Licensed under the 3-clause BSD License. Licensed under the 3-clause BSD License.
HTML HTML
version '1.23' do
self.release = '1.23.0'
self.base_url = "https://numpy.org/doc/#{self.version}/"
options[:container] = nil
end
version '1.22' do version '1.22' do
self.release = '1.22.0' self.release = '1.22.4'
self.base_url = "https://numpy.org/doc/#{self.version}/" self.base_url = "https://numpy.org/doc/#{self.version}/"
options[:container] = nil options[:container] = nil
end end
version '1.21' do version '1.21' do
self.release = '1.21.5' self.release = '1.21.6'
self.base_url = "https://numpy.org/doc/#{self.version}/" self.base_url = "https://numpy.org/doc/#{self.version}/"
options[:container] = nil options[:container] = nil
end end