فهرست منبع

Update Python documentation (3.10.6)

Include full documentation (instead of library reference only).

Fixes #696.
Simon Legner 3 سال پیش
والد
کامیت
ebe281a1c5
3فایلهای تغییر یافته به همراه5 افزوده شده و 18 حذف شده
  1. 1 1
      lib/docs/filters/python/clean_html.rb
  2. 2 0
      lib/docs/filters/python/entries_v3.rb
  3. 2 17
      lib/docs/scrapers/python.rb

+ 1 - 1
lib/docs/filters/python/clean_html.rb

@@ -2,7 +2,7 @@ module Docs
   class Python
     class CleanHtmlFilter < Filter
       def call
-        @doc = at_css '.body'
+        @doc = at_css('.body > section[id]') || at_css('.body')
 
         root_page? ? root : other
 

+ 2 - 0
lib/docs/filters/python/entries_v3.rb

@@ -29,6 +29,8 @@ module Docs
         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 'Distributing' if slug.start_with? 'distributing'
+        return 'Distributing' if slug.start_with? 'distutils'
 
         return 'Basics' unless slug.start_with? 'library/'
         return 'Basics' if slug.start_with? 'library/index'

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

@@ -7,22 +7,7 @@ module Docs
       code: 'https://github.com/python/cpython'
     }
 
-    options[:only_patterns] = [
-      # /\Ac-api/,
-      /\Adistributing/,
-      # /\Adistutils/,
-      /\Aextending/,
-      /\Afaq/,
-      /\Ahowto/,
-      /\Aindex.html/,
-      # /\Ainstall/,
-      /\Ainstalling/,
-      /\Alibrary/,
-      /\Areference/,
-      /\Atutorial/,
-      /\Ausing/,
-    ]
-
+    options[:skip_patterns] = [/genindex/, /whatsnew/]
     options[:skip] = %w(
       library/2to3.html
       library/formatter.html
@@ -37,7 +22,7 @@ module Docs
     HTML
 
     version '3.10' do
-      self.release = '3.10.4'
+      self.release = '3.10.6'
       self.base_url = "https://docs.python.org/#{self.version}/"
 
       html_filters.push 'python/entries_v3', 'sphinx/clean_html', 'python/clean_html'