|
|
@ -2,18 +2,13 @@ module Docs
|
|
|
|
class Npm
|
|
|
|
class Npm
|
|
|
|
class CleanHtmlFilter < Filter
|
|
|
|
class CleanHtmlFilter < Filter
|
|
|
|
def call
|
|
|
|
def call
|
|
|
|
|
|
|
|
@doc = at_css('main')
|
|
|
|
at_css('#___gatsby').before(at_css('h1'))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
css('details').remove
|
|
|
|
css('details').remove
|
|
|
|
|
|
|
|
css('nav[aria-label="Breadcrumbs"]').remove
|
|
|
|
css('.dZYhXG', '.fONtKn').remove
|
|
|
|
css('.gtWOdv').remove # Select CLI Version
|
|
|
|
|
|
|
|
css('.ezMiXD').remove # Navbox
|
|
|
|
css('.kSYjyK').remove
|
|
|
|
css('.gOhcvK').remove # Edit this page on GitHub
|
|
|
|
|
|
|
|
|
|
|
|
css('.cDvIaH').remove
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
css('.jRndWL').remove_attribute('style')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
css('pre').each do |node|
|
|
|
|
css('pre').each do |node|
|
|
|
|
node.content = node.css('.token-line').map(&:content).join("\n")
|
|
|
|
node.content = node.css('.token-line').map(&:content).join("\n")
|
|
|
@ -21,7 +16,6 @@ module Docs
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
doc
|
|
|
|
doc
|
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|