Browse Source

Merge pull request #2272 from tklai/laravel-11

Add Laravel 11 documentation
Simon Legner 1 year ago
parent
commit
2b634199f0
1 changed files with 14 additions and 0 deletions
  1. 14 0
      lib/docs/scrapers/laravel.rb

+ 14 - 0
lib/docs/scrapers/laravel.rb

@@ -29,6 +29,20 @@ module Docs
       Laravel is a trademark of Taylor Otwell.
       Laravel is a trademark of Taylor Otwell.
     HTML
     HTML
 
 
+    version '11' do
+      self.release = '11.11.1'
+      self.root_path = '/api/11.x/index.html'
+      self.initial_paths = %w(/docs/11.x/installation /api/11.x/classes.html)
+
+      options[:only_patterns] = [%r{\A/api/11\.x/}, %r{\A/docs/11\.x/}]
+
+      options[:fix_urls] = ->(url) do
+        url.sub! %r{11.x/+}, "11.x/"
+        url.sub! %r{#{Regexp.escape(Laravel.base_url)}/docs\/(?![1-9]?\d)}, "#{Laravel.base_url}/docs/11.x/"
+        url
+      end
+    end
+
     version '10' do
     version '10' do
       self.release = '10.13.0'
       self.release = '10.13.0'
       self.root_path = '/api/10.x/index.html'
       self.root_path = '/api/10.x/index.html'