Update Angular documentation (2.0.0)

pull/496/head
Thibaut Courouble 8 years ago
parent 50176de413
commit 555f434f32

@ -48,7 +48,10 @@
}
%pre-heading {
margin: 0;
padding: .375rem .625rem;
font-size: inherit;
font-weight: normal;
line-height: 1.5;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;

@ -11,6 +11,7 @@
h2 { @extend %block-heading; }
> h3 { @extend %block-label, %label-blue; }
.code-example > h4, .pre-title { @extend %pre-heading; }
p > code, .status-badge { @extend %label; }

@ -3,7 +3,13 @@ module Docs
class CleanHtmlFilter < Filter
def call
container = at_css('article.docs-content')
container.child.before(at_css('header.hero h1')).before(css('header.hero .badges')).before(css('header.hero + .banner'))
badges = css('header.hero .badge, header.hero .hero-subtitle').map do |node|
node.name = 'span'
node['class'] = 'status-badge'
node.to_html
end.join(' ')
badges = %(<div class="badges">#{badges}</div>)
container.child.before(at_css('header.hero h1')).before(badges).before(css('header.hero + .banner'))
@doc = container
css('pre.no-bg-with-indent').each do |node|
@ -17,7 +23,7 @@ module Docs
css('button.verbose', 'button.verbose + .l-verbose-section', 'a[id=top]', 'a[href="#top"]').remove
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').each do |node|
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|
node.before(node.children).remove
end
@ -60,11 +66,7 @@ module Docs
end
css('pre[name]').each do |node|
case node['data-language']
when 'html' then node.content = "<!-- #{node['name']} -->\n\n" + node.content
when 'css' then node.content = "/* #{node['name']} */\n\n" + node.content
else node.content = "// #{node['name']}\n\n" + node.content
end
node.before(%(<div class="pre-title">#{node['name']}</div>))
end
css('a.is-button > h3').each do |node|

@ -18,7 +18,7 @@ module Docs
end
end
name << '()' if at_css('.status-badge').try(:content) == 'Function'
name << '()' if at_css('.hero-subtitle').try(:content) == 'Function'
name
end
@ -30,7 +30,7 @@ module Docs
elsif slug == 'glossary'
'Guide'
else
type = at_css('.is-nav-title-selected').content.strip
type = at_css('.nav-title.is-selected').content.strip
type.remove! ' Reference'
type << ": #{mod}" if mod
type

@ -42,8 +42,8 @@ module Docs
end
version '2.0 TypeScript' do
self.release = '2.0.0rc6'
self.base_url = "https://angular.io/docs/ts/latest/"
self.release = '2.0.0'
self.base_url = 'https://angular.io/docs/ts/latest/'
end
private
@ -53,6 +53,9 @@ module Docs
string.gsub! '</code-example', '</pre'
string.gsub! '<code-pane', '<pre'
string.gsub! '</code-pane', '</pre'
string.gsub! '<live-example></live-example>', 'live example'
string.gsub! '<live-example', '<span'
string.gsub! '</live-example', '</span'
super string
end
end

Loading…
Cancel
Save