History

Merge pull request #2117 from artemisart/update/pytorch

Update pytorch docs

Simon Legner committed 2 years ago

Commit 741d73b2 parents 266c880 3789d0b5 files · +12 −7Browse files

Unified · Split

5 files
  1. .github/CONTRIBUTING.md +1 −1
  2. .github/PULL_REQUEST_TEMPLATE.md +1 −1
  3. docs/adding-docs.md +1 −1
  4. lib/docs/filters/pytorch/entries.rb +1 −1
  5. lib/docs/scrapers/pytorch.rb +8 −3
.github/CONTRIBUTING.md+1−1
@@ -64,7 +64,7 @@ If the latest [documentation versions report](https://github.com/freeCodeCamp/de · 63 unmodified lines
64Follow the following steps to update documentations to their latest version:64Follow the following steps to update documentations to their latest version:
65 65
661. Make version/release changes in the scraper file.661. Make version/release changes in the scraper file.
672. 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.672. Check if the license is still correct. Update `options[:attribution]` if needed.
683. 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.683. 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.
694. If `self.links` is defined, check if the urls are still correct.694. If `self.links` is defined, check if the urls are still correct.
705. 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.705. 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.
.github/PULL_REQUEST_TEMPLATE.md+1−1
@@ -22,7 +22,7 @@ If you’re adding a new scraper, please ensure that you have: · 21 unmodified lines
22If you're updating existing documentation to its latest version, please ensure that you have:22If you're updating existing documentation to its latest version, please ensure that you have:
23 23
24- [ ] Updated the versions and releases in the scraper file24- [ ] Updated the versions and releases in the scraper file
25- [ ] Ensured the license is up-to-date and that the documentation's entry in the array in `about_tmpl.coffee` matches its data in `self.attribution`25- [ ] Ensured the license is up-to-date
26- [ ] Ensured the icons and the `SOURCE` file in <code>public/icons/*your_scraper_name*/</code> are up-to-date if the documentation has a custom icon26- [ ] Ensured the icons and the `SOURCE` file in <code>public/icons/*your_scraper_name*/</code> are up-to-date if the documentation has a custom icon
27- [ ] Ensured `self.links` contains up-to-date urls if `self.links` is defined27- [ ] Ensured `self.links` contains up-to-date urls if `self.links` is defined
28- [ ] Tested the changes locally to ensure:28- [ ] Tested the changes locally to ensure:
docs/adding-docs.md+1−1
@@ -16,7 +16,7 @@ Adding a documentation may look like a daunting task but once you get the hang o · 15 unmodified lines
169. To customize the pages' styling, create an SCSS file in the `assets/stylesheets/pages/` directory and import it in both `application.css.scss` AND `application-dark.css.scss`. Both the file and CSS class should be named `_[type]` where [type] is equal to the scraper's `type` attribute (documentations with the same type share the same custom CSS and JS). Setting the type to `simple` will apply the general styling rules in `assets/stylesheets/pages/_simple.scss`, which can be used for documentations where little to no CSS changes are needed.169. To customize the pages' styling, create an SCSS file in the `assets/stylesheets/pages/` directory and import it in both `application.css.scss` AND `application-dark.css.scss`. Both the file and CSS class should be named `_[type]` where [type] is equal to the scraper's `type` attribute (documentations with the same type share the same custom CSS and JS). Setting the type to `simple` will apply the general styling rules in `assets/stylesheets/pages/_simple.scss`, which can be used for documentations where little to no CSS changes are needed.
1710. To add syntax highlighting or execute custom JavaScript on the pages, create a file in the `assets/javascripts/views/pages/` directory (take a look at the other files to see how it works).1710. To add syntax highlighting or execute custom JavaScript on the pages, create a file in the `assets/javascripts/views/pages/` directory (take a look at the other files to see how it works).
1811. Add the documentation's icon in the `public/icons/docs/[my_doc]/` directory, in both 16x16 and 32x32-pixels formats. The icon spritesheet is automatically generated when you (re)start your local DevDocs instance.1811. Add the documentation's icon in the `public/icons/docs/[my_doc]/` directory, in both 16x16 and 32x32-pixels formats. The icon spritesheet is automatically generated when you (re)start your local DevDocs instance.
1912. Add the documentation's copyright details to the list in `assets/javascripts/templates/pages/about_tmpl.coffee`. This is the data shown in the table on the [about](https://devdocs.io/about) page, and is ordered alphabetically. Simply copying an existing item, placing it in the right slot and updating the values to match the new scraper will do the job.1912. Add the documentation's copyright details to `options[:attribution]`. This is the data shown in the table on the [about](https://devdocs.io/about) page, and is ordered alphabetically. Please see an existing scraper for the typesetting.
2013. Ensure `thor updates:check [my_doc]` shows the correct latest version.2013. Ensure `thor updates:check [my_doc]` shows the correct latest version.
21 21
22If the documentation includes more than a few hundreds pages and is available for download, try to scrape it locally (e.g. using `FileScraper`). It'll make the development process much faster and avoids putting too much load on the source site. (It's not a problem if your scraper is coupled to your local setup, just explain how it works in your pull request.)22If the documentation includes more than a few hundreds pages and is available for download, try to scrape it locally (e.g. using `FileScraper`). It'll make the development process much faster and avoids putting too much load on the source site. (It's not a problem if your scraper is coupled to your local setup, just explain how it works in your pull request.)
lib/docs/filters/pytorch/entries.rb+1−1
@@ -13,7 +13,7 @@ module Docs · 12 unmodified lines
13 # The id of the container `div.section` indicates the page type.13 # The id of the container `div.section` indicates the page type.
14 # If the id starts with `module-`, then it's an API reference,14 # If the id starts with `module-`, then it's an API reference,
15 # otherwise it is a note or design doc.15 # otherwise it is a note or design doc.
16 section_id = at_css('.section')['id']16 section_id = at_css('.section[id], section[id]')['id']
17 if section_id.starts_with? 'module-'17 if section_id.starts_with? 'module-'
18 section_id.remove('module-')18 section_id.remove('module-')
19 else19 else
lib/docs/scrapers/pytorch.rb+8−3
@@ -16,12 +16,17 @@ module Docs · 15 unmodified lines
16 options[:max_image_size] = 256_00016 options[:max_image_size] = 256_000
17 17
18 options[:attribution] = <<-HTML18 options[:attribution] = <<-HTML
19 &copy; 2019 Torch Contributors<br>19 &copy; 2019-2024 Torch Contributors<br>
20 Licensed under the 3-clause BSD License.20 Licensed under the 3-clause BSD License.
21 HTML21 HTML
22 22
23 version do23 version '2' do
24 self.release = '1.8.0'24 self.release = '2.1'
25 self.base_url = "https://pytorch.org/docs/#{release}/"
26 end
27
28 version '1' do
29 self.release = '1.13'
25 self.base_url = "https://pytorch.org/docs/#{release}/"30 self.base_url = "https://pytorch.org/docs/#{release}/"
26 end31 end
27 32