File tree Expand file tree Collapse file tree 3 files changed +12
-9
lines changed
Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -16,12 +16,9 @@ def call
1616 @doc = at_css ( '#main, #main-content' )
1717
1818 css ( '.toggle-wrapper' ) . remove
19+ css ( '.anchor' ) . remove
1920
20- css ( 'h1.fqn' ) . each do |node |
21- node . content = node . at_css ( '.in-band' ) . content
22- end
23-
24- css ( '.main-heading > h1.fqn' ) . each do |node |
21+ css ( '.main-heading > h1' ) . each do |node |
2522 node . parent . name = 'h1'
2623 node . parent . content = node . content
2724 end
@@ -107,6 +104,12 @@ def call
107104 node . content = node . content
108105 end
109106
107+ css ( '.rightside' ) . each do |node |
108+ node . children . each do |child |
109+ child . remove if child . text? ( ) and child . text ( ) == " · "
110+ end
111+ end
112+
110113 css ( '.since + .srclink' ) . each do |node |
111114 node . previous_element . before ( node )
112115 end
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ def get_name
99 elsif slug == 'error-index'
1010 'Compiler Errors'
1111 else
12- name = at_css ( 'h1.fqn .in-band ' ) . content . remove ( /\A .+\s / ) . remove ( '⎘' )
12+ name = at_css ( 'main h1 ' ) . content . remove ( /\A .+\s / ) . remove ( '⎘' )
1313 mod = slug . split ( '/' ) . first
1414 name . prepend ( "#{ mod } ::" ) unless name . start_with? ( mod )
1515 name
@@ -27,7 +27,7 @@ def get_type
2727 'Compiler Errors'
2828 else
2929 path = name . split ( '::' )
30- heading = at_css ( 'h1.fqn .in-band ' ) . content . strip
30+ heading = at_css ( 'main h1 ' ) . content . strip
3131 if path . length > 2 || ( path . length == 2 && ( heading . start_with? ( 'Module' ) || heading . start_with? ( 'Primitive' ) ) )
3232 path [ 0 ..1 ] . join ( '::' )
3333 else
@@ -46,7 +46,7 @@ def additional_entries
4646 else
4747 css ( '.method' )
4848 . each_with_object ( { } ) { |node , entries |
49- name = node . at_css ( '.fnname ' ) . try ( :content )
49+ name = node . at_css ( 'a.fn ' ) . try ( :content )
5050 next unless name
5151 name . prepend "#{ self . name } ::"
5252 entries [ name ] ||= [ name , node [ 'id' ] ]
Original file line number Diff line number Diff line change 33module Docs
44 class Rust < UrlScraper
55 self . type = 'rust'
6- self . release = '1.65 .0'
6+ self . release = '1.71 .0'
77 self . base_url = 'https://doc.rust-lang.org/'
88 self . root_path = 'book/index.html'
99 self . initial_paths = %w(
You can’t perform that action at this time.
0 commit comments