History

Merge pull request #2146 from ire4ever1190/chore/bump-nim

Bump Nim to 2.0.2

Simon Legner committed 2 years ago

Commit ce6eca52 parents f904f55 e57c6f72 files · +16 −6Browse files

Unified · Split

2 files
  1. lib/docs/filters/nim/entries.rb +7 −4
  2. lib/docs/scrapers/nim.rb +9 −2
lib/docs/filters/nim/entries.rb+7−4
@@ -16,8 +16,10 @@ module Docs · 15 unmodified lines
16 name.remove! ' User Guide'16 name.remove! ' User Guide'
17 name.remove! ' User\'s manual'17 name.remove! ' User\'s manual'
18 name.remove! %r{ \-.*}18 name.remove! %r{ \-.*}
19 name.remove! %r{\Asrc/}
20 name.remove! %r{\Astd/}
19 name.strip!21 name.strip!
20 name22 name.split("/").last
21 end23 end
22 24
23 def get_type25 def get_type
@@ -54,10 +56,11 @@ module Docs · 30 unmodified lines
54 else56 else
55 57
56 css('.simple-toc-section a, .nested-toc-section a').each do |node|58 css('.simple-toc-section a, .nested-toc-section a').each do |node|
57 entry_name = node.content59 match = /^`(.*)`|^(\w+)/.match(node.content)
58 entry_name.gsub!(/,.*/, '')60 entry_name = match[1] || match[2]
61
59 entry_id = slug + node['href']62 entry_id = slug + node['href']
60 entries << [entry_name, entry_id, name]63 entries << ["#{entry_name} (#{name})", entry_id, name]
61 end64 end
62 65
63 end66 end
lib/docs/scrapers/nim.rb+9−2
@@ -1,7 +1,6 @@
1module Docs1module Docs
2 class Nim < UrlScraper2 class Nim < UrlScraper
3 self.type = 'simple'3 self.type = 'simple'
4 self.release = '1.4.8'
5 self.base_url = 'https://nim-lang.org/docs/'4 self.base_url = 'https://nim-lang.org/docs/'
6 self.root_path = 'overview.html'5 self.root_path = 'overview.html'
7 self.links = {6 self.links = {
@@ -14,10 +13,18 @@ module Docs · 6 unmodified lines
14 options[:skip] = %w(theindex.html docgen.html tut1.html tut2.html tut3.html tools.html)13 options[:skip] = %w(theindex.html docgen.html tut1.html tut2.html tut3.html tools.html)
15 14
16 options[:attribution] = <<-HTML15 options[:attribution] = <<-HTML
17 &copy; 2006&ndash;2021 Andreas Rumpf<br>16 &copy; 2006&ndash;2024 Andreas Rumpf<br>
18 Licensed under the MIT License.17 Licensed under the MIT License.
19 HTML18 HTML
20 19
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
21 def get_latest_version(opts)28 def get_latest_version(opts)
22 doc = fetch_doc('https://nim-lang.org/docs/overview.html', opts)29 doc = fetch_doc('https://nim-lang.org/docs/overview.html', opts)
23 doc.at_css('.container > .docinfo > tbody > tr:last-child > td').content.strip30 doc.at_css('.container > .docinfo > tbody > tr:last-child > td').content.strip