History

Update Laravel documentation (5.1.1)

Thibaut committed 11 years ago

Commit 7963ff31 parent aef92623 files · +32 −20Browse files

Unified · Split

3 files
  1. assets/javascripts/views/pages/laravel.coffee +6 −0
  2. lib/docs/filters/laravel/entries.rb +5 −3
  3. lib/docs/scrapers/laravel.rb +21 −17
assets/javascripts/views/pages/laravel.coffee+6−0
@@ -0,0 +1,6 @@
1+#= require views/pages/base
2+
3+class app.views.LaravelPage extends app.views.BasePage
4+ afterRender: ->
5+ @highlightCode @findAllByTag('pre'), 'php'
6+ return
lib/docs/filters/laravel/entries.rb+5−3
@@ -13,14 +13,16 @@ module Docs · 12 unmodified lines
1313
1414 def get_type
1515 return 'Guides' unless api_page?
16− type = slug.remove('api/5.0/').remove('Illuminate/').remove(/\/\w+?\z/).gsub('/', '\\')
16+ type = slug.remove(%r{api/\d.\d/}).remove('Illuminate/').remove(/\/\w+?\z/).gsub('/', '\\')
1717
1818 if type.end_with?('Console')
1919 type.split('\\').first
2020 elsif type.start_with?('Contracts')
2121 'Contracts'
22+ elsif type.start_with?('Database')
23+ type.split('\\')[0..2].join('\\')
2224 else
23− type
25+ type.split('\\')[0..1].join('\\')
2426 end
2527 end
2628
@@ -44,7 +46,7 @@ module Docs · 17 unmodified lines
4446 end
4547
4648 def include_default_entry?
47− subpath != '/api/5.0/classes.html'
49+ subpath != '/api/5.1/classes.html'
4850 end
4951 end
5052 end
lib/docs/scrapers/laravel.rb+21−17
@@ -3,10 +3,14 @@ module Docs · 2 unmodified lines
33 self.name = 'Laravel'
44 self.slug = 'laravel'
55 self.type = 'laravel'
6− self.version = '5.0.0'
6+ self.version = '5.1.1'
77 self.base_url = 'http://laravel.com'
8− self.root_path = '/api/5.0/index.html'
9− self.initial_paths = %w(/docs/5.0/installation /api/5.0/classes.html)
8+ self.root_path = '/api/5.1/index.html'
9+ self.initial_paths = %w(/docs/5.1/installation /api/5.1/classes.html)
10+ self.links = {
11+ home: 'http://laravel.com/',
12+ code: 'https://github.com/laravel/laravel'
13+ }
1014
1115 html_filters.push 'laravel/entries', 'laravel/clean_html'
1216
@@ -15,24 +19,24 @@ module Docs · 2 unmodified lines
1519 }
1620
1721 options[:only_patterns] = [
18− /\A\/api\/5\.0\//,
19− /\A\/docs\/5\.0\//]
22+ /\A\/api\/5\.1\//,
23+ /\A\/docs\/5\.1\//]
2024
2125 options[:skip] = %w(
22− /docs/5.0/quick
23− /docs/5.0/releases
24− /docs/5.0/artisan
25− /docs/5.0/commands
26− /api/5.0/panel.html
27− /api/5.0/namespaces.html
28− /api/5.0/interfaces.html
29− /api/5.0/traits.html
30− /api/5.0/doc-index.html
31− /api/5.0/Illuminate.html
32− /api/5.0/search.html)
26+ /docs/5.1/quick
27+ /docs/5.1/releases
28+ /docs/5.1/artisan
29+ /docs/5.1/commands
30+ /api/5.1/panel.html
31+ /api/5.1/namespaces.html
32+ /api/5.1/interfaces.html
33+ /api/5.1/traits.html
34+ /api/5.1/doc-index.html
35+ /api/5.1/Illuminate.html
36+ /api/5.1/search.html)
3337
3438 options[:fix_urls] = ->(url) do
35− url.sub! %r{#{Regexp.escape(Laravel.base_url)}/docs\/(?!\d)}, "#{Laravel.base_url}/docs/5.0/"
39+ url.sub! %r{#{Regexp.escape(Laravel.base_url)}/docs\/(?!\d)}, "#{Laravel.base_url}/docs/5.1/"
3640 url
3741 end
3842

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t