https://devblogs.microsoft.com/typescript/announcing-the-new-typescript-handbook/
Unified · Split
| @@ -116,6 +116,7 @@ · 115 unmodified lines | ||
| 116 | 116 | 'pages/tcl_tk', |
| 117 | 117 | 'pages/tensorflow', |
| 118 | 118 | 'pages/terraform', |
| 119 | + 'pages/typescript', | |
| 119 | 120 | 'pages/underscore', |
| 120 | 121 | 'pages/vue', |
| 121 | 122 | 'pages/webpack', |
| @@ -0,0 +1,4 @@ | ||
| 1 | +._typescript { | |
| 2 | + @extend %simple; | |
| 3 | + .deprecated { @extend %label-red; } | |
| 4 | +} | |
| @@ -24,7 +24,11 @@ module Docs · 23 unmodified lines | ||
| 24 | 24 | |
| 25 | 25 | def other |
| 26 | 26 | if base_url.path == '/docs/handbook/' |
| 27 | + deprecated = at_css('#deprecated-content') | |
| 28 | + deprecated.css('h3', '#deprecated-icon').remove if deprecated | |
| 29 | + deprecated.add_class('deprecated') if deprecated | |
| 27 | 30 | @doc = at_css('article > .whitespace > .markdown') |
| 31 | + doc.child.before(deprecated) if deprecated | |
| 28 | 32 | else # tsconfig page |
| 29 | 33 | @doc = at_css('.markdown > div') |
| 30 | 34 | |
| @@ -36,9 +40,14 @@ module Docs · 5 unmodified lines | ||
| 36 | 40 | css('pre').each do |node| |
| 37 | 41 | language = node.at_css('.language-id') ? node.at_css('.language-id').content : 'typescript' |
| 38 | 42 | node.css('.language-id').remove |
| 39 | − node.content = node.content | |
| 43 | + if node.at_css('.line').nil? | |
| 44 | + node.content = node.content | |
| 45 | + else | |
| 46 | + node.content = node.css('.line').map(&:content).join("\n") | |
| 47 | + end | |
| 40 | 48 | node['data-language'] = LANGUAGE_REPLACE[language] || language |
| 41 | 49 | node.remove_attribute('class') |
| 50 | + node.remove_attribute('style') | |
| 42 | 51 | end |
| 43 | 52 | end |
| 44 | 53 | |
| @@ -2,15 +2,31 @@ module Docs · 1 unmodified line | ||
| 2 | 2 | class Typescript |
| 3 | 3 | class EntriesFilter < Docs::EntriesFilter |
| 4 | 4 | |
| 5 | + DEPRECATED_PAGES = %w( | |
| 6 | + advanced-types | |
| 7 | + basic-types | |
| 8 | + classes | |
| 9 | + functions | |
| 10 | + generics | |
| 11 | + interfaces | |
| 12 | + literal-types | |
| 13 | + unions-and-intersections | |
| 14 | + ) | |
| 15 | + | |
| 5 | 16 | def get_name |
| 6 | 17 | at_css('h1') ? at_css('h1').content : at_css('h2').content |
| 7 | 18 | end |
| 8 | 19 | |
| 9 | 20 | def get_type |
| 10 | − name | |
| 21 | + if DEPRECATED_PAGES.include? slug | |
| 22 | + 'Handbook (deprecated)' | |
| 23 | + else | |
| 24 | + name | |
| 25 | + end | |
| 11 | 26 | end |
| 12 | 27 | |
| 13 | 28 | def additional_entries |
| 29 | + return [] if DEPRECATED_PAGES.include? slug | |
| 14 | 30 | base_url.path == '/' ? tsconfig_entries : handbook_entries |
| 15 | 31 | end |
| 16 | 32 | |
| @@ -3,8 +3,8 @@ module Docs · 2 unmodified lines | ||
| 3 | 3 | include MultipleBaseUrls |
| 4 | 4 | |
| 5 | 5 | self.name = 'TypeScript' |
| 6 | − self.type = 'simple' | |
| 7 | − self.release = '4.2.2' | |
| 6 | + self.type = 'typescript' | |
| 7 | + self.release = '4.2.3' | |
| 8 | 8 | self.base_urls = [ |
| 9 | 9 | 'https://www.typescriptlang.org/docs/handbook/', |
| 10 | 10 | 'https://www.typescriptlang.org/' |
| @@ -29,7 +29,6 @@ module Docs · 18 unmodified lines | ||
| 29 | 29 | ] |
| 30 | 30 | |
| 31 | 31 | options[:skip_patterns] = [ |
| 32 | − /2/, | |
| 33 | 32 | /release-notes/, |
| 34 | 33 | /play\// |
| 35 | 34 | ] |