Просмотр исходного кода

Update npm documentation (8.3.0)

Simon Legner 3 лет назад
Родитель
Сommit
119b150d88
2 измененных файлов с 6 добавлено и 1 удалено
  1. 5 0
      lib/docs/filters/npm/clean_html.rb
  2. 1 1
      lib/docs/scrapers/npm.rb

+ 5 - 0
lib/docs/filters/npm/clean_html.rb

@@ -15,6 +15,11 @@ module Docs
 
         css('.jRndWL').remove_attribute('style')
 
+        css('pre').each do |node|
+          node.content = node.css('.token-line').map(&:content).join("\n")
+          node['data-language'] = 'javascript'
+        end
+
         doc
 
       end

+ 1 - 1
lib/docs/scrapers/npm.rb

@@ -2,7 +2,7 @@ module Docs
   class Npm < UrlScraper
     self.name = 'npm'
     self.type = 'npm'
-    self.release = '8.1.4'
+    self.release = '8.3.0'
     self.base_url = 'https://docs.npmjs.com/'
     self.force_gzip = true
     self.links = {