Unified · Split
| @@ -1,24 +1,25 @@ | ||
| 1 | 1 | ._angular { |
| 2 | 2 | padding-left: 1rem; |
| 3 | 3 | |
| 4 | − h1, h2, > h3, .banner, .badges { margin-left: -1rem; } | |
| 4 | + h1, h2, > h3, .banner, .badges, .breadcrumbs { margin-left: -1rem; } | |
| 5 | 5 | |
| 6 | 6 | ._mobile & { |
| 7 | 7 | padding-left: 0; |
| 8 | 8 | |
| 9 | − h1, h2, > h3, .banner, .badges { margin-left: 0; } | |
| 9 | + h1, h2, > h3, .banner, .badges, .breadcrumbs { margin-left: 0; } | |
| 10 | 10 | } |
| 11 | 11 | |
| 12 | 12 | h2 { @extend %block-heading; } |
| 13 | 13 | > h3 { @extend %block-label, %label-blue; } |
| 14 | 14 | .code-example > h4, .pre-title { @extend %pre-heading; } |
| 15 | 15 | |
| 16 | − p > code, .status-badge { @extend %label; } | |
| 16 | + p > code, dd > code, .status-badge { @extend %label; } | |
| 17 | 17 | |
| 18 | − .l-sub-section, .alert, .banner { @extend %note; } | |
| 18 | + .l-sub-section, .alert, .banner, .breadcrumbs { @extend %note; } | |
| 19 | 19 | .banner { @extend %note-green; } |
| 20 | 20 | .alert.is-important { @extend %note-red; } |
| 21 | − .alert.is-helpful { @extend %note-blue; } | |
| 21 | + .alert.is-helpful, .breadcrumbs { @extend %note-blue; } | |
| 22 | + .breadcrumbs { padding-left: 2em; } | |
| 22 | 23 | |
| 23 | 24 | td > h3, .l-sub-section > h3, .l-sub-section > h4, .alert > h3, .alert > h4, .row-margin > h3 { |
| 24 | 25 | margin-top: .25rem; |
| @@ -9,7 +9,7 @@ module Docs · 8 unmodified lines | ||
| 9 | 9 | node.to_html |
| 10 | 10 | end.join(' ') |
| 11 | 11 | badges = %(<div class="badges">#{badges}</div>) |
| 12 | − container.child.before(at_css('header.hero h1')).before(badges).before(css('header.hero + .banner')) | |
| 12 | + container.child.before(at_css('header.hero h1')).before(badges).before(css('header.hero + .banner, header.hero .breadcrumbs')) | |
| 13 | 13 | @doc = container |
| 14 | 14 | |
| 15 | 15 | title = at_css('h1').content.strip |
| @@ -17,6 +17,8 @@ module Docs · 1 unmodified line | ||
| 17 | 17 | at_css('h1').content = result[:entries].first.name |
| 18 | 18 | elsif title == 'Angular' |
| 19 | 19 | at_css('h1').content = slug.split('/').last.gsub('-', ' ') |
| 20 | + elsif at_css('.breadcrumbs') && title != result[:entries].first.name | |
| 21 | + at_css('h1').content = result[:entries].first.name | |
| 20 | 22 | end |
| 21 | 23 | |
| 22 | 24 | css('pre.no-bg-with-indent').each do |node| |
| @@ -28,9 +30,9 @@ module Docs · 5 unmodified lines | ||
| 28 | 30 | node.parent.content = node.parent.css('code, pre').map(&:content).join("\n") |
| 29 | 31 | end |
| 30 | 32 | |
| 31 | − css('button.verbose', 'button.verbose + .l-verbose-section', 'a[id=top]', 'a[href="#top"]').remove | |
| 33 | + css('button.verbose', 'button.verbose + .l-verbose-section', 'a[id=top]', 'a[href="#top"]', '.sidebar').remove | |
| 32 | 34 | |
| 33 | − css('.c10', '.showcase', '.showcase-content', '.l-main-section', 'div.div', 'div[flex]', 'code-tabs', 'md-card', 'md-card-content', 'div:not([class])', 'footer', '.card-row', '.card-row-container', 'figure', 'blockquote', 'exported', 'defined', 'div.ng-scope', '.code-example header').each do |node| | |
| 35 | + css('.c10', '.showcase', '.showcase-content', '.l-main-section', 'div.div', 'div[flex]', 'code-tabs', 'md-card', 'md-card-content', 'div:not([class])', 'footer', '.card-row', '.card-row-container', 'figure', 'blockquote', 'exported', 'defined', 'div.ng-scope', '.code-example header', 'section.desc', '.row', '.dart-api-entry-main', '.main-content', 'section.summary', 'span.signature').each do |node| | |
| 34 | 36 | node.before(node.children).remove |
| 35 | 37 | end |
| 36 | 38 | |
| @@ -44,6 +46,12 @@ module Docs · 7 unmodified lines | ||
| 44 | 46 | |
| 45 | 47 | css('pre.prettyprint').each do |node| |
| 46 | 48 | node.content = node.content.strip |
| 49 | + node['data-language'] = 'dart' if node['class'].include?('dart') | |
| 50 | + end | |
| 51 | + | |
| 52 | + css('.multi-line-signature').each do |node| | |
| 53 | + node.name = 'pre' | |
| 54 | + node.content = node.content.strip | |
| 47 | 55 | end |
| 48 | 56 | |
| 49 | 57 | css('a[id]:empty').each do |node| |
| @@ -3,7 +3,7 @@ module Docs · 2 unmodified lines | ||
| 3 | 3 | class EntriesFilter < Docs::EntriesFilter |
| 4 | 4 | def get_name |
| 5 | 5 | if slug.start_with?('tutorial') || slug.start_with?('guide') |
| 6 | − name = at_css('.nav-list-item.is-selected').content.strip | |
| 6 | + name = at_css('.nav-list-item.is-selected, header.hero h1').content.strip | |
| 7 | 7 | else |
| 8 | 8 | name = at_css('header.hero h1').content.strip |
| 9 | 9 | end |
| @@ -18,7 +18,11 @@ module Docs · 8 unmodified lines | ||
| 18 | 18 | end |
| 19 | 19 | end |
| 20 | 20 | |
| 21 | − name << '()' if at_css('.hero-subtitle').try(:content) == 'Function' | |
| 21 | + subtitle = at_css('.hero-subtitle').try(:content) | |
| 22 | + breadcrumbs = css('.breadcrumbs li').map(&:content)[2..-2] | |
| 23 | + | |
| 24 | + name.prepend "#{breadcrumbs.join('.')}#" if breadcrumbs.present? && breadcrumbs[0] != name | |
| 25 | + name << '()' if %w(Function Method Constructor).include?(subtitle) | |
| 22 | 26 | name |
| 23 | 27 | end |
| 24 | 28 | |
| @@ -46,7 +50,10 @@ module Docs · 21 unmodified lines | ||
| 46 | 50 | private |
| 47 | 51 | |
| 48 | 52 | def mod |
| 49 | − @mod ||= slug[/api\/([\w\-]+)\//, 1] | |
| 53 | + return @mod if defined?(@mod) | |
| 54 | + @mod = slug[/api\/([\w\-\.]+)\//, 1] | |
| 55 | + @mod.remove! 'angular2.' if @mod | |
| 56 | + @mod | |
| 50 | 57 | end |
| 51 | 58 | end |
| 52 | 59 | end |
| @@ -36,7 +36,7 @@ module Docs · 35 unmodified lines | ||
| 36 | 36 | stub 'api/' do |
| 37 | 37 | capybara = load_capybara_selenium |
| 38 | 38 | capybara.app_host = 'https://angular.io' |
| 39 | − capybara.visit('/docs/ts/latest/api/') | |
| 39 | + capybara.visit(URL.parse(self.base_url).path + 'api/') | |
| 40 | 40 | capybara.execute_script('return document.body.innerHTML') |
| 41 | 41 | end |
| 42 | 42 | |
| @@ -45,6 +45,16 @@ module Docs · 2 unmodified lines | ||
| 45 | 45 | self.base_url = 'https://angular.io/docs/ts/latest/' |
| 46 | 46 | end |
| 47 | 47 | |
| 48 | + version '2 Dart' do | |
| 49 | + self.release = '2.1.2' | |
| 50 | + self.base_url = 'https://angular.io/docs/dart/latest/' | |
| 51 | + | |
| 52 | + options[:skip_patterns] += [/angular2\.compiler/] | |
| 53 | + options[:skip_link] = ->(link) do | |
| 54 | + link.parent['class'].try(:include?, 'inherited') || link.parent.parent['class'].try(:include?, 'inherited') | |
| 55 | + end | |
| 56 | + end | |
| 57 | + | |
| 48 | 58 | private |
| 49 | 59 | |
| 50 | 60 | def parse(string) |