Skip to content

Commit 8faf954

Browse files
authored
Merge pull request freeCodeCamp#2534 from NasaGeek/tcltk-90-support
Add support for tcl9.0 and fix some other Tcl issues
2 parents 59e990a + 6b680d1 commit 8faf954

File tree

6 files changed

+19
-7
lines changed

6 files changed

+19
-7
lines changed

lib/docs/filters/tcl_tk/clean_html.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ def call
3535
node.content = node.content.capitalize
3636
end
3737

38+
css('pre').each do |node|
39+
node['data-language'] = 'tcl'
40+
end
41+
3842
doc
3943
end
4044
end

lib/docs/scrapers/tcl_tk.rb

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@ class TclTk < UrlScraper
33
self.name = 'Tcl/Tk'
44
self.type = 'tcl_tk'
55
self.slug = 'tcl_tk'
6-
self.release = '8.6.6'
7-
self.base_url = 'https://www.tcl.tk/man/tcl/'
8-
self.root_path = 'contents.htm'
96
self.links = {
10-
home: 'https://www.tcl.tk/',
7+
home: 'https://www.tcl-lang.org/',
118
code: 'https://sourceforge.net/projects/tcl/files/Tcl/'
129
}
1310

@@ -27,11 +24,22 @@ class TclTk < UrlScraper
2724
]
2825

2926
options[:attribution] = <<-HTML
30-
Licensed under <a href="http://tcl.tk/software/tcltk/license.html">Tcl/Tk terms</a>
27+
Licensed under <a href="http://www.tcl-lang.org/software/tcltk/license.html">Tcl/Tk terms</a>
3128
HTML
3229

30+
version '9.0' do
31+
self.base_url = "https://www.tcl-lang.org/man/tcl#{self.version}/"
32+
self.release = '9.0.2'
33+
end
34+
35+
version '8.6' do
36+
self.base_url = "https://www.tcl-lang.org/man/tcl#{self.version}/"
37+
self.root_path = 'contents.htm'
38+
self.release = '8.6.16'
39+
end
40+
3341
def get_latest_version(opts)
34-
doc = fetch_doc('https://www.tcl.tk/man/tcl/contents.htm', opts)
42+
doc = fetch_doc('https://www.tcl-lang.org/man/tcl/', opts)
3543
doc.at_css('h2').content.scan(/Tk([0-9.]+)/)[0][0]
3644
end
3745
end

public/icons/docs/tcl_tk/16.png

8.34 KB
Loading

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

-853 Bytes
Binary file not shown.

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

9.3 KB
Loading

public/icons/docs/tcl_tk/SOURCE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
https://commons.wikimedia.org/wiki/File:Tcl.svg
1+
https://www.tcl-lang.org/images/plume.png

0 commit comments

Comments
 (0)