Update Rust documentation (1.10.0)

pull/438/head
Thibaut Courouble 9 years ago
parent 922754ab71
commit a83459be3e

@ -4,7 +4,7 @@ module Docs
def call
if slug.start_with?('book')
book
elsif slug.start_with?('reference')
elsif slug.start_with?('reference') || slug == 'error-index'
reference
else
api
@ -41,7 +41,11 @@ module Docs
end
def reference
css('#versioninfo').remove
css('#versioninfo', '.error-undescribed').remove
css('.error-described').each do |node|
node.before(node.children).remove
end
end
def api

@ -6,6 +6,8 @@ module Docs
at_css("#toc a[href='#{File.basename(slug)}']").content
elsif slug.start_with?('reference')
'Reference'
elsif slug == 'error-index'
'Compiler Errors'
else
name = at_css('h1.fqn .in-band').content.remove(/\A.+\s/)
mod = slug.split('/').first
@ -21,6 +23,8 @@ module Docs
'Guide'
elsif slug.start_with?('reference')
'Reference'
elsif slug == 'error-index'
'Compiler Errors'
else
path = name.split('::')
heading = at_css('h1.fqn .in-band').content.strip
@ -43,6 +47,10 @@ module Docs
id = node['href'].remove('#')
[name, id]
end
elsif slug == 'error-index'
css('.error-described h2.section-header').map do |node|
[node.content, node['id']]
end
else
css('#methods + * + div > .method', '#required-methods + div > .method', '#provided-methods + div > .method').map do |node|
name = node.at_css('.fnname').content

@ -1,13 +1,14 @@
module Docs
class Rust < UrlScraper
self.type = 'rust'
self.release = '1.9.0'
self.release = '1.10.0'
self.base_url = 'https://doc.rust-lang.org/'
self.root_path = 'book/index.html'
self.initial_paths = %w(
reference.html
collections/index.html
std/index.html)
std/index.html
error-index.html)
self.links = {
home: 'https://www.rust-lang.org/',
code: 'https://github.com/rust-lang/rust'

Loading…
Cancel
Save