Unified · Split
| @@ -12,7 +12,12 @@ module Docs · 11 unmodified lines | |||
| 12 | end | 12 | end |
| 13 | 13 | ||
| 14 | def get_type | 14 | def get_type |
| 15 | return 'Guides' unless api_page? | 15 | unless api_page? |
| 16 | link = at_css(".sidebar li a[href='#{result[:path].split('/').last}']") | ||
| 17 | heading = link.ancestors('li').last.at_css('> h2') | ||
| 18 | return heading ? "Guides: #{heading.content.strip}" : 'Guides' | ||
| 19 | end | ||
| 20 | |||
| 16 | type = slug.remove(%r{api/\d.\d/}).remove('Illuminate/').remove(/\/\w+?\z/).gsub('/', '\\') | 21 | type = slug.remove(%r{api/\d.\d/}).remove('Illuminate/').remove(/\/\w+?\z/).gsub('/', '\\') |
| 17 | 22 | ||
| 18 | if type.end_with?('Console') | 23 | if type.end_with?('Console') |
| @@ -1,11 +1,7 @@ | |||
| 1 | module Docs | 1 | module Docs |
| 2 | class Laravel < UrlScraper | 2 | class Laravel < UrlScraper |
| 3 | self.name = 'Laravel' | ||
| 4 | self.slug = 'laravel' | ||
| 5 | self.type = 'laravel' | 3 | self.type = 'laravel' |
| 6 | |||
| 7 | self.base_url = 'https://laravel.com' | 4 | self.base_url = 'https://laravel.com' |
| 8 | |||
| 9 | self.links = { | 5 | self.links = { |
| 10 | home: 'https://laravel.com/', | 6 | home: 'https://laravel.com/', |
| 11 | code: 'https://github.com/laravel/laravel' | 7 | code: 'https://github.com/laravel/laravel' |
| @@ -33,6 +29,19 @@ module Docs · 21 unmodified lines | |||
| 33 | Laravel is a trademark of Taylor Otwell. | 29 | Laravel is a trademark of Taylor Otwell. |
| 34 | HTML | 30 | HTML |
| 35 | 31 | ||
| 32 | version '5.5' do | ||
| 33 | self.release = '5.5.0' | ||
| 34 | self.root_path = '/api/5.5/index.html' | ||
| 35 | self.initial_paths = %w(/docs/5.5/installation /api/5.5/classes.html) | ||
| 36 | |||
| 37 | options[:only_patterns] = [%r{\A/api/5\.5/}, %r{\A/docs/5\.5/}] | ||
| 38 | |||
| 39 | options[:fix_urls] = ->(url) do | ||
| 40 | url.sub! %r{#{Regexp.escape(Laravel.base_url)}/docs\/(?!\d)}, "#{Laravel.base_url}/docs/5.5/" | ||
| 41 | url | ||
| 42 | end | ||
| 43 | end | ||
| 44 | |||
| 36 | version '5.4' do | 45 | version '5.4' do |
| 37 | self.release = '5.4.30' | 46 | self.release = '5.4.30' |
| 38 | self.root_path = '/api/5.4/index.html' | 47 | self.root_path = '/api/5.4/index.html' |