File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 puts subpath if at_css ( '#versioninfo' )
66
77 if slug . start_with? ( 'book' ) || slug . start_with? ( 'reference' )
8- @doc = at_css ( '#content' )
8+ @doc = at_css ( '#content main ' )
99 elsif slug == 'error-index'
1010 css ( '.error-undescribed' ) . remove
1111
@@ -30,7 +30,7 @@ def call
3030 css ( '.rusttest' , '.test-arrow' , 'hr' ) . remove
3131
3232 css ( 'a.header' ) . each do |node |
33- node . first_element_child [ 'id' ] = node [ 'name' ]
33+ node . first_element_child [ 'id' ] = node [ 'name' ] || node [ 'id' ]
3434 node . before ( node . children ) . remove
3535 end
3636
@@ -62,6 +62,9 @@ def call
6262 node [ 'data-language' ] = 'rust' if node [ 'class' ] && node [ 'class' ] . include? ( 'rust' )
6363 end
6464
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+
6568 doc
6669 end
6770 end
Original file line number Diff line number Diff line change 11module Docs
22 class Rust < UrlScraper
33 self . type = 'rust'
4- self . release = '1.26 .0'
4+ self . release = '1.28 .0'
55 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'
77 self . initial_paths = %w(
88 reference/introduction.html
99 collections/index.html
@@ -17,13 +17,13 @@ class Rust < UrlScraper
1717 html_filters . push 'rust/entries' , 'rust/clean_html'
1818
1919 options [ :only_patterns ] = [
20- /\A book\/ first -edition\/ / ,
20+ /\A book\/ second -edition\/ / ,
2121 /\A reference\/ / ,
2222 /\A collections\/ / ,
2323 /\A std\/ / ]
2424
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/ ]
2727
2828 options [ :fix_urls ] = -> ( url ) do
2929 url . sub! %r{(#{ Rust . base_url } .+/)\z } , '\1index.html'
You can’t perform that action at this time.
0 commit comments