History

Merge pull request #1133 from simon04/typescript

Jed Fox committed 6 years ago

Commit 33c2d142 parents f42afb6 c60aa3e4 files · +7 −5Browse files

Unified · Split

4 files
  1. assets/javascripts/templates/pages/about_tmpl.coffee +1 −1
  2. lib/docs/filters/typescript/clean_html.rb +2 −1
  3. lib/docs/filters/typescript/entries.rb +2 −1
  4. lib/docs/scrapers/typescript.rb +2 −2
assets/javascripts/templates/pages/about_tmpl.coffee+1−1
@@ -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 ], [
lib/docs/filters/typescript/clean_html.rb+2−1
@@ -9,6 +9,7 @@ module Docs · 8 unmodified lines
9 end9 end
10 10
11 css('.xs-toc-container').remove11 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 end20 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).remove25 node.before(node.children).remove
25 end26 end
lib/docs/filters/typescript/entries.rb+2−1
@@ -2,7 +2,7 @@ module Docs · 1 unmodified line
2 class Typescript2 class Typescript
3 class EntriesFilter < Docs::EntriesFilter3 class EntriesFilter < Docs::EntriesFilter
4 def get_name4 def get_name
5 name = at_css('h1').content5 name = at_css('h1').content.strip
6 name.sub! ' and ', ' & '6 name.sub! ' and ', ' & '
7 name7 name
8 end8 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.strip28 name = node.content.strip
28 next if name.length > 4029 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) }
lib/docs/scrapers/typescript.rb+2−2
@@ -2,7 +2,7 @@ module Docs · 1 unmodified line
2 class Typescript < UrlScraper2 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] = <<-HTML23 options[:attribution] = <<-HTML
24 &copy; Microsoft and other contributors<br>24 &copy; 2012-2019 Microsoft<br>
25 Licensed under the Apache License, Version 2.0.25 Licensed under the Apache License, Version 2.0.
26 HTML26 HTML
27 27