History

Update Laravel documentation (5.5.0)

Thibaut Courouble committed 9 years ago

Commit 6cbf5501 parent 414f3842 files · +19 −5Browse files

Unified · Split

2 files
  1. lib/docs/filters/laravel/entries.rb +6 −1
  2. lib/docs/scrapers/laravel.rb +13 −4
lib/docs/filters/laravel/entries.rb+6−1
@@ -12,7 +12,12 @@ module Docs · 11 unmodified lines
1212 end
1313
1414 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+
1621 type = slug.remove(%r{api/\d.\d/}).remove('Illuminate/').remove(/\/\w+?\z/).gsub('/', '\\')
1722
1823 if type.end_with?('Console')
lib/docs/scrapers/laravel.rb+13−4
@@ -1,11 +1,7 @@
11 module Docs
22 class Laravel < UrlScraper
3− self.name = 'Laravel'
4− self.slug = 'laravel'
53 self.type = 'laravel'
6−
74 self.base_url = 'https://laravel.com'
8−
95 self.links = {
106 home: 'https://laravel.com/',
117 code: 'https://github.com/laravel/laravel'
@@ -33,6 +29,19 @@ module Docs · 21 unmodified lines
3329 Laravel is a trademark of Taylor Otwell.
3430 HTML
3531
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+
3645 version '5.4' do
3746 self.release = '5.4.30'
3847 self.root_path = '/api/5.4/index.html'