Sfoglia il codice sorgente

Update Vert.x documentation

Simon Legner 6 mesi fa
parent
commit
e6d8941486

+ 4 - 0
assets/javascripts/news.json

@@ -1,4 +1,8 @@
 [
+  [
+    "2025-05-28",
+    "New documentation: <a href=\"/vertx/\">Vert.x</a>"
+  ],
   [
     "2025-02-23",
     "New documentation: <a href=\"/threejs/\">Three.js</a>"

+ 1 - 0
lib/docs/filters/vertx/clean_html.rb

@@ -22,6 +22,7 @@ module Docs
 
         # Remove code highlighting
         css('pre').each do |node|
+          node['data-language'] = node.at_css('code')['data-lang'] if node.at_css('code')
           node.content = node.content
         end
 

+ 13 - 6
lib/docs/scrapers/vertx.rb

@@ -1,5 +1,7 @@
 module Docs
   class Vertx < UrlScraper
+    self.name = 'Vert.x'
+    self.slug = 'vertx'
     self.type = 'vertx'
     self.links = {
       home: 'http://vertx.io',
@@ -21,19 +23,24 @@ module Docs
       /blog/,
     ]
 
-    version '5.0.0' do
+    version '5' do
       self.release = '5.0.0'
       self.base_url = "https://vertx.io/docs/"
     end
 
-    version '4.5.15' do
+    version '4' do
       self.release = '4.5.15'
-      self.base_url = "https://vertx.io/docs/#{self.version}"
+      self.base_url = "https://vertx.io/docs/#{self.release}"
     end
 
-    version '3.9.16' do
-      self.release = '4.5.15'
-      self.base_url = "https://vertx.io/docs/#{self.version}"
+    version '3' do
+      self.release = '3.9.16'
+      self.base_url = "https://vertx.io/docs/#{self.release}"
+    end
+
+    def get_latest_version(opts)
+      doc = fetch_doc('https://repo1.maven.org/maven2/io/vertx/vertx-stack-manager/maven-metadata.xml', opts)
+      doc.css('version')[-1].text
     end
   end
 end