Skip to content

Commit 941f33e

Browse files
committed
Update Angular documentation (6.0.4)
1 parent 4da5825 commit 941f33e

File tree

4 files changed

+34
-2
lines changed

4 files changed

+34
-2
lines changed

assets/stylesheets/pages/_angular.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,6 @@
1919
font-style: italic;
2020
text-align: right;
2121
}
22+
23+
td h3 { margin: 0 !important; }
2224
}

lib/docs/filters/angular/clean_html.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def call
77
at_css('h1').content = 'Angular Documentation'
88
end
99

10-
css('br', 'hr', '.material-icons', '.header-link').remove
10+
css('br', 'hr', '.material-icons', '.header-link', '.breadcrumb').remove
1111

1212
css('.content', 'article', '.api-header', 'section', '.instance-member').each do |node|
1313
node.before(node.children).remove
@@ -86,6 +86,14 @@ def call
8686
at_css('h1').content = subpath.remove('api/')
8787
end
8888

89+
css('th h3').each do |node|
90+
node.name = 'span'
91+
end
92+
93+
css('code code').each do |node|
94+
node.before(node.children).remove
95+
end
96+
8997
doc
9098
end
9199
end

lib/docs/filters/angular/entries.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ def get_type
1616
node.next_element.content.remove('@angular/')
1717
elsif at_css('.api-type-label.module')
1818
name.split('/').first
19+
elsif slug.start_with?('api/')
20+
slug.split('/').second
1921
else
2022
'Miscellaneous'
2123
end

lib/docs/scrapers/angular.rb

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def handle_response(response)
5959
end
6060

6161
version do
62-
self.release = '5.2.9'
62+
self.release = '6.0.4'
6363
self.base_url = 'https://angular.io/'
6464
self.root_path = 'docs'
6565

@@ -78,6 +78,26 @@ def handle_response(response)
7878
include Docs::Angular::Common
7979
end
8080

81+
version '5' do
82+
self.release = '5.2.11'
83+
self.base_url = 'https://v5.angular.io/'
84+
self.root_path = 'docs'
85+
86+
html_filters.push 'angular/clean_html', 'angular/entries'
87+
88+
options[:follow_links] = false
89+
options[:only_patterns] = [/\Aguide/, /\Atutorial/, /\Aapi/]
90+
options[:fix_urls_before_parse] = ->(url) do
91+
url.sub! %r{\Aguide/}, '/guide/'
92+
url.sub! %r{\Atutorial/}, '/tutorial/'
93+
url.sub! %r{\Aapi/}, '/api/'
94+
url.sub! %r{\Agenerated/}, '/generated/'
95+
url
96+
end
97+
98+
include Docs::Angular::Common
99+
end
100+
81101
version '4' do
82102
self.release = '4.4.6'
83103
self.base_url = 'https://v4.angular.io/'

0 commit comments

Comments
 (0)