typescript: update to 3.7.2

pull/1133/head
Simon Legner 5 years ago
parent 58c44bf332
commit c60aa3e506

@ -763,7 +763,7 @@ credits = [
'https://twig.symfony.com/license' 'https://twig.symfony.com/license'
], [ ], [
'TypeScript', 'TypeScript',
'Microsoft and other contributors', '2012-2019 Microsoft',
'Apache', 'Apache',
'https://raw.githubusercontent.com/Microsoft/TypeScript-Handbook/master/LICENSE' 'https://raw.githubusercontent.com/Microsoft/TypeScript-Handbook/master/LICENSE'
], [ ], [

@ -9,6 +9,7 @@ module Docs
end end
css('.xs-toc-container').remove css('.xs-toc-container').remove
css('.anchor-hash').remove
css('article h1').each do |node| css('article h1').each do |node|
node.name = 'h2' node.name = 'h2'
@ -19,7 +20,7 @@ module Docs
end end
css('pre > code').each do |node| css('pre > code').each do |node|
node.parent['data-language'] = node['class'].sub('ts', 'typescript').sub('js', 'javascript').remove('language-') node.parent['data-language'] = node['class'].sub('ts', 'typescript').sub('js', 'javascript').remove('language-') if node['class']
node.content = node.content.gsub(' ', ' ') node.content = node.content.gsub(' ', ' ')
node.before(node.children).remove node.before(node.children).remove
end end

@ -2,7 +2,7 @@ module Docs
class Typescript class Typescript
class EntriesFilter < Docs::EntriesFilter class EntriesFilter < Docs::EntriesFilter
def get_name def get_name
name = at_css('h1').content name = at_css('h1').content.strip
name.sub! ' and ', ' & ' name.sub! ' and ', ' & '
name name
end end
@ -24,6 +24,7 @@ module Docs
css('.post-content h1, .post-content h2').each_with_object [] do |node, entries| css('.post-content h1, .post-content h2').each_with_object [] do |node, entries|
next if node.next_element.try(:name) == 'h2' next if node.next_element.try(:name) == 'h2'
node.css('.anchor-hash').remove
name = node.content.strip name = node.content.strip
next if name.length > 40 next if name.length > 40
next if name == self.name || SKIP_ENTRIES.any? { |str| name.include?(str) } next if name == self.name || SKIP_ENTRIES.any? { |str| name.include?(str) }

@ -2,7 +2,7 @@ module Docs
class Typescript < UrlScraper class Typescript < UrlScraper
self.name = 'TypeScript' self.name = 'TypeScript'
self.type = 'simple' self.type = 'simple'
self.release = '3.1.6' self.release = '3.7.2'
self.base_url = 'https://www.typescriptlang.org/docs/' self.base_url = 'https://www.typescriptlang.org/docs/'
self.root_path = 'tutorial.html' self.root_path = 'tutorial.html'
self.links = { self.links = {
@ -21,7 +21,7 @@ module Docs
} }
options[:attribution] = <<-HTML options[:attribution] = <<-HTML
&copy; Microsoft and other contributors<br> &copy; 2012-2019 Microsoft<br>
Licensed under the Apache License, Version 2.0. Licensed under the Apache License, Version 2.0.
HTML HTML

Loading…
Cancel
Save