History

Update Rust to 1.48.0 and improve clean_html filter

MasterEnoc committed 5 years ago

Commit c5f7de61 parent 8e3b2ce2 files · +3 −15Browse files

Unified · Split

2 files
  1. lib/docs/filters/rust/clean_html.rb +2 −13
  2. lib/docs/scrapers/rust.rb +1 −2
lib/docs/filters/rust/clean_html.rb+2−13
@@ -71,19 +71,6 @@ module Docs · 70 unmodified lines
7171 doc.first_element_child.name = 'h1' if doc.first_element_child.name = 'h2'
7272 at_css('h1').content = 'Rust Documentation' if root_page?
7373
74− css('.table-display').each do |node|
75− node.css('td').each do |td|
76− node.before(td.children)
77− end
78− node.remove
79− end
80−
81− css('.important-traits').to_a.each_with_index do |node, index|
82− content = node.at_css('.content.hidden .content')
83− node.at_css('.content.hidden').replace(content) if content
84− node.parent.after(node) if node.parent.name.in?(%(h2 h3 h4))
85− end
86−
8774 css('code.content').each do |node|
8875 node.name = 'pre'
8976 node.css('.fmt-newline').each do |line|
@@ -97,6 +84,8 @@ module Docs · 7 unmodified lines
9784 node.previous_element.before(node)
9885 end
9986
87+ css('.sidebar').remove
88+
10089 css('.collapse-toggle').remove
10190
10291 # Fix how notable-traits sections are shown
lib/docs/scrapers/rust.rb+1−2
@@ -3,12 +3,11 @@ · 2 unmodified lines
33 module Docs
44 class Rust < UrlScraper
55 self.type = 'rust'
6− self.release = '1.47.0'
6+ self.release = '1.48.0'
77 self.base_url = 'https://doc.rust-lang.org/'
88 self.root_path = 'book/index.html'
99 self.initial_paths = %w(
1010 reference/introduction.html
11− collections/index.html
1211 std/index.html
1312 error-index.html)
1413 self.links = {