Skip to content

Commit ce6eca5

Browse files
authored
Merge pull request #2146 from ire4ever1190/chore/bump-nim
Bump Nim to 2.0.2
2 parents f904f55 + e57c6f7 commit ce6eca5

2 files changed

Lines changed: 16 additions & 6 deletions

File tree

lib/docs/filters/nim/entries.rb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ def get_name
1616
name.remove! ' User Guide'
1717
name.remove! ' User\'s manual'
1818
name.remove! %r{ \-.*}
19+
name.remove! %r{\Asrc/}
20+
name.remove! %r{\Astd/}
1921
name.strip!
20-
name
22+
name.split("/").last
2123
end
2224

2325
def get_type
@@ -54,10 +56,11 @@ def additional_entries
5456
else
5557

5658
css('.simple-toc-section a, .nested-toc-section a').each do |node|
57-
entry_name = node.content
58-
entry_name.gsub!(/,.*/, '')
59+
match = /^`(.*)`|^(\w+)/.match(node.content)
60+
entry_name = match[1] || match[2]
61+
5962
entry_id = slug + node['href']
60-
entries << [entry_name, entry_id, name]
63+
entries << ["#{entry_name} (#{name})", entry_id, name]
6164
end
6265

6366
end

lib/docs/scrapers/nim.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
module Docs
22
class Nim < UrlScraper
33
self.type = 'simple'
4-
self.release = '1.4.8'
54
self.base_url = 'https://nim-lang.org/docs/'
65
self.root_path = 'overview.html'
76
self.links = {
@@ -14,10 +13,18 @@ class Nim < UrlScraper
1413
options[:skip] = %w(theindex.html docgen.html tut1.html tut2.html tut3.html tools.html)
1514

1615
options[:attribution] = <<-HTML
17-
&copy; 2006&ndash;2021 Andreas Rumpf<br>
16+
&copy; 2006&ndash;2024 Andreas Rumpf<br>
1817
Licensed under the MIT License.
1918
HTML
2019

20+
version do
21+
self.release = '2.0.2'
22+
end
23+
24+
version '1' do
25+
self.release = '1.4.8'
26+
end
27+
2128
def get_latest_version(opts)
2229
doc = fetch_doc('https://nim-lang.org/docs/overview.html', opts)
2330
doc.at_css('.container > .docinfo > tbody > tr:last-child > td').content.strip

0 commit comments

Comments
 (0)