Unified · Split
| @@ -2,7 +2,8 @@ module Docs · 1 unmodified line | ||
| 2 | 2 | class Jest |
| 3 | 3 | class CleanHtmlFilter < Filter |
| 4 | 4 | def call |
| 5 | − @doc = at_css('article') | |
| 5 | + at_css('.markdown').prepend_child(at_css('h1')) | |
| 6 | + @doc = at_css('.markdown') | |
| 6 | 7 | |
| 7 | 8 | at_css('h1').content = 'Jest Documentation' if root_page? |
| 8 | 9 | |
| @@ -14,24 +15,15 @@ module Docs · 5 unmodified lines | ||
| 14 | 15 | end |
| 15 | 16 | |
| 16 | 17 | css('.prism-code').each do |node| |
| 18 | + node.parent.parent.before(node) | |
| 17 | 19 | node.name = 'pre' |
| 18 | − node['data-language'] = 'js' | |
| 19 | − node['data-language'] = node['class'][/language-(\w+)/, 1] if node['class'] | |
| 20 | − | |
| 21 | − counter = 0 | |
| 22 | − | |
| 23 | − node.css('.token-line').each do |subnode| # add newline each line of the code snippets | |
| 24 | − if counter == 0 | |
| 25 | − else | |
| 26 | − subnode.content = "\n#{subnode.content}" | |
| 27 | − end | |
| 28 | − | |
| 29 | − counter += 1 | |
| 30 | − end | |
| 31 | − | |
| 32 | − node.content = node.content | |
| 20 | + node.remove_attribute('class') | |
| 21 | + node['data-language'] = 'typescript' | |
| 22 | + node.content = node.css('.token-line').map(&:content).join("\n") | |
| 33 | 23 | end |
| 34 | 24 | |
| 25 | + css('*').remove_attribute('style') | |
| 26 | + | |
| 35 | 27 | doc |
| 36 | 28 | end |
| 37 | 29 | end |
| @@ -2,7 +2,7 @@ module Docs · 1 unmodified line | ||
| 2 | 2 | class Jest < UrlScraper |
| 3 | 3 | include MultipleBaseUrls |
| 4 | 4 | self.type = 'simple' |
| 5 | − self.release = '27.0.4' | |
| 5 | + self.release = '27.4.3' | |
| 6 | 6 | |
| 7 | 7 | self.base_urls = [ |
| 8 | 8 | 'https://jestjs.io/docs/', |
| @@ -18,7 +18,8 @@ module Docs · 9 unmodified lines | ||
| 18 | 18 | html_filters.push 'jest/entries', 'jest/clean_html' |
| 19 | 19 | |
| 20 | 20 | options[:skip_patterns] = [ |
| 21 | − /\d*.x/ # avoid deprecated versions | |
| 21 | + /^next/, | |
| 22 | + /\d+\.[x\d]/ # avoid deprecated versions | |
| 22 | 23 | ] |
| 23 | 24 | |
| 24 | 25 | options[:attribution] = <<-HTML |