Преглед изворни кода

Update Laravel documentation (9.3.8)

Simon Legner пре 3 година
родитељ
комит
6d69e1e86e
2 измењених фајлова са 16 додато и 2 уклоњено
  1. 1 1
      lib/docs/filters/laravel/clean_html.rb
  2. 15 1
      lib/docs/scrapers/laravel.rb

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

@@ -56,7 +56,7 @@ module Docs
       end
 
       def other
-        @doc = at_css('.docs_body')
+        @doc = at_css('#main-content')
 
         # Clean up headings
         css('h2 > a').each do |node|

+ 15 - 1
lib/docs/scrapers/laravel.rb

@@ -10,7 +10,7 @@ module Docs
     html_filters.push 'laravel/entries', 'laravel/clean_html'
 
     options[:container] = ->(filter) {
-      filter.subpath.start_with?('/api') ? '#content' : '.page_contain'
+      filter.subpath.start_with?('/api') ? '#content' : '#docsScreen'
     }
 
     options[:skip_patterns] = [
@@ -29,6 +29,20 @@ module Docs
       Laravel is a trademark of Taylor Otwell.
     HTML
 
+    version '9' do
+      self.release = '9.3.8'
+      self.root_path = '/api/9.x/index.html'
+      self.initial_paths = %w(/docs/9.x/installation /api/9.x/classes.html)
+
+      options[:only_patterns] = [%r{\A/api/9\.x/}, %r{\A/docs/9\.x/}]
+
+      options[:fix_urls] = ->(url) do
+        url.sub! %r{9.x/+}, "9.x/"
+        url.sub! %r{#{Regexp.escape(Laravel.base_url)}/docs\/(?!\d)}, "#{Laravel.base_url}/docs/9.x/"
+        url
+      end
+    end
+
     version '8' do
       self.release = '8.4.1'
       self.root_path = '/api/8.x/index.html'