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