Explorar o código

Update Python documentation (3.10.1)

Re-enable most non library docs.

Fixes #1601.
Simon Legner %!s(int64=4) %!d(string=hai) anos
pai
achega
937bf3b76f

+ 8 - 1
lib/docs/filters/python/entries_v3.rb

@@ -26,6 +26,13 @@ module Docs
       end
 
       def get_type
+        return 'Language Reference' if slug.start_with? 'reference'
+        return 'Python/C API' if slug.start_with? 'c-api'
+        return 'Tutorial' if slug.start_with? 'tutorial'
+
+        return 'Basics' unless slug.start_with? 'library/'
+        return 'Basics' if slug.start_with? 'library/index'
+
         return 'Logging' if slug.start_with? 'library/logging'
         return 'Asynchronous I/O' if slug.start_with? 'library/asyncio'
 
@@ -53,7 +60,7 @@ module Docs
       end
 
       def additional_entries
-        return [] if root_page? || !include_default_entry? || name == 'errno'
+        return [] if root_page? || slug.start_with?('library/index') || !include_default_entry? || name == 'errno'
         clean_id_attributes
         entries = []
 

+ 17 - 4
lib/docs/scrapers/python.rb

@@ -1,18 +1,31 @@
 module Docs
   class Python < FileScraper
     self.type = 'python'
-    self.root_path = 'library/index.html'
+    self.root_path = 'index.html'
     self.links = {
       home: 'https://www.python.org/',
       code: 'https://github.com/python/cpython'
     }
 
-    options[:only_patterns] = [/\Alibrary\//]
+    options[:only_patterns] = [
+      # /\Ac-api/,
+      /\Adistributing/,
+      # /\Adistutils/,
+      /\Aextending/,
+      /\Afaq/,
+      /\Ahowto/,
+      /\Aindex.html/,
+      # /\Ainstall/,
+      /\Ainstalling/,
+      /\Alibrary/,
+      /\Areference/,
+      /\Atutorial/,
+      /\Ausing/,
+    ]
 
     options[:skip] = %w(
       library/2to3.html
       library/formatter.html
-      library/index.html
       library/intro.html
       library/undoc.html
       library/unittest.mock-examples.html
@@ -24,7 +37,7 @@ module Docs
     HTML
 
     version '3.10' do
-      self.release = '3.10.0'
+      self.release = '3.10.1'
       self.base_url = "https://docs.python.org/#{self.version}/"
 
       html_filters.push 'python/entries_v3', 'sphinx/clean_html', 'python/clean_html'

BIN=BIN
python-3.10.1-docs-html.tar.bz2