History

Merge pull request #2291 from virtual256/pr_rust_1.79.0

fix rust 1.79.0 docs std crate indexing

Simon Legner committed 2 years ago

Commit fe0d4692 parents 28c4ea6 febe65d4 files · +6 −2Browse files

Unified · Split

4 files
  1. assets/stylesheets/pages/_rust.scss +1 −1
  2. lib/docs/filters/rust/clean_html.rb +3 −0
  3. lib/docs/filters/rust/entries.rb +1 −0
  4. lib/docs/scrapers/rust.rb +1 −1
assets/stylesheets/pages/_rust.scss+1−1
@@ -14,7 +14,7 @@ · 13 unmodified lines
14 em.stab, span.stab { @extend %label; }14 em.stab, span.stab { @extend %label; }
15 em.stab.unstable, span.stab.unstable { @extend %label-orange; }15 em.stab.unstable, span.stab.unstable { @extend %label-orange; }
16 .out-of-band { float: right; }16 .out-of-band { float: right; }
17 .since, .srclink {17 .since, .src, .rightside {
18 float: right;18 float: right;
19 margin-left: .5rem;19 margin-left: .5rem;
20 }20 }
lib/docs/filters/rust/clean_html.rb+3−0
@@ -19,6 +19,7 @@ module Docs · 18 unmodified lines
19 css('.anchor').remove19 css('.anchor').remove
20 20
21 css('.main-heading > h1').each do |node|21 css('.main-heading > h1').each do |node|
22 node.at('button')&.remove
22 node.parent.name = 'h1'23 node.parent.name = 'h1'
23 node.parent.content = node.content24 node.parent.content = node.content
24 end25 end
@@ -29,6 +30,8 @@ module Docs · 4 unmodified lines
29 end30 end
30 end31 end
31 32
33 css('.doc-anchor').remove
34
32 # Fix notable trait sections35 # Fix notable trait sections
33 css('.method, .rust.trait').each do |node|36 css('.method, .rust.trait').each do |node|
34 traitSection = node.at_css('.notable-traits')37 traitSection = node.at_css('.notable-traits')
lib/docs/filters/rust/entries.rb+1−0
@@ -9,6 +9,7 @@ module Docs · 8 unmodified lines
9 elsif slug == 'error-index'9 elsif slug == 'error-index'
10 'Compiler Errors'10 'Compiler Errors'
11 else11 else
12 at_css('main h1').at_css('button')&.remove
12 name = at_css('main h1').content.remove(/\A.+\s/).remove('⎘')13 name = at_css('main h1').content.remove(/\A.+\s/).remove('⎘')
13 mod = slug.split('/').first14 mod = slug.split('/').first
14 name.prepend("#{mod}::") unless name.start_with?(mod)15 name.prepend("#{mod}::") unless name.start_with?(mod)
lib/docs/scrapers/rust.rb+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
3module Docs3module Docs
4 class Rust < UrlScraper4 class Rust < UrlScraper
5 self.type = 'rust'5 self.type = 'rust'
6 self.release = '1.79.0'6 self.release = '1.80.0'
7 self.base_url = 'https://doc.rust-lang.org/'7 self.base_url = 'https://doc.rust-lang.org/'
8 self.root_path = 'book/index.html'8 self.root_path = 'book/index.html'
9 self.initial_paths = %w(9 self.initial_paths = %w(