diff --git a/lib/docs/filters/node/clean_html.rb b/lib/docs/filters/node/clean_html.rb
index 94ca39f666..3827fe0339 100644
--- a/lib/docs/filters/node/clean_html.rb
+++ b/lib/docs/filters/node/clean_html.rb
@@ -2,6 +2,10 @@ module Docs
class Node
class CleanHtmlFilter < Filter
def call
+ unless at_css('h1')
+ at_css('h2').name = 'h1'
+ end
+
css('hr').remove
css('pre').each do |node|
diff --git a/lib/docs/filters/node/entries.rb b/lib/docs/filters/node/entries.rb
index e5d508f7fc..45d581aae3 100644
--- a/lib/docs/filters/node/entries.rb
+++ b/lib/docs/filters/node/entries.rb
@@ -7,7 +7,7 @@ def get_name
end
def get_type
- at_css('h2').content.strip
+ at_css('h1, h2').content.strip
end
def additional_entries
diff --git a/lib/docs/scrapers/nginx.rb b/lib/docs/scrapers/nginx.rb
index 323bc6d5de..d7bdf11131 100644
--- a/lib/docs/scrapers/nginx.rb
+++ b/lib/docs/scrapers/nginx.rb
@@ -2,7 +2,7 @@ module Docs
class Nginx < UrlScraper
self.name = 'nginx'
self.type = 'nginx'
- self.release = '1.30.0'
+ self.release = '1.31.1'
self.base_url = 'https://nginx.org/en/docs/'
self.links = {
home: 'https://nginx.org/',
diff --git a/lib/docs/scrapers/node.rb b/lib/docs/scrapers/node.rb
index eeca5a5659..a0cea6a51a 100644
--- a/lib/docs/scrapers/node.rb
+++ b/lib/docs/scrapers/node.rb
@@ -24,7 +24,7 @@ class Node < UrlScraper
HTML
version do
- self.release = '25.8.0'
+ self.release = '26.2.0'
self.base_url = 'https://nodejs.org/api/'
end
diff --git a/lib/tasks/docs.thor b/lib/tasks/docs.thor
index 8dc32d85a9..aef72ed267 100644
--- a/lib/tasks/docs.thor
+++ b/lib/tasks/docs.thor
@@ -235,6 +235,7 @@ class DocsCLI < Thor
puts 'Docs -- BEGIN'
require 'open-uri'
+ require 'net/http'
require 'thread'
docs = Docs.all_versions
@@ -250,15 +251,30 @@ class DocsCLI < Thor
['index.json', 'meta.json'].each do |filename|
json = "https://documents.devdocs.io/#{doc.path}/#{filename}?#{time}"
begin
- URI.open(json, "Accept-Encoding" => "identity") do |file|
- mutex.synchronize do
- path = File.join(dir, filename)
- File.write(path, file.read)
+ attempts = 0
+
+ begin
+ attempts += 1
+
+ URI.open(json, "Accept-Encoding" => "identity") do |file|
+ mutex.synchronize do
+ path = File.join(dir, filename)
+ File.write(path, file.read)
+ end
end
+ rescue Net::OpenTimeout, Net::ReadTimeout => e
+ if attempts <= 3
+ wait_seconds = 2**(attempts - 1)
+ puts "Docs -- Retrying #{json} in #{wait_seconds}s (#{e.class}: #{e.message})"
+ sleep(wait_seconds)
+ retry
+ end
+
+ raise
end
rescue => e
- puts "Docs -- Failed to download #{json}!"
- throw e
+ puts "Docs -- Failed to download #{json} after #{attempts} attempts!"
+ raise
end
end