Browse Source

Update Angular documentation (2.4.1)

Thibaut Courouble 9 years ago
parent
commit
67a868c110
2 changed files with 7 additions and 3 deletions
  1. 5 1
      lib/docs/filters/angular/clean_html.rb
  2. 2 2
      lib/docs/scrapers/angular.rb

+ 5 - 1
lib/docs/filters/angular/clean_html.rb

@@ -13,7 +13,9 @@ module Docs
         @doc = container
 
         title = at_css('h1').content.strip
-        if title == 'Index'
+        if root_page?
+          at_css('h1').content = 'Angular Documentation'
+        elsif title == 'Index'
           at_css('h1').content = result[:entries].first.name
         elsif title == 'Angular'
           at_css('h1').content = slug.split('/').last.gsub('-', ' ')
@@ -42,11 +44,13 @@ module Docs
 
         css('pre[language]').each do |node|
           node['data-language'] = node['language'].sub(/\Ats/, 'typescript').strip
+          node['data-language'] = 'html' if node.content.start_with?('<')
         end
 
         css('pre.prettyprint').each do |node|
           node.content = node.content.strip
           node['data-language'] = 'dart' if node['class'].include?('dart')
+          node['data-language'] = 'html' if node.content.start_with?('<')
         end
 
         css('.multi-line-signature').each do |node|

+ 2 - 2
lib/docs/scrapers/angular.rb

@@ -9,7 +9,7 @@ module Docs
 
     html_filters.push 'angular/entries', 'angular/clean_html'
 
-    options[:skip_patterns] = [/deprecated/]
+    options[:skip_patterns] = [/deprecated/, /VERSION-let/]
     options[:skip] = %w(
       index.html
       styleguide.html
@@ -42,7 +42,7 @@ module Docs
     end
 
     version '2 TypeScript' do
-      self.release = '2.2.4'
+      self.release = '2.4.1'
       self.base_url = 'https://angular.io/docs/ts/latest/'
     end