Unified · Split
| @@ -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 | ||
| @@ -13,14 +13,16 @@ module Docs · 12 unmodified lines | |||
| 13 | 13 | ||
| 14 | def get_type | 14 | 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('\\').first | 19 | 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 | else | 24 | else |
| 23 | type | 25 | type.split('\\')[0..1].join('\\') |
| 24 | end | 26 | end |
| 25 | end | 27 | end |
| 26 | 28 | ||
| @@ -44,7 +46,7 @@ module Docs · 17 unmodified lines | |||
| 44 | end | 46 | 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 | end | 50 | end |
| 49 | end | 51 | end |
| 50 | end | 52 | end |
| @@ -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/quick | 26 | /docs/5.1/quick |
| 23 | /docs/5.0/releases | 27 | /docs/5.1/releases |
| 24 | /docs/5.0/artisan | 28 | /docs/5.1/artisan |
| 25 | /docs/5.0/commands | 29 | /docs/5.1/commands |
| 26 | /api/5.0/panel.html | 30 | /api/5.1/panel.html |
| 27 | /api/5.0/namespaces.html | 31 | /api/5.1/namespaces.html |
| 28 | /api/5.0/interfaces.html | 32 | /api/5.1/interfaces.html |
| 29 | /api/5.0/traits.html | 33 | /api/5.1/traits.html |
| 30 | /api/5.0/doc-index.html | 34 | /api/5.1/doc-index.html |
| 31 | /api/5.0/Illuminate.html | 35 | /api/5.1/Illuminate.html |
| 32 | /api/5.0/search.html) | 36 | /api/5.1/search.html) |
| 33 | 37 | ||
| 34 | options[:fix_urls] = ->(url) do | 38 | 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 | url | 40 | url |
| 37 | end | 41 | end |
| 38 | 42 | ||