Update Jest documentation (27.4.3)

pull/1670/head
Simon Legner 3 years ago
parent 3bdd5e37ec
commit 73814d55cc

@ -2,7 +2,8 @@ module Docs
class Jest class Jest
class CleanHtmlFilter < Filter class CleanHtmlFilter < Filter
def call def call
@doc = at_css('article') at_css('.markdown').prepend_child(at_css('h1'))
@doc = at_css('.markdown')
at_css('h1').content = 'Jest Documentation' if root_page? at_css('h1').content = 'Jest Documentation' if root_page?
@ -14,24 +15,15 @@ module Docs
end end
css('.prism-code').each do |node| css('.prism-code').each do |node|
node.parent.parent.before(node)
node.name = 'pre' node.name = 'pre'
node['data-language'] = 'js' node.remove_attribute('class')
node['data-language'] = node['class'][/language-(\w+)/, 1] if node['class'] node['data-language'] = 'typescript'
node.content = node.css('.token-line').map(&:content).join("\n")
counter = 0
node.css('.token-line').each do |subnode| # add newline each line of the code snippets
if counter == 0
else
subnode.content = "\n#{subnode.content}"
end
counter += 1
end
node.content = node.content
end end
css('*').remove_attribute('style')
doc doc
end end
end end

@ -2,7 +2,7 @@ module Docs
class Jest < UrlScraper class Jest < UrlScraper
include MultipleBaseUrls include MultipleBaseUrls
self.type = 'simple' self.type = 'simple'
self.release = '27.0.4' self.release = '27.4.3'
self.base_urls = [ self.base_urls = [
'https://jestjs.io/docs/', 'https://jestjs.io/docs/',
@ -18,7 +18,8 @@ module Docs
html_filters.push 'jest/entries', 'jest/clean_html' html_filters.push 'jest/entries', 'jest/clean_html'
options[:skip_patterns] = [ options[:skip_patterns] = [
/\d*.x/ # avoid deprecated versions /^next/,
/\d+\.[x\d]/ # avoid deprecated versions
] ]
options[:attribution] = <<-HTML options[:attribution] = <<-HTML

Loading…
Cancel
Save