File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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{\A src/}
20+ name . remove! %r{\A std/}
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
Original file line number Diff line number Diff line change 11module 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- © 2006–2021 Andreas Rumpf< br >
16+ © 2006–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
You can’t perform that action at this time.
0 commit comments