From e12068f64a113739ee77983c0e27acb9f60a606b Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Tue, 8 Jun 2021 10:42:28 +0200 Subject: [PATCH] Update TypeScript documentation (4.3.2) --- lib/docs/filters/typescript/clean_html.rb | 8 +++++--- lib/docs/filters/typescript/entries.rb | 2 ++ lib/docs/scrapers/typescript.rb | 3 ++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/docs/filters/typescript/clean_html.rb b/lib/docs/filters/typescript/clean_html.rb index 8bcc1bd2..f7ba2b33 100644 --- a/lib/docs/filters/typescript/clean_html.rb +++ b/lib/docs/filters/typescript/clean_html.rb @@ -30,13 +30,15 @@ module Docs @doc = at_css('article > .whitespace > .markdown') doc.child.before(deprecated) if deprecated else # tsconfig page - @doc = at_css('.markdown > div') - - at_css('h2').remove end css('.anchor', 'a:contains("Try")', 'h2 a', 'h3 a', 'svg', '#full-option-list').remove + # tsconfig page + css('.markdown', '.compiler-option', '.compiler-option-md', '.compiler-content').each do |node| + node.remove_attribute('class') + end + css('pre').each do |node| language = node.at_css('.language-id') ? node.at_css('.language-id').content : 'typescript' node.css('.language-id').remove diff --git a/lib/docs/filters/typescript/entries.rb b/lib/docs/filters/typescript/entries.rb index 8073f3ea..deb56c1f 100644 --- a/lib/docs/filters/typescript/entries.rb +++ b/lib/docs/filters/typescript/entries.rb @@ -14,6 +14,7 @@ module Docs ) def get_name + return 'TSConfig Reference' if slug == 'tsconfig' at_css('h1') ? at_css('h1').content : at_css('h2').content end @@ -27,6 +28,7 @@ module Docs def additional_entries return [] if DEPRECATED_PAGES.include? slug + return [] if slug == 'tsconfig-json' base_url.path == '/' ? tsconfig_entries : handbook_entries end diff --git a/lib/docs/scrapers/typescript.rb b/lib/docs/scrapers/typescript.rb index dbc6dab6..5f57fca6 100644 --- a/lib/docs/scrapers/typescript.rb +++ b/lib/docs/scrapers/typescript.rb @@ -4,7 +4,7 @@ module Docs self.name = 'TypeScript' self.type = 'typescript' - self.release = '4.2.3' + self.release = '4.3.2' self.base_urls = [ 'https://www.typescriptlang.org/docs/handbook/', 'https://www.typescriptlang.org/' @@ -30,6 +30,7 @@ module Docs options[:skip_patterns] = [ /release-notes/, + /dt\/search/, /play\// ]