File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 5
5
puts subpath if at_css ( '#versioninfo' )
6
6
7
7
if slug . start_with? ( 'book' ) || slug . start_with? ( 'reference' )
8
- @doc = at_css ( '#content' )
8
+ @doc = at_css ( '#content main ' )
9
9
elsif slug == 'error-index'
10
10
css ( '.error-undescribed' ) . remove
11
11
@@ -30,7 +30,7 @@ def call
30
30
css ( '.rusttest' , '.test-arrow' , 'hr' ) . remove
31
31
32
32
css ( 'a.header' ) . each do |node |
33
- node . first_element_child [ 'id' ] = node [ 'name' ]
33
+ node . first_element_child [ 'id' ] = node [ 'name' ] || node [ 'id' ]
34
34
node . before ( node . children ) . remove
35
35
end
36
36
@@ -62,6 +62,9 @@ def call
62
62
node [ 'data-language' ] = 'rust' if node [ 'class' ] && node [ 'class' ] . include? ( 'rust' )
63
63
end
64
64
65
+ doc . first_element_child . name = 'h1' if doc . first_element_child . name = 'h2'
66
+ at_css ( 'h1' ) . content = 'Rust Documentation' if root_page?
67
+
65
68
doc
66
69
end
67
70
end
Original file line number Diff line number Diff line change 1
1
module Docs
2
2
class Rust < UrlScraper
3
3
self . type = 'rust'
4
- self . release = '1.26 .0'
4
+ self . release = '1.28 .0'
5
5
self . base_url = 'https://doc.rust-lang.org/'
6
- self . root_path = 'book/first -edition/index.html'
6
+ self . root_path = 'book/second -edition/index.html'
7
7
self . initial_paths = %w(
8
8
reference/introduction.html
9
9
collections/index.html
@@ -17,13 +17,13 @@ class Rust < UrlScraper
17
17
html_filters . push 'rust/entries' , 'rust/clean_html'
18
18
19
19
options [ :only_patterns ] = [
20
- /\A book\/ first -edition\/ / ,
20
+ /\A book\/ second -edition\/ / ,
21
21
/\A reference\/ / ,
22
22
/\A collections\/ / ,
23
23
/\A std\/ / ]
24
24
25
- options [ :skip ] = %w( book/first -edition/README.html )
26
- options [ :skip_patterns ] = [ /(?<!\. html)\z / ]
25
+ options [ :skip ] = %w( book/second -edition/README.html )
26
+ options [ :skip_patterns ] = [ /(?<!\. html)\z / , / \/ print \. html/ ]
27
27
28
28
options [ :fix_urls ] = -> ( url ) do
29
29
url . sub! %r{(#{ Rust . base_url } .+/)\z } , '\1index.html'
You can’t perform that action at this time.
0 commit comments