Kaynağa Gözat

Update and add missing pytorch versions

Mathis Chenuet 1 yıl önce
ebeveyn
işleme
ddb83df8ec
2 değiştirilmiş dosya ile 79 ekleme ve 4 silme
  1. 1 1
      .github/CONTRIBUTING.md
  2. 78 3
      lib/docs/scrapers/pytorch.rb

+ 1 - 1
.github/CONTRIBUTING.md

@@ -64,7 +64,7 @@ If the latest [documentation versions report](https://github.com/freeCodeCamp/de
 Follow the following steps to update documentations to their latest version:
 
 1. Make version/release changes in the scraper file.
-2. Check if the license is still correct. If you update `options[:attribution]`, also update the documentation's entry in the array in [`assets/javascripts/templates/pages/about_tmpl.coffee`](../assets/javascripts/templates/pages/about_tmpl.coffee) to match.
+2. Check if the license is still correct. If you update `options[:attribution]`, also update the documentation's entry in the array in [`assets/javascripts/templates/pages/about_tmpl.js`](../assets/javascripts/templates/pages/about_tmpl.js) to match.
 3. If the documentation has a custom icon, ensure the icons in <code>public/icons/*your_scraper_name*/</code> are up-to-date. If you pull the updated icon from a place different than the one specified in the `SOURCE` file, make sure to replace the old link with the new one.
 4. If `self.links` is defined, check if the urls are still correct.
 5. If the scraper inherits from `FileScraper` rather than `URLScraper`, follow the instructions for that scraper in [`file-scrapers.md`](../docs/file-scrapers.md) to obtain the source material for the scraper.

+ 78 - 3
lib/docs/scrapers/pytorch.rb

@@ -16,12 +16,87 @@ module Docs
     options[:max_image_size] = 256_000
 
     options[:attribution] = <<-HTML
-    &copy; 2019 Torch Contributors<br>
+    &copy; 2019-2024 Torch Contributors<br>
     Licensed under the 3-clause BSD License.
     HTML
 
-    version do
-      self.release = '1.8.0'
+    version '2.1' 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
+      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