Browse Source

Merge pull request #2534 from NasaGeek/tcltk-90-support

Add support for tcl9.0 and fix some other Tcl issues
Simon Legner 4 months ago
parent
commit
8faf954b2e

+ 4 - 0
lib/docs/filters/tcl_tk/clean_html.rb

@@ -35,6 +35,10 @@ module Docs
           node.content = node.content.capitalize
         end
 
+        css('pre').each do |node|
+          node['data-language'] = 'tcl'
+        end
+
         doc
       end
     end

+ 14 - 6
lib/docs/scrapers/tcl_tk.rb

@@ -3,11 +3,8 @@ module Docs
     self.name = 'Tcl/Tk'
     self.type = 'tcl_tk'
     self.slug = 'tcl_tk'
-    self.release = '8.6.6'
-    self.base_url = 'https://www.tcl.tk/man/tcl/'
-    self.root_path = 'contents.htm'
     self.links = {
-      home: 'https://www.tcl.tk/',
+      home: 'https://www.tcl-lang.org/',
       code: 'https://sourceforge.net/projects/tcl/files/Tcl/'
     }
 
@@ -27,11 +24,22 @@ module Docs
     ]
 
     options[:attribution] = <<-HTML
-      Licensed under <a href="http://tcl.tk/software/tcltk/license.html">Tcl/Tk terms</a>
+      Licensed under <a href="http://www.tcl-lang.org/software/tcltk/license.html">Tcl/Tk terms</a>
     HTML
 
+    version '9.0' do
+      self.base_url = "https://www.tcl-lang.org/man/tcl#{self.version}/"
+      self.release = '9.0.2'
+    end
+
+    version '8.6' do
+      self.base_url = "https://www.tcl-lang.org/man/tcl#{self.version}/"
+      self.root_path = 'contents.htm'
+      self.release = '8.6.16'
+    end
+
     def get_latest_version(opts)
-      doc = fetch_doc('https://www.tcl.tk/man/tcl/contents.htm', opts)
+      doc = fetch_doc('https://www.tcl-lang.org/man/tcl/', opts)
       doc.at_css('h2').content.scan(/Tk([0-9.]+)/)[0][0]
     end
   end

BIN
public/icons/docs/tcl_tk/16.png


BIN
public/icons/docs/tcl_tk/16@2.png


BIN
public/icons/docs/tcl_tk/16@2x.png


+ 1 - 1
public/icons/docs/tcl_tk/SOURCE

@@ -1 +1 @@
-https://commons.wikimedia.org/wiki/File:Tcl.svg
+https://www.tcl-lang.org/images/plume.png