diff --git a/lib/docs/filters/pytorch/entries.rb b/lib/docs/filters/pytorch/entries.rb index 8a019b14..4b8d153e 100644 --- a/lib/docs/filters/pytorch/entries.rb +++ b/lib/docs/filters/pytorch/entries.rb @@ -13,7 +13,7 @@ module Docs # The id of the container `div.section` indicates the page type. # If the id starts with `module-`, then it's an API reference, # otherwise it is a note or design doc. - section_id = at_css('.section')['id'] + section_id = at_css('.section[id], section[id]')['id'] if section_id.starts_with? 'module-' section_id.remove('module-') else diff --git a/lib/docs/scrapers/pytorch.rb b/lib/docs/scrapers/pytorch.rb index d3329d06..a6d9ea82 100644 --- a/lib/docs/scrapers/pytorch.rb +++ b/lib/docs/scrapers/pytorch.rb @@ -20,86 +20,16 @@ module Docs Licensed under the 3-clause BSD License. HTML - version '2.1' do + version '2' do self.release = '2.1' self.base_url = "https://pytorch.org/docs/#{release}/" end - version '2.0' do - self.release = '2.0' - self.base_url = "https://pytorch.org/docs/#{release}/" - end - - version '1.13' do + version '1' do self.release = '1.13' self.base_url = "https://pytorch.org/docs/#{release}/" end - version '1.12' do - self.release = '1.12' - self.base_url = "https://pytorch.org/docs/#{release}/" - end - - version '1.11' do - self.release = '1.11' - self.base_url = "https://pytorch.org/docs/#{release}/" - end - - version '1.10' do - self.release = '1.10' - self.base_url = "https://pytorch.org/docs/#{release}/" - end - - version '1.9' do - self.release = '1.9.1' - self.base_url = "https://pytorch.org/docs/#{release}/" - end - - version '1.8' do - self.release = '1.8.1' - self.base_url = "https://pytorch.org/docs/#{release}/" - end - - version '1.7' do - self.release = '1.7.1' - self.base_url = "https://pytorch.org/docs/#{release}/" - end - - version '1.6' do - self.release = '1.6.0' - self.base_url = "https://pytorch.org/docs/#{release}/" - end - - version '1.5' do - self.release = '1.5.1' - self.base_url = "https://pytorch.org/docs/#{release}/" - end - - version '1.4' do - self.release = '1.4.0' - self.base_url = "https://pytorch.org/docs/#{release}/" - end - - version '1.3' do - self.release = '1.3.1' - self.base_url = "https://pytorch.org/docs/#{release}/" - end - - version '1.2' do - self.release = '1.2.0' - self.base_url = "https://pytorch.org/docs/#{release}/" - end - - version '1.1' do - self.release = '1.1.0' - self.base_url = "https://pytorch.org/docs/#{release}/" - end - - version '1.0' do - self.release = '1.0.1' - self.base_url = "https://pytorch.org/docs/#{release}/" - end - def get_latest_version(opts) get_latest_github_release('pytorch', 'pytorch', opts) end