Update Babel documentation (7.21.1)

See #1926
pull/1931/head
Simon Legner 2 years ago
parent bfc0e59e8e
commit 7fd7b0e151

@ -3,6 +3,8 @@ module Docs
class CleanHtmlFilter < Filter class CleanHtmlFilter < Filter
def call def call
@doc = at_css('.theme-doc-markdown')
css('.fixedHeaderContainer').remove css('.fixedHeaderContainer').remove
css('.toc').remove css('.toc').remove
@ -15,14 +17,17 @@ module Docs
css('.docs-prevnext').remove css('.docs-prevnext').remove
css('pre > code.hljs').each do |node|
node.parent['data-language'] = node['class'][/language-(\w+)/, 1]
end
css('pre').each do |node| css('pre').each do |node|
node.content = node.content node.content = node.css('.token-line').map(&:content).join("\n")
node['data-language'] = node['class'][/language-(\w+)/, 1]
end end
css('.codeBlockTitle_x_ju').remove
css('*').remove_attr('class')
css('*').remove_attr('style')
doc doc
end end

@ -1,7 +1,7 @@
module Docs module Docs
class Babel < UrlScraper class Babel < UrlScraper
self.type = 'simple' self.type = 'simple'
self.base_url = 'https://babeljs.io/docs/en/' self.base_url = 'https://babeljs.io/docs/'
self.links = { self.links = {
home: 'https://babeljs.io/', home: 'https://babeljs.io/',
code: 'https://github.com/babel/babel' code: 'https://github.com/babel/babel'
@ -30,7 +30,7 @@ module Docs
HTML HTML
version '7' do version '7' do
self.release = '7.16.4' self.release = '7.21.1'
end end
version '6' do version '6' do

Loading…
Cancel
Save