Update Laravel documentation (5.1.1)

pull/205/merge
Thibaut 10 years ago
parent aef9262470
commit 7963ff337d

@ -0,0 +1,6 @@
#= require views/pages/base
class app.views.LaravelPage extends app.views.BasePage
afterRender: ->
@highlightCode @findAllByTag('pre'), 'php'
return

@ -13,14 +13,16 @@ module Docs
def get_type def get_type
return 'Guides' unless api_page? return 'Guides' unless api_page?
type = slug.remove('api/5.0/').remove('Illuminate/').remove(/\/\w+?\z/).gsub('/', '\\') type = slug.remove(%r{api/\d.\d/}).remove('Illuminate/').remove(/\/\w+?\z/).gsub('/', '\\')
if type.end_with?('Console') if type.end_with?('Console')
type.split('\\').first type.split('\\').first
elsif type.start_with?('Contracts') elsif type.start_with?('Contracts')
'Contracts' 'Contracts'
elsif type.start_with?('Database')
type.split('\\')[0..2].join('\\')
else else
type type.split('\\')[0..1].join('\\')
end end
end end
@ -44,7 +46,7 @@ module Docs
end end
def include_default_entry? def include_default_entry?
subpath != '/api/5.0/classes.html' subpath != '/api/5.1/classes.html'
end end
end end
end end

@ -3,10 +3,14 @@ module Docs
self.name = 'Laravel' self.name = 'Laravel'
self.slug = 'laravel' self.slug = 'laravel'
self.type = 'laravel' self.type = 'laravel'
self.version = '5.0.0' self.version = '5.1.1'
self.base_url = 'http://laravel.com' self.base_url = 'http://laravel.com'
self.root_path = '/api/5.0/index.html' self.root_path = '/api/5.1/index.html'
self.initial_paths = %w(/docs/5.0/installation /api/5.0/classes.html) self.initial_paths = %w(/docs/5.1/installation /api/5.1/classes.html)
self.links = {
home: 'http://laravel.com/',
code: 'https://github.com/laravel/laravel'
}
html_filters.push 'laravel/entries', 'laravel/clean_html' html_filters.push 'laravel/entries', 'laravel/clean_html'
@ -15,24 +19,24 @@ module Docs
} }
options[:only_patterns] = [ options[:only_patterns] = [
/\A\/api\/5\.0\//, /\A\/api\/5\.1\//,
/\A\/docs\/5\.0\//] /\A\/docs\/5\.1\//]
options[:skip] = %w( options[:skip] = %w(
/docs/5.0/quick /docs/5.1/quick
/docs/5.0/releases /docs/5.1/releases
/docs/5.0/artisan /docs/5.1/artisan
/docs/5.0/commands /docs/5.1/commands
/api/5.0/panel.html /api/5.1/panel.html
/api/5.0/namespaces.html /api/5.1/namespaces.html
/api/5.0/interfaces.html /api/5.1/interfaces.html
/api/5.0/traits.html /api/5.1/traits.html
/api/5.0/doc-index.html /api/5.1/doc-index.html
/api/5.0/Illuminate.html /api/5.1/Illuminate.html
/api/5.0/search.html) /api/5.1/search.html)
options[:fix_urls] = ->(url) do options[:fix_urls] = ->(url) do
url.sub! %r{#{Regexp.escape(Laravel.base_url)}/docs\/(?!\d)}, "#{Laravel.base_url}/docs/5.0/" url.sub! %r{#{Regexp.escape(Laravel.base_url)}/docs\/(?!\d)}, "#{Laravel.base_url}/docs/5.1/"
url url
end end

Loading…
Cancel
Save