| @@ -13,7 +13,9 @@ module Docs · 12 unmodified lines |
| 13 | @doc = container | 13 | @doc = container |
| 14 | | 14 | |
| 15 | title = at_css('h1').content.strip | 15 | title = at_css('h1').content.strip |
| 16 | if title == 'Index' | 16 | if root_page? |
| | 17 | at_css('h1').content = 'Angular Documentation' |
| | 18 | elsif title == 'Index' |
| 17 | at_css('h1').content = result[:entries].first.name | 19 | at_css('h1').content = result[:entries].first.name |
| 18 | elsif title == 'Angular' | 20 | elsif title == 'Angular' |
| 19 | at_css('h1').content = slug.split('/').last.gsub('-', ' ') | 21 | at_css('h1').content = slug.split('/').last.gsub('-', ' ') |
| @@ -42,11 +44,13 @@ module Docs · 22 unmodified lines |
| 42 | | 44 | |
| 43 | css('pre[language]').each do |node| | 45 | css('pre[language]').each do |node| |
| 44 | node['data-language'] = node['language'].sub(/\Ats/, 'typescript').strip | 46 | node['data-language'] = node['language'].sub(/\Ats/, 'typescript').strip |
| | 47 | node['data-language'] = 'html' if node.content.start_with?('<') |
| 45 | end | 48 | end |
| 46 | | 49 | |
| 47 | css('pre.prettyprint').each do |node| | 50 | css('pre.prettyprint').each do |node| |
| 48 | node.content = node.content.strip | 51 | node.content = node.content.strip |
| 49 | node['data-language'] = 'dart' if node['class'].include?('dart') | 52 | node['data-language'] = 'dart' if node['class'].include?('dart') |
| | 53 | node['data-language'] = 'html' if node.content.start_with?('<') |
| 50 | end | 54 | end |
| 51 | | 55 | |
| 52 | css('.multi-line-signature').each do |node| | 56 | css('.multi-line-signature').each do |node| |