Update Angular documentation (13.0.2)

https://github.com/angular/angular/pull/42414
pull/1666/head
Simon Legner 3 years ago
parent fdf9a7e28e
commit 735b48209f

@ -46,20 +46,30 @@ module Docs
def handle_response(response)
if response.mime_type.include?('json')
begin
response.options[:response_body] = JSON.parse(response.body)['contents']
json = JSON.parse(response.body)
response.options[:response_body] = json['contents']
response.url.path = response.url.path.gsub(/generated\/docs\/.*/, json['id'])
response.effective_url.path = response.effective_url.path.gsub(/generated\/docs\/.*/, json['id'])
rescue JSON::ParserError
response.options[:response_body] = ''
end
response.headers['Content-Type'] = 'text/html'
response.url.path = response.url.path.sub('/generated/docs/', '/').remove('.json')
response.effective_url.path = response.effective_url.path.sub('/generated/docs/', '/').remove('.json')
end
super
end
end
module Since12
def url_for(path)
# See encodeToLowercase im aio/tools/transforms/angular-base-package/processors/disambiguateDocPaths.js
path = path.gsub(/[A-Z_]/) {|s| s.downcase + '_'}
super
end
include Docs::Angular::Common
end
version do
self.release = '12.0.0'
self.release = '13.0.2'
self.base_url = 'https://angular.io/'
self.root_path = 'docs'
@ -75,7 +85,27 @@ module Docs
url
end
include Docs::Angular::Common
include Docs::Angular::Since12
end
version '12' do
self.release = '12.2.13'
self.base_url = 'https://v12.angular.io/'
self.root_path = 'docs'
html_filters.push 'angular/clean_html', 'angular/entries'
options[:follow_links] = false
options[:only_patterns] = [/\Aguide/, /\Atutorial/, /\Aapi/]
options[:fix_urls_before_parse] = ->(url) do
url.sub! %r{\Aguide/}, '/guide/'
url.sub! %r{\Atutorial/}, '/tutorial/'
url.sub! %r{\Aapi/}, '/api/'
url.sub! %r{\Agenerated/}, '/generated/'
url
end
include Docs::Angular::Since12
end
version '11' do

Loading…
Cancel
Save