History

laravel: add Laravel 10 documentation

TK Lai committed 3 years ago

Commit ad5853d1 parent 03848b92 files · +23 −9Browse files

Unified · Split

2 files
  1. lib/docs/filters/laravel/entries.rb +1 −1
  2. lib/docs/scrapers/laravel.rb +22 −8
lib/docs/filters/laravel/entries.rb+1−1
@@ -18,7 +18,7 @@ module Docs · 17 unmodified lines
18 return heading ? "Guides: #{heading.content.strip}" : 'Guides'18 return heading ? "Guides: #{heading.content.strip}" : 'Guides'
19 end19 end
20 20
21 type = slug.remove(%r{api/\d.[0-9x]/}).remove('Illuminate/').remove(/\/\w+?\z/).gsub('/', '\\')21 type = slug.remove(%r{api/[1-9]?\d.[0-9x]/}).remove('Illuminate/').remove(/\/\w+?\z/).gsub('/', '\\')
22 22
23 if type.end_with?('Console')23 if type.end_with?('Console')
24 type.split('\\').first24 type.split('\\').first
lib/docs/scrapers/laravel.rb+22−8
@@ -14,14 +14,14 @@ module Docs · 13 unmodified lines
14 }14 }
15 15
16 options[:skip_patterns] = [16 options[:skip_patterns] = [
17 %r{\A/api/\d\.[0-9x]/\.html},17 %r{\A/api/[1-9]?\d\.[0-9x]/\.html},
18 %r{\A/api/\d\.[0-9x]/panel\.html},18 %r{\A/api/[1-9]?\d\.[0-9x]/panel\.html},
19 %r{\A/api/\d\.[0-9x]/namespaces\.html},19 %r{\A/api/[1-9]?\d\.[0-9x]/namespaces\.html},
20 %r{\A/api/\d\.[0-9x]/interfaces\.html},20 %r{\A/api/[1-9]?\d\.[0-9x]/interfaces\.html},
21 %r{\A/api/\d\.[0-9x]/traits\.html},21 %r{\A/api/[1-9]?\d\.[0-9x]/traits\.html},
22 %r{\A/api/\d\.[0-9x]/doc-index\.html},22 %r{\A/api/[1-9]?\d\.[0-9x]/doc-index\.html},
23 %r{\A/api/\d\.[0-9x]/Illuminate\.html},23 %r{\A/api/[1-9]?\d\.[0-9x]/Illuminate\.html},
24 %r{\A/api/\d\.[0-9x]/search\.html} ]24 %r{\A/api/[1-9]?\d\.[0-9x]/search\.html} ]
25 25
26 options[:attribution] = <<-HTML26 options[:attribution] = <<-HTML
27 &copy; Taylor Otwell<br>27 &copy; Taylor Otwell<br>
@@ -29,6 +29,20 @@ module Docs · 1 unmodified line
29 Laravel is a trademark of Taylor Otwell.29 Laravel is a trademark of Taylor Otwell.
30 HTML30 HTML
31 31
32 version '10' do
33 self.release = '10.10.0'
34 self.root_path = '/api/10.x/index.html'
35 self.initial_paths = %w(/docs/10.x/installation /api/10.x/classes.html)
36
37 options[:only_patterns] = [%r{\A/api/10\.x/}, %r{\A/docs/10\.x/}]
38
39 options[:fix_urls] = ->(url) do
40 url.sub! %r{10.x/+}, "10.x/"
41 url.sub! %r{#{Regexp.escape(Laravel.base_url)}/docs\/(?![1-9]?\d)}, "#{Laravel.base_url}/docs/10.x/"
42 url
43 end
44 end
45
32 version '9' do46 version '9' do
33 self.release = '9.3.8'47 self.release = '9.3.8'
34 self.root_path = '/api/9.x/index.html'48 self.root_path = '/api/9.x/index.html'