Unified · Split
| @@ -763,7 +763,7 @@ credits = [ · 762 unmodified lines | |||
| 763 | 'https://twig.symfony.com/license' | 763 | 'https://twig.symfony.com/license' |
| 764 | ], [ | 764 | ], [ |
| 765 | 'TypeScript', | 765 | 'TypeScript', |
| 766 | 'Microsoft and other contributors', | 766 | '2012-2019 Microsoft', |
| 767 | 'Apache', | 767 | 'Apache', |
| 768 | 'https://raw.githubusercontent.com/Microsoft/TypeScript-Handbook/master/LICENSE' | 768 | 'https://raw.githubusercontent.com/Microsoft/TypeScript-Handbook/master/LICENSE' |
| 769 | ], [ | 769 | ], [ |
| @@ -9,6 +9,7 @@ module Docs · 8 unmodified lines | |||
| 9 | end | 9 | end |
| 10 | 10 | ||
| 11 | css('.xs-toc-container').remove | 11 | css('.xs-toc-container').remove |
| 12 | css('.anchor-hash').remove | ||
| 12 | 13 | ||
| 13 | css('article h1').each do |node| | 14 | css('article h1').each do |node| |
| 14 | node.name = 'h2' | 15 | node.name = 'h2' |
| @@ -19,7 +20,7 @@ module Docs · 4 unmodified lines | |||
| 19 | end | 20 | end |
| 20 | 21 | ||
| 21 | css('pre > code').each do |node| | 22 | css('pre > code').each do |node| |
| 22 | node.parent['data-language'] = node['class'].sub('ts', 'typescript').sub('js', 'javascript').remove('language-') | 23 | node.parent['data-language'] = node['class'].sub('ts', 'typescript').sub('js', 'javascript').remove('language-') if node['class'] |
| 23 | node.content = node.content.gsub(' ', ' ') | 24 | node.content = node.content.gsub(' ', ' ') |
| 24 | node.before(node.children).remove | 25 | node.before(node.children).remove |
| 25 | end | 26 | end |
| @@ -2,7 +2,7 @@ module Docs · 1 unmodified line | |||
| 2 | class Typescript | 2 | class Typescript |
| 3 | class EntriesFilter < Docs::EntriesFilter | 3 | class EntriesFilter < Docs::EntriesFilter |
| 4 | def get_name | 4 | def get_name |
| 5 | name = at_css('h1').content | 5 | name = at_css('h1').content.strip |
| 6 | name.sub! ' and ', ' & ' | 6 | name.sub! ' and ', ' & ' |
| 7 | name | 7 | name |
| 8 | end | 8 | end |
| @@ -24,6 +24,7 @@ module Docs · 15 unmodified lines | |||
| 24 | 24 | ||
| 25 | css('.post-content h1, .post-content h2').each_with_object [] do |node, entries| | 25 | css('.post-content h1, .post-content h2').each_with_object [] do |node, entries| |
| 26 | next if node.next_element.try(:name) == 'h2' | 26 | next if node.next_element.try(:name) == 'h2' |
| 27 | node.css('.anchor-hash').remove | ||
| 27 | name = node.content.strip | 28 | name = node.content.strip |
| 28 | next if name.length > 40 | 29 | next if name.length > 40 |
| 29 | next if name == self.name || SKIP_ENTRIES.any? { |str| name.include?(str) } | 30 | next if name == self.name || SKIP_ENTRIES.any? { |str| name.include?(str) } |
| @@ -2,7 +2,7 @@ module Docs · 1 unmodified line | |||
| 2 | class Typescript < UrlScraper | 2 | class Typescript < UrlScraper |
| 3 | self.name = 'TypeScript' | 3 | self.name = 'TypeScript' |
| 4 | self.type = 'simple' | 4 | self.type = 'simple' |
| 5 | self.release = '3.1.6' | 5 | self.release = '3.7.2' |
| 6 | self.base_url = 'https://www.typescriptlang.org/docs/' | 6 | self.base_url = 'https://www.typescriptlang.org/docs/' |
| 7 | self.root_path = 'tutorial.html' | 7 | self.root_path = 'tutorial.html' |
| 8 | self.links = { | 8 | self.links = { |
| @@ -21,7 +21,7 @@ module Docs · 12 unmodified lines | |||
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | options[:attribution] = <<-HTML | 23 | options[:attribution] = <<-HTML |
| 24 | © Microsoft and other contributors<br> | 24 | © 2012-2019 Microsoft<br> |
| 25 | Licensed under the Apache License, Version 2.0. | 25 | Licensed under the Apache License, Version 2.0. |
| 26 | HTML | 26 | HTML |
| 27 | 27 | ||