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
3class 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
13 13
14 def get_type14 def get_type
15 return 'Guides' unless api_page?15 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('/', '\\')
17 17
18 if type.end_with?('Console')18 if type.end_with?('Console')
19 type.split('\\').first19 type.split('\\').first
20 elsif type.start_with?('Contracts')20 elsif type.start_with?('Contracts')
21 'Contracts'21 'Contracts'
22 elsif type.start_with?('Database')
23 type.split('\\')[0..2].join('\\')
22 else24 else
23 type25 type.split('\\')[0..1].join('\\')
24 end26 end
25 end27 end
26 28
@@ -44,7 +46,7 @@ module Docs · 17 unmodified lines
44 end46 end
45 47
46 def include_default_entry?48 def include_default_entry?
47 subpath != '/api/5.0/classes.html'49 subpath != '/api/5.1/classes.html'
48 end50 end
49 end51 end
50 end52 end
lib/docs/scrapers/laravel.rb+21−17
@@ -3,10 +3,14 @@ module Docs · 2 unmodified lines
3 self.name = 'Laravel'3 self.name = 'Laravel'
4 self.slug = 'laravel'4 self.slug = 'laravel'
5 self.type = 'laravel'5 self.type = 'laravel'
6 self.version = '5.0.0'6 self.version = '5.1.1'
7 self.base_url = 'http://laravel.com'7 self.base_url = 'http://laravel.com'
8 self.root_path = '/api/5.0/index.html'8 self.root_path = '/api/5.1/index.html'
9 self.initial_paths = %w(/docs/5.0/installation /api/5.0/classes.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 }
10 14
11 html_filters.push 'laravel/entries', 'laravel/clean_html'15 html_filters.push 'laravel/entries', 'laravel/clean_html'
12 16
@@ -15,24 +19,24 @@ module Docs · 2 unmodified lines
15 }19 }
16 20
17 options[:only_patterns] = [21 options[:only_patterns] = [
18 /\A\/api\/5\.0\//,22 /\A\/api\/5\.1\//,
19 /\A\/docs\/5\.0\//]23 /\A\/docs\/5\.1\//]
20 24
21 options[:skip] = %w(25 options[:skip] = %w(
22 /docs/5.0/quick26 /docs/5.1/quick
23 /docs/5.0/releases27 /docs/5.1/releases
24 /docs/5.0/artisan28 /docs/5.1/artisan
25 /docs/5.0/commands29 /docs/5.1/commands
26 /api/5.0/panel.html30 /api/5.1/panel.html
27 /api/5.0/namespaces.html31 /api/5.1/namespaces.html
28 /api/5.0/interfaces.html32 /api/5.1/interfaces.html
29 /api/5.0/traits.html33 /api/5.1/traits.html
30 /api/5.0/doc-index.html34 /api/5.1/doc-index.html
31 /api/5.0/Illuminate.html35 /api/5.1/Illuminate.html
32 /api/5.0/search.html)36 /api/5.1/search.html)
33 37
34 options[:fix_urls] = ->(url) do38 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/"
36 url40 url
37 end41 end
38 42

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