Unified · Split
| @@ -33,13 +33,22 @@ module Docs · 32 unmodified lines | ||
| 33 | 33 | # We can't use options[:container] here because the entries filter uses the breadcrumbs node |
| 34 | 34 | @doc = at_css('.main-content') |
| 35 | 35 | |
| 36 | + # Remove external links | |
| 37 | + css('#external-links').remove | |
| 38 | + | |
| 39 | + # Properly format header in v2 docs | |
| 40 | + nested_title = at_css('div > h1') | |
| 41 | + unless nested_title.nil? | |
| 42 | + nested_title.parent.replace nested_title | |
| 43 | + end | |
| 44 | + | |
| 36 | 45 | # Move the features (i.e. "read-only, inherited") into the blue header |
| 37 | 46 | css('.features').each do |node| |
| 38 | 47 | header = node.xpath('parent::dd/preceding::dt').last |
| 39 | 48 | header.add_child node unless header.nil? |
| 40 | 49 | end |
| 41 | 50 | |
| 42 | − css('section').each do |node| | |
| 51 | + css('section:not(.multi-line-signature)').each do |node| | |
| 43 | 52 | if node['id'] && node.first_element_child |
| 44 | 53 | node.first_element_child['id'] ||= node['id'] |
| 45 | 54 | end |
| @@ -54,7 +63,7 @@ module Docs · 8 unmodified lines | ||
| 54 | 63 | # Make code blocks detectable by Prism |
| 55 | 64 | css('pre').each do |node| |
| 56 | 65 | node['data-language'] = 'dart' |
| 57 | − node.content = node.content | |
| 66 | + node.content = node.content.strip | |
| 58 | 67 | end |
| 59 | 68 | |
| 60 | 69 | css('.properties', '.property', '.callables', '.callable').remove_attr('class') |
| @@ -7,7 +7,7 @@ module Docs · 6 unmodified lines | ||
| 7 | 7 | name = title.element_children.last.content.strip |
| 8 | 8 | kind = title.at_css('.kind').content |
| 9 | 9 | else # v2 |
| 10 | − title = at_css('.main-content > h1') | |
| 10 | + title = at_css('.main-content > div > h1') | |
| 11 | 11 | name = title.content[/(.*)( )/, 1].split(' top-level')[0] |
| 12 | 12 | kind = title.content[/(.*)( )(.+)/, 3] |
| 13 | 13 | end |
| @@ -15,7 +15,7 @@ module Docs · 1 unmodified line | ||
| 15 | 15 | breadcrumbs = at_css('.breadcrumbs').css('li:not(.self-crumb) > a') |
| 16 | 16 | first_part = '' |
| 17 | 17 | |
| 18 | − if breadcrumbs.length == 2 && !kind.include?('class') | |
| 18 | + if breadcrumbs.length == 2 && kind.blank? | |
| 19 | 19 | first_part = breadcrumbs[1].content |
| 20 | 20 | elsif breadcrumbs.length == 3 |
| 21 | 21 | first_part = breadcrumbs[2].content |
| @@ -3,7 +3,7 @@ module Docs · 2 unmodified lines | ||
| 3 | 3 | self.type = 'dart' |
| 4 | 4 | self.root_path = 'index.html' |
| 5 | 5 | self.links = { |
| 6 | − home: 'https://www.dartlang.org/', | |
| 6 | + home: 'https://dart.dev/', | |
| 7 | 7 | code: 'https://github.com/dart-lang/sdk' |
| 8 | 8 | } |
| 9 | 9 | |
| @@ -23,13 +23,13 @@ module Docs · 13 unmodified lines | ||
| 23 | 23 | # Download the documentation from https://www.dartlang.org/tools/sdk/archive |
| 24 | 24 | |
| 25 | 25 | version '2' do |
| 26 | − self.release = '2.0.0' | |
| 27 | − self.base_url = "https://api.dartlang.org/stable/#{release}/" | |
| 26 | + self.release = '2.5.0' | |
| 27 | + self.base_url = "https://api.dart.dev/stable/#{release}/" | |
| 28 | 28 | end |
| 29 | 29 | |
| 30 | 30 | version '1' do |
| 31 | 31 | self.release = '1.24.3' |
| 32 | − self.base_url = "https://api.dartlang.org/stable/#{release}/" | |
| 32 | + self.base_url = "https://api.dart.dev/stable/#{release}/" | |
| 33 | 33 | end |
| 34 | 34 | |
| 35 | 35 | def get_latest_version(opts) |