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
763763 'https://twig.symfony.com/license'
764764 ], [
765765 'TypeScript',
766− 'Microsoft and other contributors',
766+ '2012-2019 Microsoft',
767767 'Apache',
768768 'https://raw.githubusercontent.com/Microsoft/TypeScript-Handbook/master/LICENSE'
769769 ], [
lib/docs/filters/typescript/clean_html.rb+2−1
@@ -9,6 +9,7 @@ module Docs · 8 unmodified lines
99 end
1010
1111 css('.xs-toc-container').remove
12+ css('.anchor-hash').remove
1213
1314 css('article h1').each do |node|
1415 node.name = 'h2'
@@ -19,7 +20,7 @@ module Docs · 4 unmodified lines
1920 end
2021
2122 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']
2324 node.content = node.content.gsub(' ', ' ')
2425 node.before(node.children).remove
2526 end
lib/docs/filters/typescript/entries.rb+2−1
@@ -2,7 +2,7 @@ module Docs · 1 unmodified line
22 class Typescript
33 class EntriesFilter < Docs::EntriesFilter
44 def get_name
5− name = at_css('h1').content
5+ name = at_css('h1').content.strip
66 name.sub! ' and ', ' & '
77 name
88 end
@@ -24,6 +24,7 @@ module Docs · 15 unmodified lines
2424
2525 css('.post-content h1, .post-content h2').each_with_object [] do |node, entries|
2626 next if node.next_element.try(:name) == 'h2'
27+ node.css('.anchor-hash').remove
2728 name = node.content.strip
2829 next if name.length > 40
2930 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
22 class Typescript < UrlScraper
33 self.name = 'TypeScript'
44 self.type = 'simple'
5− self.release = '3.1.6'
5+ self.release = '3.7.2'
66 self.base_url = 'https://www.typescriptlang.org/docs/'
77 self.root_path = 'tutorial.html'
88 self.links = {
@@ -21,7 +21,7 @@ module Docs · 12 unmodified lines
2121 }
2222
2323 options[:attribution] = <<-HTML
24− &copy; Microsoft and other contributors<br>
24+ &copy; 2012-2019 Microsoft<br>
2525 Licensed under the Apache License, Version 2.0.
2626 HTML
2727