Bump Nim to 2.0.2
Unified · Split
| @@ -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 | name | 22 | name.split("/").last |
| 21 | end | 23 | end |
| 22 | 24 | ||
| 23 | def get_type | 25 | def get_type |
| @@ -54,10 +56,11 @@ module Docs · 30 unmodified lines | |||
| 54 | else | 56 | 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.content | 59 | 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 | end | 64 | end |
| 62 | 65 | ||
| 63 | end | 66 | end |
| @@ -1,7 +1,6 @@ | |||
| 1 | module Docs | 1 | module Docs |
| 2 | class Nim < UrlScraper | 2 | 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] = <<-HTML | 15 | options[:attribution] = <<-HTML |
| 17 | © 2006–2021 Andreas Rumpf<br> | 16 | © 2006–2024 Andreas Rumpf<br> |
| 18 | Licensed under the MIT License. | 17 | Licensed under the MIT License. |
| 19 | HTML | 18 | 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.strip | 30 | doc.at_css('.container > .docinfo > tbody > tr:last-child > td').content.strip |